MQTT entities become unknown on reboot

Hi all,
I’m a bit lost on this one… dug through similar topics, but no luck.

I read in my weather station data from CumulusMX into Home Assistant via MQTT. Works fine in principle, but when I reboot the system, all sensors turn to ‘Unknown’.

The data still arrives as far as I can tell (from the timestamp) from the MQTT explorer:

The first time setting it up I followed the (supposedly wrong?) docs and created a ‘homeassistant’ login for MQTT. When it stopped working no steps I found in other threads worked, so I deleted the MQTT integration and the integration and re-installed. This time following the advice and NOT creating a login, but rather a mqtt user in HA. The entities were re-discovered and reconnected to the previous data, but I had to remake the dashboard, which is quite annoying given the number of sensors.
Few hours ago I shut down the system temporarily and the sensors are Unknown again.

Does anyone have any clue how that might be solved? Re-installing everything after every reboot is obviously not an option. Especially since I plan to have the system reboot every night.

Home Assistant OS is running in a VM on Proxmox on a Raspberry Pi 5, which also runs CumulusMX directly in the RaspiOS.
I have the suspicion that may somehow be the cause of the problem, but I don’t even know what I’m doing half of the time with Linux.

Hello DrVoidberg,

You may want to turn on retain on some of those and others you may want to find a way to update them after a home assistant restart.

Thanks for the (unbelievably) fast reply.
I gratefully took the (originally french, lol) MQTT configuration for CumulusMX from somebody who had it all set to retain. From what I’ve read about retaining it also kind of made sense to always have the latest state available.

I changed the MQTT configuration in CumulusMX to not retain, deleted the retained topics and rebooted. The sensors are back, but returned to their original names, breaking the dashboard again. Still, that’s a step forward, thanks. I’ll keep the sensor names and the topic open for now to see if everything stays intact after reboots.

I’ve let everything run until now and did a reboot.
Now all the sensors are ‘Unavailable’ and not coming back. Any more ideas?

Just in case anyone else with the problem stumbles over this:

The problem seems to be a delay between CumulusMX and Home Assistant booting up.
CumulusMX is up a few seconds after system reboot, while HA takes a few minutes (running in a VM and all that).
It looks like that causes CumulusMX to fail to connect to the broker and then simply not trying again it seems. Manually restarting CumulusMX after HA is up solves the problem.
I will try with automatically restarting the service 5 minutes after boot. Not an elegant solution, but at least a solution if it works.