MQTT Sensor on Reboot unavailable?

Hi Guys,

I’ve build my first mqtt esp8266 sensor today, but have some issues with Home Assistant (Hass.io):

After a restart of HA, the mqtt sensor is ‘unavailable’ , but when i disconnect the network cable and plug it back in the sensor will be available and shows the data.

In the Serial monitor of Arduino IDE… it doens’t show its disconnected from the MQTT server when i do a ‘restart’ in HA, when i pull the network cable it does show a disconnected mqtt server and tries to reconnect again. So it looks like the mqtt server isn’t ‘offline’ while doing a restart in HA? But it doesn’t pick up the data afterwards.

How can i fix this? :slight_smile:
Thanks!

If the messages are published with the retain flag set the sensor will receive an instant state update after subscription and Home Assistant will display the correct state on startup. Otherwise, the initial state displayed in Home Assistant will be unknown.

1 Like