-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR] Home Assistant Auto Discovery #4982
Comments
So this would really benefit from a specific publish command to set the retained state of those messages. |
I think I'll go for option 4 as that would be the least amount of work for me.... oh wait.... ;) |
Well there is already an issue/feature request for publish_r (or whatever the name will be) to be able to pick which messages will be retained and which aren't. Anyway the idea is to make the auto discovery a bit more like the name suggests... auto. So keep them examples coming, as it gives great insight in the process. |
Ok, one moment, So a lot of inspiration I found here. I looked at: https://github.com/FlyingDomotic/domoticz-mqttmapper-plugin but that is a mapper not AD. topic for switch device => tasmota12/switch/123456789ABC_relay/config
topic for power device => tasmota12/sensor/123456789ABC_power/config
topic for energy device => tasmota12/sensor/123456789ABC_total/config
source: https://www.domoticz.com/forum/viewtopic.php?p=312108#p312108 The process by itself looks like there needs to be a config topic for the device where it is defined and how it can be controlled (So HA or Domoticz should be able to find that topic, in my case espeasy-discover). In addition the config (state_topic) will also tell you where the 'real messages' can be found in mqtt. That is why teacher4domo works. It tells Domoticz only once where the 'retained' messages are found and unless you install new devices, you do not need to re-run the teacherscript. At least that is how I see the world of autodiscovery at this moment. |
Yep, the idea of using retained messages for discovery/config topics is that Home Assistant can find those again right after connecting to the MQTT broker again (e.g. after a reboot of HA) |
I started cheating a bit (in case mosquitto thinks about 'restarting') using the following config change as well: (is not an espeasy problem of course more general hygiene..)
At least storing every 30 sec the last messages. |
Retained messages don't have a lot to do with Mosquitto MQTT broker restarting. |
Not sure if that's a good plan when running your RPi on an SD-card... (default interval is 30 minutes, that seems often enough) |
@TD-er Best regards |
Have been away the last couple of days, so a late reply. Currently I am working on doing a full re-work of the WiFi part of the code as I promised I would do as soon as the transition to ESP-IDF5.x was finished. After this I will have a look at the auto discovery. I know there is also some auto discovery code implemented in C014, however I have no idea about how compatible this is with HomeAssistant. |
Good morning TD-er, Thanks the update and all the effort you pun into this. Thanks for all the help. Best regards |
Need to have auto discovery for Home Assistant.
So first need to collect some info.
The text was updated successfully, but these errors were encountered: