Some Zigbee2MQTT Devices Lost Their Connection to Home Assistant

I’m running into an odd problem with Zigbee2MQTT. Some of my devices (three Hue bulbs, one Ikea bulb, and three smart plugs) aren’t responding or reporting to Home Assistant anymore. When I go to the Entity page, they show as Unavailable with the message “This entity is no longer being provided by the mqtt integration. If the entity is no longer in use, delete it in settings.”

If I go to the Zigbee2MQTT add-on, I can still control these devices just fine. When I rename them in Zigbee2MQTT and check the “Update Home Assistant entity ID” box, the home assistant entity ID doesn’t update. So it seems like the integration between Z2M and Home Assistant is broken.

All of my zigbee sensors are still working fine, it only seems to affect smart plugs and lightbulbs (all categorized as lights to HA).

Any suggestions?

3 Likes

I should add that I checked with MQTT Explorer, and all of the malfunctioning devices are being published over MQTT. So the issue is somewhere on the Home Assistant uptake side.

2 Likes

I have the same issue. It usually happens after updates (either OS/docker related or HA core and/or addons).
It’s always the same 4 IKEA bulbs and IKEA blinds for me that become unavailable in MQTT like you described it. All other Zigbee entities stay active.

All those “unavaiable” entties are available and also controllable in Z2M at the same time!

Workaround for me: restarting the MQTT add-on. I have to do this at least once a week. It’s annoying.

1 Like

Hi, same issue here. Started happening yesterday after updating Z2M to latest. Never happened before. Is this a bug with the latest Z2M or has anyone made inroads with getting to the bottom of this?

I have excatly the same issue as the OP, but with 70+ IKEA bulbs and it means all the smart lighting via HA is broken in our home :frowning: Of course the manual wall switches still work, but controlling the lights via Z2M directly without HA control is a major pita.

What changed a couple of days ago?

I only recently switched to Z2M over MQTT and discovered that in communication with my Aqara E1 thermostats somehow state changes are not transfered between Z2M and HA.
E.g. HA changes the temperature and thinks it is changed while it isn’t, or HA does not reflect changes done directly on the device. All works fine directly from the Z2M UI. Could this be a similar problem?

Hi there, I also ran into the same problem yesterday.
Devices are available and controllable from the Z2M interface, but the MQTT integration says that those entities are unavailable.
In my case 2 Hue lights and one Ikea light are affected, as well as a Moes valve controller (thermo).

Did not happen for a few weeks and I was hoping it was solved. But then happened again two days ago as well.
I set all updates (core & addons) to manual to be able to identify if and what update would cause this. No updates were done when it happened, so as far as I can tell it was not related to any update.

Restarting the MQTT addon also did not help this time, I had to reboot the VM.

I updated zigbee2mqtt yesterday from 1.30.4 to 1.34.0 and also got this behavior. Got nuts since I did not noticed it immediately and started to repair one bulb. This morning I saw that all devices which can be controlled with on off were not available for switching state. Tried everything and thought it was an mqtt (mosquito) problem so also updated mosquito. But other mqtt devices worked fine.

I just updated my z2mqtt container (I am running docker) to the previous version. Everything works fine again.

Except for my new motion sensor which requires an update from z2mqtt.

I’m seeing this as well, from other posts I’ve read (I’ll have to hunt them down) it supposedly has something to do with zigbee2MQTT trying to start before MQTT Broker is fully running.

I’ve killed Z2M and MQTT Broker manually, then starting broker, waiting a while, then starting Z2M. This seems to let Z2M pick up some of the “disconnected” devices, but not all of them.

What does work reliably to fix them is incredibly stupid and tedious:

  • Open Z2M → Devices, find the device in question
  • Select “Rename device”
  • Make any change to the description (add a space, remove a space), then select “Save Description”

This seems to kick Z2M in the butt and get things going again, but you have to do it for every device.

I haven’t had the time to learn how to snoop on MQTT to see exactly what is being published when those changes are made, but to me the behavior appears to be purely on the Z2M side.

4 Likes

I’m having the same type of issue described here. I’ve done the whole restart z2m and mqtt thing, sometimes it works, sometimes it doesn’t. I just tried @diphen’s suggestion to edit the description in Z2M. I only had to edit the description of 1 of the devices that wasn’t working and the rest kicked on all of a sudden.

I still have no idea why the entities go unavailable sometimes, and I haven’t seen anything useful in the logs, but at least this might help in the future if they don’t come back on with a quick reload of the MQTT integration.

Did anyone give a solution to this. I’m facing same issue

No, unfortunately not.
What I found out, it’s not really related to any updates as I initially suspected. It just happens randomly after like every ~10 HA restarts. But then the same 5 devices are not working from the very beginning of HA starting up. It’s not like HA is running for days or hours and they suddenly become unavailable (in my case). Sometimes restarting HA does or does not help, however rebooting the VM brings these devices back for sure.

I wrote an automation, that detects this behaviour and sends me a notification. Better than noting until we find out what’s really going on.

alias: 5 IKEA Zigbee devices became unavailable
description: ""
trigger:
  - platform: state
    entity_id:
      - switch.unaffected_device1
    from: unknown
  - platform: state
    entity_id:
      - switch.unaffected_device2
    from: unknown
condition:
  - condition: state
    entity_id: light.affected_device1
    state: unavailable
  - condition: state
    entity_id: light.affected_device2
    state: unavailable
  - condition: state
    entity_id: light.affected_device3
    state: unavailable
  - condition: state
    entity_id: light.affected_device4
    state: unavailable
  - condition: state
    entity_id: cover.affected_device5
    state: unavailable
action:
  - service: notify.mobile_app_myphone
    data:
      message: 5 IKEA Zigbee devices just became unavailable, reboot HA manually.
mode: single

basically checking if 2 Zigbee devices that are not affected changed from unkown into a valid state (e.g. on or off) - this usually happens a few seconds after HA starts up. At the same time the automation is checking if my 5 usual suspect are still in unavaible state.

Hope it’s useful for someone else as well.

This is great. I’ve been struggling with four Phillips hue lights having to pair to hue then unpair and connect again. An irritating prices. Your suggestion of playing with the name worked perfect. The cute bridge is moving out. Thx

I have recently started to have the same problem … some devices report state and some others go unknown …

I’ve recently seen some mqtt login errors however this wasn’t the case until recently …

For some reason the integration couldn’t log into the mqtt server (I use a docker separate mqtt not withing HA) … it’s frustrating to see things working randomly …

Is anyone here running z2m in docker ?

I have been experiencing the same issue for a few months.

About once a week I’ll wake up and find all the zigbee devices are unavailable.

From a Home Assistant reboot it would take a couple of hours to become available again, usually leaving ~10 devices requiring re-pairing.

It is consistent that zigbee2MQTT loses devices after a Home Assistant restart, so added an automation to restart zigbee2MQTT every time Home Assistant restarts.

That helped.

But the issue remained, so created an automation that restarted zigbee2MQTT every day at 4am.

That does not appear to be helping.

This morning ~100+ zigbee devices were offline, they started dropping offline just after we went to bed. At 4am zigbee2MQTT restarted. No impact devices continued to drop offline.

The day before I had updated the host pc OS so a total reboot did not prevent this happening.

I am at the stage where my next step is to force a Home Assistant full reboot everyday during the night.

Hopefully that stabilises things.

Not normal at all.

What coordinator are you using ?
Do you use a USB extension cable ?

I am using the Sonoff zigbee coordinator recommended for Home Assistant - SONOFF Universal Zigbee 3.0 USB Dongle Plus ZBDongle E Gateway with Antenna for Home Assistant,

Yes I am using usb extension cable to get it away form all the signal noise of the Mac mini.

Should I just plug it into the back of the Mac mini?

No, without USB extension cable it could be worse.

1 Like

I am using default as much as possible.

I installed Home Assistant into VMWare.

It has 4 CPUs, 5GB of RAM and 50GB of disk with 35GB spare.

All on a Mac mini M1.