I noticed that in the docs, MQTT discovery does not save states for devices between reboots.
The embedded MQTT broker does not save any messages between restarts. If you use the embedded MQTT broker you have to send the MQTT discovery messages after every Home Assistant restart for the devices to show up.
However, after trying a few things, it’s clear to me that I don’t know what you have to send the MQTT discovery messages after every Home Assistant restart means.
Does anyone know of a way to make an automation that will launch at startup that can do this step?
I am using tasmota devices, made from sonoff S31 outlets, and I would like the state to be accurate when I restart HA.
Thanks for the reply.
I tried that, and the automation does execute as expected. On the Tasmota device console I can see that the mqtt request comes in and the device returns the status as requested (in json). However, the status in Home Assistant still doesn’t update. It won’t update again until the device sends tele/tasmota_******/STATE , which I think it does every 5 mins.
Any ideas on what the UI won’t update when the status is sent?