How to completely remove a ZigBee device


I have a ZigBee device that I want to completely remove from HA. I use the zigbee2mqtt Edge, but when I remove a device from there and then pair the device again, it remembers the device including its previous settings and puts it back to the list of devices with the previously used device number. I want to completely remove/reset it, so it forgets all settings, like the device never existed before. The reason for doing that is that there are some settings on the device, specifically binding, that I cannot get rid of. So I wanted to reset the device completely and configure it again from scratch.

I think when I had a similar problem I had to remove the device and the make sure it was also removed from config/zigbee2mqtt/devices.yaml and then restarted HA.

Remove it from z2m and mqtt and then restart ha. This should remove device and all entities.

Neither of it worked :frowning: I tried removing it from z2m, then removed the device also from MQTT devices and restarted HA. The device then also disappeared from config/zigbee2mqtt/devices.yaml. I did factory reset of the device, paired it again with HA and the device again got to the position 3 where it was before and the binding is also still configured.

Unbind from the Zigbee2mqtt interface

Please describe the exact way you removed it from Z2M. Normally if you delete the device in Z2M it should be gone, but sometimes some infos stay. If so, there are two files where the device could still be listed.

Take a look at the files in “HA-IP/share/zigbee2mqtt/”. There should be one database file (database.db) and one devices.yaml.

What I’d try is this: remove the device as above, stop the addOn (Z2M), restart HA, start Z2M. If you mess with the above mentioned files, make sure, you first stop Z2M (watchdog! :wink: ), and only than mess with the files. Do I need to say backup the files before messing with them - I hope I don’t. :wink:

And don’t forget to check twice for any retaining MQTT messages, these are b**** at times… :smiley:

Unbinding is the thing that does not work actually. And that is the reason why I am doing all this :slight_smile: Unbinding is failing with some nonsense message.image

I removed it from Z2M via the red recycle bin button on the device page.image

Share does not contain any folder, only one text file called check_config.txt
The device.yaml file is in /config/zigbee2mqtt though.

if it is an end-device, you need to activate it first before unbinding (press the button, wave your hand in front of the motion detector, …)

And some devices are known to bind automatic when pairing.

I’ve tried that too… Clicking the button to wake the device up (it is a battery powered Hue Dimmer Switch) but did not help. That is the reason why I need to remove it, completely forget it like it never existed. And then start from scratch.

I have the same problem @lukasberan . Did you find any solution?

1 Like