3 ms·
I observed this as well and was just starting to dabble in MQTT with my ESP projects. I have yet to find a good resource for outlining autodiscovery. Most of
by cptskippy 5y ago
I observed this as well and was just starting to dabble in MQTT with my ESP projects.
I have yet to find a good resource for outlining autodiscovery. Most of the projects I have come across just hard code some pub paths in the homeassistant namespace.
- thequux 5y agoThe official docs[1] had everything I needed to know in order to make discovery work for my own hardware; essentially, you're just pushing a config stanza in JSON to a particular MQTT path. The only thing that's not immediately clear from the docs is that the discovery data should either be pushed in retain mode or resent every few minutes, and even though it's optional, you should include a unique_id so that the device can be tweaked in the web UI. [1] https://www.home-assistant.io/docs/mqtt/discovery/ https://www.home-assistant.io/docs/mqtt/discovery/
- joshspankit 5y agoAfter being in the trenches on this type of thing: unique_id is officially optional, but HIGHLY suggested. Personally, I like to use the MAC since it means code reuse, but whatever it is make sure it’s there and unique.
- cptskippy 5y agoThanks, that's incredibly helpful. I don't know what it is about the hassio docs but I have a hard time groking them and quite often find myself looking elsewhere for clarification.