Zigbee2MQTT devices suddenly became unavaliable

No, sorry. I gave up and listen to switches via MQTT.

I have changed the name so there are no spaces (both as ID and “home assistant” setting in Z2M), set Retain and Optimistic (with home assistant).

I will see what it gives …

Mario

Mine look like this. They all show as ‘unavailable’ but - except for two buttons in the office - work just fine.

On the other hand, my motion sensors look like this and are available with no problem.

19 hours later still good!
I turned on a switch in HA and Z2M showed the same info, and vice versa works as well.

The only thing is that I have not visual control over the device (since it is in a house 40 km away).

I will add some other sensors very soon …

If it breaks I will report it here …


You are up to something @bogorad. I just created helper for my washing machine status. And for some reason it doesnt update status until I restart zigbee2mqtt addon.
I tried this. Create helper and automation for status. When I check status, status was wrong. I manually open and closed the door and turn washing machine on/off and open the door, status is updated.
But if I restart home assistant, status went back to wrong one. I check automation but I don’t see anything wrong with it. Sensor that should report status is in correct position. To update status to correct one I had to restart zigbee2mqtt.

I skimmed thru the thread and I might have miss something.

But. have you made sure the Availability setting in Z2m is enabled?

Hope it’s helpful.

certainly:

I was checking things and I saw that my Transmit power under settings was set to 5.
Change it to 20. Not sure will it help but maybe my adapter was set on low setting.

Previous screenshots clearly show that z2m works, and MQTT is updated properly (as seen via MQTTexplorer). Even HA can see the proper messages when explicitly instructed to subscribe to a topic. There is absolutely nothing wrong with z2m or MQTT, so why fiddle with a properly working config?

Because it doesnt make any sense. If in z2m is status oke it should be the same in ha. But sometimes it isnt.

Hi Eugene,

my setting is going good … I have change a switch in HA and it appears in Z2M and vice versa …

Mario

Do you connect your Zigbee dongle directly to USB or via an extention cable…When I first got my Zigbee dongle I plugged it into a USB3 port directly… I was having lots of werid stuff happen so after some research discovered that USB3 ports interfere with zigbees wifi signal…I bought a 1 meter USB extention cable for the USB dongle and my problems went away (SONOFF Zigbee 3.0 USB E)

1 Like

Came across the same problem just now. Not wanting to move everything over to MQTT, and the room getting colder because my Zigbee controlled heating had just turned off, I went to trying various things.

After disabling availability in Z2M, I noticed the state of most became Unknown. Turning availability back on, set them to Unavailable again. So the state is seen and tracked, and HA did read the config properly as it was looking for an availability topic as specified in the homeassistant/type/name/entity/config topic. But this just updates the config, which references the topic which tracks availability.

The problem was that most devices did not have an availability sub-topic under zigbee2mqtt/device_name, where HA expected it based on the config, and as such were marked as Unavailable.

image
Just one device with an availability topic.

The simple fix was to restart Z2M, as you did as well, which publishes the availability subtopic to the current state. This will also get published when availability changes (i.e. the device is turned off/on, or the timeout for the device type is met), so for some devices just waiting may be the ‘fix’.

I am not sure how part of the availability topics disappeared.

Remaining Unavailable

For those devices that still show as unavailable, check:

  1. The availability key in the config topic
  2. The existence and content of that availability key (I see bruc/living/button/IKEA-multi/availability in one of your screenshots)
  3. Optionally create it manually, to make the interface work again, and see if it ‘sticks’?

If the topic is missing, perhaps it’s disabled on the device level. Check the Z2M configuration.yaml, as seen here.

I just had the same problem. For me the solution was to reconfigure the MQTT integration in Home Assistant. It was that simple, every entity came back instantly.

And you configured your mqtt integration… ?

Hi,
A few days ago I configured uptime kuma to track my zigbee devices using mqtt payload. And I got some results. I have mesh wifi network and its using automatic channel. From time to time it will switch channel. When one of the mesh routers switch channel it became unavailable in home assistant. In the same time one of my switches became unavailable. When router became available after channel switch so does the zigbee device.
I will keep monitoring this, but my conclusion for now that this is happening due to wifi router downtime.