Zigbee2mqtt: getting rid of your proprietary Zigbee bridges (Xiaomi, Hue, TRADFRI)

I ordered 3 zigbee2mqtt modules. How can I configure them to work in mesh network?

Edit: oh I found this, cool.

https://koenkk.github.io/zigbee2mqtt/information/zigbee_network.html

I need one router and others as coordinator.

RTFM :slight_smile:

1 Like

I think you meant one coordinator and others as routers.

1 Like

OK. Finally got it working.

Guys, I created a short blog post detailing a few things I had to figure out by myself. Your feedback is welcome. My aim is to avoid more people pulling their hair over some ā€˜gotchasā€™:

http://zteo.com/posts/zigbee2mqtt-step-by-step/

Chris

Update: updated with information on how to remove a single device from the database.

5 Likes

Canā€™t remove an Iris motion sensor (occupancy and temperature). Picked up this sensor today, but never could get it working very well. Removed it using zigbee2mqtt/bridge/config/remove. Zigbee2mqtt logs says ā€œSuccessfully removedā€. Still shows up in HA. Removed it from both device_registry and entity_registry. After HA reboot it shows back up and the entries in the two registries are back. Can someone clue me in on why I canā€™t remove this? Iā€™ve tried multiples times. I have to be doing something stupid. Sensor is sitting here without its battery. Canā€™t figure out why the entity keeps returning?

Did you check in /opt/zigbee2mqtt/data/configuration.yaml that the device is gone from there as well?

1 Like

Iā€™m on hassio and using the addon. I checked the one at \\HASSIO\share\zigbee2mqtt\configuration.yaml. And it is not in it. Is that the correct path for me?

Unfortunately, I am not too familiar with hassio but it sounds right.

Dumb debugging question: if you disable zigbee2mqtt, then restart HA, are you still seeing the device?

1 Like

Just gave it a try. Stopped zigbee2mqtt and told it not to start on boot. The sensors are still there (both temperature and motion) but like all the other zigbee2mqtt sensors it says unavailable until I started zigbee2mqtt back up.

Apparently its an HA issue, but Iā€™m not sure where to delete it. I havenā€™t created any entries in any yaml modules referencing this sensor. Is there a database somewhere that stores the entities? Any point in deleting home-assistant_v2.db?

I am really spitballing here butā€¦

Have you checked know_devices.yaml?

You could also see if removing states helps:

sqlite3 home-assistant_v2.db
delete from states where entity_id='{your entity id}';
.q

You could list entity ids first if you are unsure what its name is:

sqlite3 home-assistant_v2.db
select distinct(entity_id) from states;
1 Like

Just checked known_devices.yaml. Not there. Regarding the db, I already deleted all records and executed Vacuum. After reboot still there.

I was reading the link below, and if Iā€™m reading it correctly, it says if Iā€™m using Discovery for MQTT in configuration.yaml (which I am) then I have to publish a null payload to a config topic to remove old mqtt sensors. However Iā€™m not getting very far with that. I tried to publish a null to the topic of zigbee2mqtt/bridge/config/devices but havenā€™t rebooted yet . Iā€™m over my head.

Edit: I rebooted after publishing an empty payload to the topic zigbee2mqtt/bridge/config/devices, and sensors still there. Ugggh.

try publishing a null to the same topic that the actual sensor published to. Also make sure you publish with the retain flag set to true.

I donā€™t remember what the command line way is to do that. I use MQTT.Fx and itā€™s pretty easy using that.

1 Like

Thanks for the reply. So it looks like the topic that the actual sensors publish to when they are triggered is zigbee2mqtt/sensorname, so in this case:

zigbee2mqtt/0x000d6f001099e666

I use Node Red, and chose Retain: true. Published a null to the topic above, removed the 0x000d6f001099e666 entries from the device and entity registries and rebooted. Unfortunately theyā€™re back.

Iā€™m grasping here but try turning off discovery for a bit and do all of the above again to see if they come back. Of they do itā€™s likely a HA issue. If they donā€™t itā€™s probably in Z2M. At least it will be another point of info to try to narrow things down.

1 Like

I donā€™t see my entry where I published a null in the zigbee2mqtt log. I tried using both Node Red and also Home Assistantā€™s MQTT Publish a Packet under Dev Tools. Will try your suggestion to turn off Discovery and try to find another way to publish a null.

Edit: Now that I think about it, maybe when I publish to that topic, it shouldnā€™t show up in the zigbee2mqtt log?

  1. Stop HA
  2. Remove devices from entity registry
  3. Publish mqtt messages with empty payload to state and config topics of each device with retain flag set.
  4. Start HA

Hope this works.

Sorry for my lack of knowledge here:
The entity name is 0x000d6f001099e666. Publish an empty payload to zigbee2mqtt/0x000d6f001099e666/state and zigbee2mqtt/0x000d6f001099e666/config?

It is the discovery topic you need to send the null message to.

I am not at the computer right now, but it looks correct. You can see these messages at the very beginning of zigbee2mqtt log if logging level is set to info at least.

The harsh way: stop mqtt, delete the mosquitto database and start mqtt.