I use MQTT to integrate some devices with HA:
- A Netatmo-MQTT bridge which I extended with HA Discovery support
- A Smart Meter P1 monitor with HA Discovery support
- A Milight Hub which also has HA Discovery support
All devices and entities are correctly discovered by HA.
However, whenever HA is restarted, all MQTT entities are unavailable and I have to trigger sending of the HA Discovery config on all devices to get it working again. As I’m integrating more devices with HA via MQTT, this because more and more a burden.
Is this expected behaviour of HA?
Does HA not cache the configuration of those MQTT entities?
Why is HA not able to reconnect those entities? The device keep sending data so that should not be the problem.
Before I was also loosing the the data whenever HA thought the entity was not available, so now I have a Telegram instance running forwarding MQTT data to an Influx instance.
But since I experiment a lot, and therefore restart often, I really would like this issue to be solved.
Does HA announce itself as ‘offline’ before restarting, and ‘online’ when back online?
Otherwise I could add some logic to the devices to monitor HA and re-announce the config when HA is back online.
But I consider this a workaround since HA should in my opinion properly continue the MQTT entities after restart.
Cheers,
Joost