Hello. I have mqtt esphome sensor that is in deep sleep for 4 hours. It has retain flag: true
When I restart Home Assistant the sensor shows as unavailable until it wakes from deep sleep and sends value state. However, the mqtt broker mosquitto remembers last value and can show it when the sensor sleeps.
Can this be fixed that Home Assistant after restart reads last value sent by sensor which is currently in deep sleep? Possibly from mqtt broker?
Hello Tom, I am sorry I do not quite understand. From the documentation and from other posts here I understand I need to disable availability reporting by setting birth and will messages to empty and I have that:
It is also consistent with documentation that you refer to, that if birth and will topics have empty message then availability reporting is disabled.
Isn’t that what I want to achieve, to not to report “Unavailable”? But it still does. In the mosquitto_sub I can see last state message even if sensor is offline. Looks like it is not pushed to Home Assistant.
I use mosquitto add-on. Still, when I restart HA the sensor shows as unavailable until it wakes up and sends new state. The configuration in home assistant is following:
Not yet. I just dont make any config changes in yaml and I dont restart HA Thats one advantage of running HA in VirtualBox, when I need to restart hostin OS, I save state of virtual box, restart computer and then restore state of HA. It even does not recognize that its host machine has been restarted.
Thanks, but if you mean discovery: true in mqtt: section then it does not work for me. I have it there from very beginning yet HA shows unavailable if it restarts while sensor is in deep sleep.