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

Hi all,

Because of the irritation I got from my Xiaomi Zigbee bridge (talking in Chinese, sending data to Chinese cloud and a bad app) I started to look if it is possible replace the Xiaomi gateway with a more open solution.

I found that Andrew Linden had a proof of concept for this. It bridges events and allows you to control your Zigbee devices via MQTT. In this way you can integrate your Zigbee devices with whatever smart home infrastructure you are using.

I found this idea very interesting so I forked his repo and started to refactor the code, add features and write documentation.

Currently everything is working quite well for me so I thought it would be nice to share it here. You can find zigbee2mqtt on Github: https://github.com/Koenkk/zigbee2mqtt.

How to get started

Features

  • Bridge Zigbee device messages to MQTT
  • Control Zigbee devices via MQTT
  • Home Assistant MQTT discovery (makes integrating with home assistant a breeze)
  • Supports Xiaomi, Hue and Tradfri devices
  • Support for new devices can be added very easy
  • Docker images

Please let me know what you think about zigbee2mqtt! :honeybee:

149 Likes

Very interesting as I too have xiaomi, hue and TRĂ…DFRI. I will read more tonight!
Are you considered to make a hassio addon from your docker image?

3 Likes

Does this only work with a USB-Version? Or can this potentially work with CC2530 too via the GPIO?

1 Like

Good tip! Will look into it.

I’ve only tested with the USB version -> I don’t know.

I have both Xiaomi & Hue in my home and would LOVE to get away from those bridges. That being said, some questions:

  1. Is there a limit of devices that will work with methodology? I ask because Hue has a 50 device limit on their hub, and I’m getting very close to it and would love avoid getting another bridge.

  2. When you mean Xiaomi, does this include the Air Purifier / Roborock ?

Thanks so much for this awesome awesome implementation!

  1. At the moment 20 but with the firmware from oskarn97 48 devices, but haven’t tested this yet. https://github.com/oskarn97/xiaomi-zb2mqtt/tree/master/firmware. You can ofcourse use multiple instances of zigbee2mqtt.

  2. Only Xiaomi zigbee devices, so no.

1 Like

Thanks so much! Really appreciate the clarification. I think I’ll (for now) transition my Xiaomi & Tradfri stuff over and as the limit increases transition my Hue stuff over. Total game changer for my instance.

Now if we could do something about the Lutron bridge…

I’ve mentioned this before in some other threads. Awesome project. Later down the road, add some ZWave action to it and you’ve got a killer product. A simple no holds barred device doing all the Zwave & Zigbee action over MQTT to whatever project/software you need.

2 Likes

This look awesome! I would LOVE to get rid of my Xiaomi GW.

Will the Xiaomi Button “double_click” “long_press” action still be sent under an MQTT topic?

Even more: Xiaomi MiJia wireless switch (single, double, triple, quadruple, many and long click) (from https://github.com/Koenkk/zigbee2mqtt/wiki/Supported-devices#xiaomi)

2 Likes

Is this the sort of USB Zigbee device you are using?


(edited link - other one was 2540)

or have a link to (UK available) device I can buy?

1 Like

Thats the one, note that you also need to flash the stick with a firmware, for that you need a CC debugger (see https://github.com/Koenkk/zigbee2mqtt/wiki/Getting-started)

I looked for this page but didnt find it - thanks for the direct link :slight_smile:
(please may I humbly suggest to edit you 1st post to link to this getting started page)

2 Likes

For those of us without access to a windows machine, does anyone know another way to flash the cc2531?

There is a similar project, open source and leaded by a French guy: Zigate. You can buy a device or do it yourself.
Content is mostly in French but it seems there are a lot of Zigbee devices compatible with the current firmware.

1 Like

cc-tool is compatible with macOS and Linux, and the SourceForge page states that it is compatible with the CC2531. I use it often on macOS, but not yet with CC2531 specifically.

1 Like

There is also the Dresden Conbee and deconz solution… but choice is good.
Mqtt and easy (it seems) addition of new devices looks to be the strength here.

2 Likes

What’s the benefit in HA→MQTT→Zigbee bulbs over using ZHA and just having HA→Zigbee bulbs?

This is great, I would love to replace my Tradfri hub with an open solution. Will order the hardware and try it out.