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


#1037

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

Edit: oh I found this, cool.

I need one router and others as coordinator.


#1038

RTFM :slight_smile:


#1039

I think you meant one coordinator and others as routers.


#1040

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.


#1041

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?


#1042

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


#1043

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?


#1044

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?


#1045

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?


#1046

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;

#1047

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.


#1048

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.


#1049

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.


#1050

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.


#1051

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?


#1052
  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.


#1053

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


#1054

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


#1055

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.


#1056

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