4 ms·
The 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 JS
by thequux 5y ago
The 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.