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

DeCONZ software is open source.

Correct me if I am wrong, but my understanding is that the code for device support is in the conbee/raspbee firmware which is closed source.

Yes right, itā€™s just the API and the app/web app which is open source

48 devices

2 Likes

My CC2531 arrived, got flashed w the 48 device f/w, and got stuck in my VMWare server and passed through to hassio VM :slight_smile:
Now for hassio addonā€¦
I see that both @Koenkk and @danielwelch created hassio addon repos.
Which to use?
@danielwelch looks to be slightly more advancedā€¦ so I will go with that for now.

@hijinx Weā€™re all actively working on the repo at https://github.com/danielwelch/hassio-zigbee2mqtt. Would love for you to test it out and welcome any feedback via the github page.

Installed it already.
One comment (and I will raise an issue for it on GH) is that the addon config does not seem to work.
I needed to copy the configuration.yaml to /share/zigbee2mqtt and edit it there.
Once I did this all working wellā€¦ I paired a spare Xiaomi door sensor I had and its pushing mqtt to HA (autodiscovered) via my mosquitto server (hassio addon).
So far so good!

2 Likes

Thanks for this! Working great so far, with the exception of being unable to pair one Aqara WXKG02LM double switch (other pairs okay). Not sure whatā€™s up with that, but I have some door sensors on the way, so will work it out then.

In terms of starting this up on boot: Iā€™m not very familiar with the node ecosystem, but node-red recommends PM2 in their installation guide and it seems great for this kind of thing.

The quick start for using PM2 to start zigbee2mqtt on boot, and to automatically restart if it crashes, is:

# to install pm2 system-wide
sudo npm install -g pm2

# in your zigbee2mqtt directory (where you would normally do "npm start")
pm2 start . --name "zigbee2mqtt"

# tell pm2 itself to run on startup if you aren't using it already
pm2 save
pm2 startup systemd

# or on older systems
pm2 startup

# to manipulate the process
pm2 status
pm2 log zigbee2mqtt
pm2 stop zigbee2mqtt
pm2 start zigbee2mqtt
pm2 restart zigbee2mqtt

This is on a plain Ubuntu 18.04 install. Iā€™m not sure what it would take to package this sort of thing into hassio and friends.

This is how we used to have configuration work. Clearly still working out some issues re: configuring via the UI, Iā€™ll try and fix the issues. Thanks for testing

just use the docker instance, then do something like --force-restart when ā€˜runā€™ the container, and it will work on startup and on stopping the container.

not to mention there are a number issues which cause things to crash, so this helps to recover.

Iā€™m not unhappy to have to copy/edit the yaml. We need to maintain it anyway for friendly names etc.

Is there a pairing distance limit? (e.g. like touchlink on hue where device needs to be close to the hub?)
I tried pairing an Ikea bulb (turn off 6 times then on) but cc2531/zigbee2mqtt didnt see the bulb.

you need to keep it close to the CC2531 usb sniffer while pairing, updated the wiki with this: https://github.com/Koenkk/zigbee2mqtt/wiki/Running-the-bridge#ikea-tradfri

For reference, Zigbee pairing is almost always done by proximity. It relies on the received signal strength (RSSI) to determine that the device is nearby.

Thanks - I now have the bulb 10cm from the sniffer but still not pairing.
It seems to be related to the specific Ikea bulb model I am trying - https://github.com/athombv/com.ikea.tradfri/issues/4
Iā€™ll keep trying :slight_smile:

The only experience I have is:

  • Hue - which does not need to be very close for hue brand bulbs (although other brands need proximity (touchlink) - e.g. I paired an Ikea tradfri rotary dimmer controller into my hue network so can control lights from both the hue hub and by the dimmer)
  • Xiaomi - in same room is close enough (with xiaomi hub and with cc sniffer)
  • Ikea - not working yet :slight_smile:
1 Like

Thanks for the great work! I had no problems setting up with a Xiaomi Mijia switch.

As flashed per these instructions, does anyone know if the CC2531 behaves as a Zigbee repeater? These would be a cheap way to extend the mesh distance when necessary.

I have pairing problems past 7 or 8 devices. It becomes difficult to pair the last few devices (timeout crashes, sometimes pairs as ā€œunknown deviceā€ until I re-pair).

10 door/window contact sensors showed up today, and I was totally unable to pair them. If I delete the database.db file, I can instantly pair them, up to the same unstable pairing limit. Of course, this fragments the network, and I didnā€™t see a way of easily joining multiple database files.

For now, Iā€™m using the door sensors on the Xiaomi gateway and motion detectors/switches on zigbee2mgtt. Iā€™m using the 48-device firmware. After pairing for an hour, I didnā€™t have the patience to downgrade to the older firmware to see if the same sort of instability exists there.

To the developers: If you need a few bucks to buy some extra sensors for testing, Iā€™d be happy donate somewhere. I think these $10 contact sensors are the cheapest Zigbee option: https://www.gearbest.com/access-control/pp_626703.html

Wouldnā€™t that be easier to get a cheap Zigbee plug from Aliexpress for $10-15? A sniffer and Pi Zero W would cost more than that

Excellent point. I was wondering if the CC2531 chip alone worked as a repeater - w/o the Pi Zero. I.e., just stick the usb stick on a USB charger. Just using a Zigbee plug is definitely the other option.

Thanks for the feedback.