ON restart HA, entities lost via Mosquitto brocker

Hello,
I have Mosquitto brocker set on HA on RPI 64 bits usb boot.
My entities are well pulled from homey box to Home Assistant.

Problem ?
When i restart Home Assistant, they get lost and i have to reconfigure Mosquitto and restart it in home Assistant and hopefully it work everytime.

Any idea what i could be due to ?
Maybe that ? https://www.home-assistant.io/docs/mqtt/birth_will/

Probably because the entities are created by MQTT Discovery and the ‘homey box’ is not publishing the discovery payloads as retained messages. As a result, when Home Assistant restarts and re-connects to the MQTT broker, it receives no discovery data because none of the data is retained by the broker.

I’m unfamiliar with homey but you need to configure it (somehow) so it publishes retained messages for MQTT Discovery.

Many thanks for having taken time for that information it seems you are right.

I have new event after adding birth/will
Now when i restart HA, i have to broadcast again MQTT HUB on homey, and my devices appear immediately active again in HA.
So probaby you are right…

If entities, that are created by MQTT Discovery, completely disappear when Home Assistant is restarted, that means their discovery information is missing. The most common reason for it being missing is that it was not retained by the broker. The broker only retains what it is instructed to retain.

Yes cool but you cleverness is too much and my brain cannot follow.
Ifyou have any concrete code or something i take it !

For anyone joining the discussion, please note that :slight_smile:

1/ as soon as i rebroadcast from mqtt hub on homey, HA gets entities again straight away
2/ i am not able to switch on a light from HA

Have you seen this post in the Homey forum?

I did apply that it did not work untill i had the idea of restarting/rebooting homey
Now all is solved …

Thank you 123!

1 Like

You’re welcome!

If any of my posts helped solve the problem, please consider marking it with the Solution tag. By doing that, it will automatically place a check-mark next to the topic’s title which signals to everyone that this topic has an approved solution. This helps other users find answers to similar questions.