This program receives events from a Homematic CCU and publishes contained data on MQTT. It also subscribes to commands from MQTT and relays them to the CCU.
Currently supported devices:
- HmIP-BROLL: Shutter actuator for brand switches
- HmIP-SRH: Window handle sensor
- HmIP-SWSD: Smoke alarm with Q label
Home Assistant, when configured for MQTT discovery, can auto-detect sensors and device triggers published by this program.
- Python 3.7+
- asyncio-mqtt >= 0.7.0
- pyhomematic
hm-mqtt-bridge.py --broker mqtt://broker.local --listen 0.0.0.0 xmlrpc://ccu.local:2010
Homematic's XML-RPC mechanism requires listening sockets on both ends. By default, a random port number gets allocated by pyhomematic. If you need a fixed port number, specify it with --listen <ip>:<port>
.
There is also a rudimentary docker container available. It checks out the latest version of this repository and runs it in a debian container with python3 and all the necessary dependencies installed.
docker build --pull -t homematic-mqtt-bridge .
docker run -it homematic-mqtt-bridge /opt/homematic-mqtt-bridge/hm-mqtt-bridge.py ....
In order to support new devices, I need their names and the channels they use. To help with that you can run the hm-inventory.py script. Either directly:
python3 -m venv $someDirectory
source $someDirectory/bin/activate
pip install pyhomematic
./hm-inventory.py --connect xmlrpc://$ccuIP:2010 | tee inventory.log
or using the docker container:
docker build --pull -t homematic-mqtt-bridge .
docker run -it homematic-mqtt-bridge /opt/homematic-mqtt-bridge/hm-inventory.py --connect xmlrpc://$ccuIP:2010 | tee inventory.log
It does not stop running, as it records incoming events from the devices. It helps if you can press some buttons on the devices in question. If you are done, stop the script (ctrl-c).
Post this file as a new issue with the device name you want supported.