mtdcr / homematic-mqtt-bridge

A bridge between Homematic and MQTT with support for Home Assistant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A bridge between Homematic and MQTT

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:

Home Assistant, when configured for MQTT discovery, can auto-detect sensors and device triggers published by this program.

Dependencies

How to use

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>.

Docker

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 ....

How to get new devices supported

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.

About

A bridge between Homematic and MQTT with support for Home Assistant

License:MIT License


Languages

Language:Python 99.1%Language:Dockerfile 0.9%