Zigbee2mqtt and home assistant help

I’ve had a number of zigbee devices running fine for the past year, no issues what so ever. However I recently setup the Christmas tree, put the lights on and plugged it into the zigbee outlet plug that I used to turn the lights on/off with last year. This plug has been offline for a year sitting in the box with my Christmas lights.

The zigbee plug didn’t show up in zigbee2mqtt or HA, so I reset it, put zigbee2mqtt into pairing mode and put the plug into pairing mode. The plug successfully paired with my zigbee network and shows up just fine in zigbee2mqtt, and it shows up in Home assistant as a device, but the only entity on it is LinkQuality, the switch entity is notably missing. It also somehow did the same thing to other zigbee devices which no longer work in HA, but work fine in the zigbee2mqtt interface.

I’ve tried deleting the devices out of HA, zigbee2mqtt, doing a reset on the devices and adding them back, and the show up exactly the same every time, I get linkQuality in HA and nothing else. All switches can be toggled successfuly from the zigbee2mqtt web GUI, so they work, the issue appears to be getting all the entities back into HA so that I can control them via HA again.

I’ve also upgraded zigbee2mqtt, mosquitto broker, and HA to the latest available versions in hopes that would fix it, but no dice.

Any ideas on how to fix this?

Version info below:

Zigbee2MQTT
Current version: 1.34.0-1

Mosquitto broker
Current version: 6.4.0

Home Assistant 2023.3.3
Supervisor 2023.11.6
Frontend 20230309.0 - latest

Hopefully you have a backup of 6.2.1 of the addon you can revert to.

See: https://community.home-assistant.io/t/lost-most-of-my-switch-entities/649218

Have 6.1.3 from when I upgraded.

It was doing the same thing on 6.1.3 too though.

Ok, probably not that issue then.

Use MQTT explorer to see what discovery topics are sent to your broker by Zigbee2Mqtt.

They will be under the homeassistant topic.

This is probably a useless response, but have you restarted Home Assistant?

have nothing under the homeassistant topic, but I am seeing activity under the zigbee2mqtt topic.

I see the actions being passed(on/off), link quality, but how do I find the discovery messages in there?

yes, already tried that a few times.

The zigbee topic is for state messages the homeassistant topic is for discovery. See:

You need to be on at least HA 2023.8.0 - that was called out in the Z2M 1.33.0 release notes.

No, they were not showing up under the homeassistant topic.

I checked my zigbee2mqtt home assistant integration settings and the topic was set to homeassistant, which is correct.

I noticed “Home Assistant Legacy Entity Attributes” and “Home Assistant Legacy Triggers” were both checked, so I unchecked both and saved the settings and now when I toggle one of the switches I see the discovery message under the homeassistant topic:

{
  "availability": [
    {
      "topic": "zigbee2mqtt/bridge/state",
      "value_template": "{{ value_json.state }}"
    }
  ],
  "command_topic": "zigbee2mqtt/zig1_light_basement_stairs/set",
  "device": {
    "identifiers": [
      "zigbee2mqtt_0x00124b0026b7ff92"
    ],
    "manufacturer": "SONOFF",
    "model": "Zigbee two way smart switch (ZBMINI)",
    "name": "light_basement_stairs",
    "sw_version": "2.0.0"
  },
  "name": null,
  "object_id": "light_basement_stairs",
  "origin": {
    "name": "Zigbee2MQTT",
    "sw": "1.34.0",
    "url": "https://www.zigbee2mqtt.io"
  },
  "payload_off": "OFF",
  "payload_on": "ON",
  "state_topic": "zigbee2mqtt/zig1_light_basement_stairs",
  "unique_id": "0x00124b0026b7ff92_switch_zigbee2mqtt",
  "value_template": "{{ value_json.state }}"
}

This seems like an improvement, but that device is still only showing linkQuality setting(which I’m also seeing discovery messages for). I restarted Mosquitto and zigbee2mqtt, still not working. I rebooted the physical host running HA so everything restarted, still only getting the linkQuality entity on the device in HA.

Any ideas?

solved… leaving this here for reference
I didn’t post in my original post, but I’m running HASS and MQTT under docker.
A full restart of my Synology fixed the issue so if you are running docker and have this issue, try a full restart of the system


My setup recently stopped working. I thought it was due to upgrading HASS to the latest version but I rolled it back and still can’t connect so I put it back on the latest.

versions are
HASS 2023.12.3
Zigbee2MQTT version 1.34.0
eclipse-mosquitto 2.0.18

MQTT Explorer connects fine.

nc shows the port is open

nc -vz 10.0.0.20 1883
10.0.0.20 1883 open

When I restart HASS, the log shows
2023-12-21 23:15:03.763 ERROR (MainThread) [homeassistant.components.mqtt.client] Failed to connect to MQTT server due to exception: [Errno 98] Address in use

Not running docker, running the NUC image on a NUC.

that said, I sorted this out by upgrading home assistant to the latest version. Still have no idea what was wrong, but after the upgrade all my zigbee devices just connected and started working in home assistant again.