-
Notifications
You must be signed in to change notification settings - Fork 2
Home Assistant integration
Home Assistant integration is provided through MQTT. MQTT discovery topics will publish most entities to your configured MQTT-broker. With the proper addons, your Home Assistant instance will create the necessary entities automatically. Domotics Master will both reports all entity state changes and accept status changes coming from Home Assistant.
For the MQTT integration to work, you need to:
- Install an MQTT broker. I used installed the "Mosquitto broker" addon in my Home Assistant instance.
- Install the MQTT integration from the home assistant Integration Catalogue.
- Configure the values for MQTT_BROKER, MQTT_PORT, MQTT_USERNAME and MQTT_PASSWORD in your config/config.py file. (You can use config\sample_config.py as a template)
- The code works with MQTT over TLS. You need to either configure a valid certificate for your MQTT broker or remove the line "client.tls_set()" from mqtt/mqtt_worker.py.
The entities will create topics within there separate domains (light, cover and ventilation). Within these topics there is a topic for every relevant entity. Each entity has at least one state topic (which is persistent) and one command topic that Home Assistant can use to control it.
Lighting entities can either be binary or dimmable. Dimmable lights have both the ON/OFF state and the brightness state.
Cover is the domain used by shades. They can report 5 states (open, opening, stopped, closing and closed). Open means the shade is deployed and the window is covered. There are separate state and command topics to report and control the position of the shade more granularly.
TODO