A lightweight Python3 parser for publishing FS20 messages from a serial CUL device to home-assistant using a MQTT server.
Notes: This is tested on Ubuntu Linux, but should work on a RaspberryPi or similar
- A compatible CUL device. I'm using a self-built Arduino nano v3 CUL: https://wiki.fhem.de/wiki/Selbstbau_CUL#Software (German language)
- PySerial and Paho-MQTT libraries for Python3
- Set up Python3
- Clone or download this repository
pip3 install pyserial paho-mqtt
- Open cul.py and adjust config values accordingly (especially the serial port)
- Check you have full access to the serial port
- Enable home-assistant MQTT plugin in configuration.yml:
mqtt:
discovery: true
discovery_prefix: homeassistant
python3 cul.py
and cross your fingers
- When starting the application, home-assistant will autodiscover a new device. It will create duplicate devices on every new restart of cul-hass-mqtt. This is a known bug with the MQTT service, so just restart home-assistant to remove duplicates.
- The only supported types at the moment are ON / OFF binary_switches. Feel free to create a pull request for extensions!
- Create a pull request with your code.
MIT, see LICENSE