-
Notifications
You must be signed in to change notification settings - Fork 108
Home
pyhomematic is a Python 3 module that aims to provide easy interaction with Homematic devices. It is both possible to control Devices like switches, as well as receive events sent from sensors.
It is NOT designed to replace your Homematic infrastructure and does NOT provide any fancy UI. It is only a library which enables you to build you own applications. These applications have to implement logic, eventhandling (you can use callback functions), and whatever you need.
Development has started to provide Homematic-integration for Home-Assistant initially. But feel free to use it however you like.
If pyhomematic doesn't seem to meet your dependencies, the pmatic library may be an alternative.
In a basic setup, Homematic users use a CCU. A central device which communicates with paired sensors, switches etc.. Alternatives are available, where the basic functionality of the CCU is reproduced, such as Homegear. pyhomematic supports both the use of the official CCU and Homegear. Other solutions exposing similar services may work as well.
When connected to a computer network, the CCU provides an XML-RPC server, which client-applications can use to receive information about paired devices or send commands to manipulate devices capable of performing actions. Additionally, the CCU is able to send events to client-applications, to which they can react. This way the application does not have to constantly poll the CCU to get the current state of individual devices.
pyhomematic leverages this XML-RPC API to provide easy Homematic interaction through Python 3. To accomplish this, pyhomematic does two things:
- Connect to the CCU as a client
- Provide an XML-RPC Server to which the CCU will send event data
If you are interested in the used API, you can download the API-Reference here: HomeMatic XML-RPC-Schnittstelle (V2.17, German)
Once pyhomematic has successfully connected to the CCU and subscribed to receive event-notifications, it will negotiate with the CCU which devices are paired. This information is then used to create Python-objects, which provide the mechanisms to interact with the specific Homematic-Device conveniently. Please note, that currently only a few devices are implemented with these easy to use properties and methods. But even devices currently not implemented are available, and can be controlled manually if you know the internal working of the device you are trying to control. A list of supported / implemented devices and their functionality will be available here soon.