Home Assistant MQTT projects and notes
There is a built in broker, but I decided to use the addon broker in hassos instead. There was an issue using TLS between the containers, but otherwise the setup was pretty straight forward. More details:
- Docs: https://www.home-assistant.io/docs/mqtt
- Enable discovery for setting up sensors https://www.home-assistant.io/docs/mqtt/discovery/
- JSON examples: https://www.home-assistant.io/docs/mqtt/processing_json/
Home Assistant can generate sensors dynamically if you enable the MQTT discovery option. Once enabled the following topic/payloads will create new entities.
Topic: homeassistant/binary_sensor/garden/config
Payload: {"name": "garden", "device_class": "motion"}
Topic: homeassistant/binary_sensor/garden/state
Payload: ON
Payload: OFF
To remove the sensor send an empty payload to the same config topic
- More testing options: https://www.home-assistant.io/docs/mqtt/testing/
- MQTT Test client: http://workswithweb.com/mqttbox.html
- OSS MQTT for IOT: https://github.com/1technophile/OpenMQTTGateway
- Another RPI MQTT project: https://github.com/Shmoopty/rpi-appliance-monitor