MQTT - states on HA restart

Hi. I’m not quite sure how to word this properly so please bear with me!

I’ve got a few different MQTT devices talking to Mosquitto which all works perfectly. However, if I need to restart HA the states of these devices change back to whatever the default is. For example, I use a bluetooth iBeacon with Owntracks for presence detection. If I’m home and restart HA, Owntracks never sends additional updates and so HA believes I am away.

Is there a way to get HA to “ask” Mosquitto for the current published messages on start up?

Hi, generally speaking, that’s the difference between retained and not retained MQTT messages.
when HA restarts and re-subscribe to a topic, if the last message on that topic was flagged retained from the sender, it will be re-sent to HA, otherwise the message is lost.

So it’s actually up to the app or the device (owntracks in your case) to publish retained messages or not.

Thanks. I’ve done a been of reading on MQTT terminology and think I’ve got it figured out.