End of last year, I started using HA and I’m using recently Zigbee2Mqtt 1.9.0 without any issue.
Both of them are running in Docker on my Synology NAS. Very easy to configure and use…
It looks like after 0.104 updates, my Zigbee devices are unavailable after HA restarted. I didn’t find any error in HA and Zigbee2Mqtt logs.
The only solution to get my devices available is to restart Zigbee2Mqtt.
Does someone have the same issue?
Does a better solution exist?
I try this automation changing “ikeaoutlet1” with one of my Zigbee devices.
Some of my Zigbee devices are now present after restarting but the majority have the “Unknown” status.
Did I need to have this automation of each device?
I join this discussion because I got a similar behaviour. I installed HASS + zigbee2mqtt + mqtt HA module on january 18 : everything worked flawlessly and auto discovery showed up all my compatible devices : zigbee devices and tasmota devices. Everything synced perfectly until I restarted HA after having installed HACS, on january 25. From this moment all MQTT devices disappeared from the UI. In the device menu they are marked “unavailable”. If I sniff MQTT in the debug tool I can see the Zigbee MQTT messages. My tasmota MQTT devices are set to send status messages every 300s, but they still don’t appear anymore. The only two MQTT devices still working are those coming from Domoticz via MQTT. I don’t know how to solve this.
I’ve also noticed that when restarting HA usually all z2m devices have their status correctly set at boot time, but there is the occasional reboot of HA that they do not restore their status and I have to wait for the sensors to send data to be updated.
Apologies if this information is wrong (I don’t use zigbee2mqtt) but this sounds like a topic retention issue. If the topics are sent retained to the broker then the client (HA) can read their states immediately on connection. It doesn’t have to wait for an update. Is that an option within zigbee2mqtt ?
MQTT discovery does exactly the same but once topics are retained devices are online immediately.
Retain flag isn’t necessary. Zigbee devices after HA restart are unavailable because Mosquitto MQTT broker add-on doesn’t send birth_message. Try to add to configuration.yaml:
I have this from day one in my configuration.yaml. But on my (slow) test-HA I still need to ask the state or it takes a long time before my sensors update.
i’m having a problem where i restart the HA machine(dell t30 server) (which holds HA and mqtt broker in docker containers), when coming back online the sensors from zigbee2mqtt unavailable.
the zigbee2mqtt and the cc2531 sits on on different machine (pi4)
when i restarts only the HA container everything works. (the birth/will messages configured)
i think that when the mqtt container is restarting, the zigbee2mqtt can’t reconnect and send messages so even when my dell machine come back online with HA and mqtt, i see the unavailable message.
If you put this in the configuration.yaml isn’t this additional mqtt plugin obsolete?
I’m on 110.4 and on a raspberry 3b+ with ssd
I use zigbee2mqtt and the officially mqtt addon
and after reboot the half of my zigbee entities is gone or unavailable in the frontend.
On the zigbee2mqtt log i see them shouting out temperetures and occupancies like before, but the entities are dead
First i tried your birth and will hint on the addon config itself.
Later the whole code snippet in the config.
Nothing happened so far (i rebootet for sure)
Do i need the localhost ip in your broker line?!
UPDATE!
DID IT
Soooo absolutely bad
After i recognized its only the sensors part i checked my config and cleaned up a bit.
My instance is there since version < 80
and obviously i had some sensor config which isn’t supported with 110
in mosquitto - only availability messages (like zigbee2mqtt/east_outer_th_sensor/availability) are sent with retain flag, other messages are sent without retain
all entities are autodiscovered and wasn’t renamed.
Entities aren’t lost themselves- I can query state from UI of all entities- sate will be unavailable, but history is preserved.
HomeAssistant reboot (in docker) lead to all entities become unknown before they resent their messages again.
neither mosquitto nor zigbee2mqtt reboot doesn’t lead to such behavior.
Either if after HA restart I preventively restart zigbee2mqtt- it doesn’t help.
After ~15 minutes all messages from sensors arrive, but I wan’t to implement automation on status change and these unavailability statuses will lead to unnecessary triggering
I can manually send online message to hass/status - it doesn’t help.
Very strange, but binary_sensor door open - is preserved, so it doesn’t become unavailable after reboot