Zigbee Devices Greyed Out - “This entity is no longer being provided by the mqtt integration”

I have read through several similar topics about this issue and have not been able to discover the cause. MQTT Explorer shows the MQTT feed looking normal from what I can tell.

I deleted the MQTT integration and readded it, only after rebooting Zigbee2MQTT did the devices show back up, but they were still ‘unavailable’. I have tried reconfiguring the integration with both localhost & the IP of the system. Both have the same result. I tried wiping away HA and reinstalling that. After that hassle, the same result.

Everything works fine through the Z2M UI. HA Logs show no errors related to Z2M. Z2M logs have only sensor messages and a few messages related to unplugged/disconnect devices.

What is going on here?

Edit: Similar Threads that I have reviewed:

https://www.reddit.com/r/homeassistant/comments/14pws01/upgraded_ha_now_getting_entities_no_longer/

What version of HA?

What version of Z2M?

What changed recently? Did you change any settings in Z2M?

HA 2024.9.3
Z2M: 1.40.1

I asked HA to show a hidden entity (Current use in amps) from a Zigbee device that reports this info. Doing this caused the plug to show as unavailable. I tried to delete and readd the plug, but it would not show. I deleted the MQTT integration and readded it with the same localhost:1883 settings. Nothing showed up at all. Restarted MQTT, devices show up, but are now all unavailable. Nothing I have done at all has changed this state.

I did not make any changes to Z2M or to MQTT before encountering this problem. Afterwards, I did update the images for everything.

HA MQTT debug log has only the following:

2024-10-04 18:38:58.057 DEBUG (MainThread) [homeassistant.components.mqtt.client] localhost: register write 23
2024-10-04 18:38:58.068 DEBUG (MainThread) [homeassistant.components.mqtt.client] localhost: unregister write 23
2024-10-04 18:39:58.189 DEBUG (MainThread) [homeassistant.components.mqtt.client] localhost: register write 23
2024-10-04 18:39:58.192 DEBUG (MainThread) [homeassistant.components.mqtt.client] localhost: unregister write 23
2024-10-04 18:40:58.338 DEBUG (MainThread) [homeassistant.components.mqtt.client] localhost: register write 23
2024-10-04 18:40:58.349 DEBUG (MainThread) [homeassistant.components.mqtt.client] localhost: unregister write 23
2024-10-04 18:41:58.472 DEBUG (MainThread) [homeassistant.components.mqtt.client] localhost: register write 23
2024-10-04 18:41:58.480 DEBUG (MainThread) [homeassistant.components.mqtt.client] localhost: unregister write 23
2024-10-04 18:42:58.596 DEBUG (MainThread) [homeassistant.components.mqtt.client] localhost: register write 23
2024-10-04 18:42:58.608 DEBUG (MainThread) [homeassistant.components.mqtt.client] localhost: unregister write 23
2024-10-04 18:43:58.743 DEBUG (MainThread) [homeassistant.components.mqtt.client] localhost: register write 23
2024-10-04 18:43:58.751 DEBUG (MainThread) [homeassistant.components.mqtt.client] localhost: unregister write 23
2024-10-04 18:44:58.886 DEBUG (MainThread) [homeassistant.components.mqtt.client] localhost: register write 23
2024-10-04 18:44:58.889 DEBUG (MainThread) [homeassistant.components.mqtt.client] localhost: unregister write 23

I have searched these messages and not found anything useful.

Maybe you just didnt enable discovery in mqtt or you have mismatch topic in z2m and mqtt

It was working fine before, and I hadn’t changed anything. Regardless, what should the topic settings look like in Z2M & HA?

This is how it is on my side.
mqtt integration

and zigbee2mqtt

The only thing that was different was the MQTT protocol version. Mine was 4, I changed it to 5, restarted Z2M, and suddenly everything worked. Only, the problem isn’t the protocol version. 4 or 5 both work fine, but only works when I soft restart Z2M after changing that setting.

If I leave it at either 4 or 5 and restart everything, it’s starts up broken. If I restart Z2M using the UI, it’s still broken. If I change the protocol and restart Z2M with the button that comes up after making that change then wait a minute or two after Z2M starts, suddenly everything works.

What is going on? :roll_eyes:

Edit: After it was working, I tried again to add ‘current’ and the whole thing broke again. This setup is about as robust as tissuepaper. I again switched the protocol version and restarted Z2M, and it came back up. :man_shrugging:

You know how they say… don’t fix it if its not broken.

I get it, but it needs manual intervention on reboot. That’s not what I would call fixed. Maybe I can have docker compose wait until HA is up and then start Z2M. I’ll have to play with it when I have some more time.