Usage

To use Gearthonic in a project:

from gearthonic import GearClient
# Initialise the client with the host and port of your homegear server
gc = GearClient('192.168.1.100', 2001, secure=True)
# Now you can make your requests
gc.device.list_methods()
gc.device.get_value(1, 4, 'ACTUAL_TEMPERATURE')

The default port of the Homegear XML RPC server is 2001.

All methods are already implemented within the client to make it easy to use. You don’t have to lookup all methods and their parameters, just look at the code or see Method Reference.

Alternatively you can call any method directly via the client or use the generic ‘’call’‘-method:

gc.getValue(1, 4, 'ACTUAL_TEMPERATURE')
gc.call('system.listDevices')
gc.call('getValue', 1, 4, 'ACTUAL_TEMPERATURE')

A full list of all available methods provided by the XML RPC server can be found in the wiki of the Homegear project.

Security

If you set secure=True while initialising the GearClient, the client tries to establish a secure connection to the server via SSL. It’s highly recommended to use SSL for the network traffic. Otherwise the communication is not encrypted.