Sensors? I'd like to buy the < $5 ones, not the > $30 ones

I just saw your message now. That Rasbee card looks pretty cool. I love the advertised range of 500m. That would beat pretty much any hub/gateway/usb stick out there. The CC2531 USB sniffer I am ordering only has a range of ~30m. The software stack and initial setup look a bit intimidating however.

Can anyone confirm, through actual usage, that the range is really only 7m? That doesn’t seem very far.

I just received the Xiaomi Gateway and motion sensors, but I don’t plan to turn it on. I am waiting for the CC Debugger from Aliexpress. If it works out with Zigbee2mqtt, I won’t even turn on the Xiaomi gateway. The range with the CC2531 Sniffer isn’t very good either, 30m line of sign. Don’t forget that these are Zigbee stuff, which has a shorter range than Z-Wave. In the case of Zigbee2mqtt, you can use additional CC2531 Sniffers as the routers to extend the range.



Hello Tom,

I received the CC Debugger on Friday, and I managed to get everything working now. There was a bit of a hiccup with the debugger LED light not turning green, but it turns out that one of the connection to the sniffer wasn’t tight enough. I was also a bit freak out when I can’t easily plug in the USB dongle to the PI since the ZWave ZStick is too big, but after squeezing the two sticks a bit, it all works out.

As for the range, it is better than I was expecting. My house is a typical North American 2400 sq ft 2-storey + basement, rectangle shape. My PI is in the basement at the front. I have no problem placing the motion sensor on the furthest corner of my house, about 2-meter high above the second floor. I can also put it 2 meters out in the backyard of the house. The basement is close to 8 feet high, first floor is 9 feet high; all hardwood floors. All together, I would say that for my case the range is between 12 to 17 meters, may be even a bit more. I don’t need a router/repeater for my house.

The motion sensors are working very well now. I know Xiaomi sensors tend to drop with other hubs, but it didn’t happen for me yet. So zigbee2mqtt is definitely a viable option for Zigbee sensors.


A short tutorial in the Tutorials and Examples section would be really great :heart_eyes:


I am trying to make my movment sensor work, but I am a newbie to mqtt messages (barely make sonoff devices work…)
A tutorial/example is welcome.

My sensor returns
2018-07-09T20:22:36.516Z - info: MQTT publish, topic: ‘zigbee2mqtt/moviment’, payload: ‘{“illuminance”:4,“occupancy”:true}’

So no battery level, and I don’t know how to make a rule to switch lights after detecting the movement…

Thanks, being a newbie is so frustrating!

It can be. Take it in your stride, there is a lot to learn.
It can be hard and sometimes it will be.
Follow the tutorials step by step, don’t skip any because you think you know better, you don’t.
Read the docs, again and again. When it doesn’t work, read the docs again.
Check for typos, and again.
Check the log files. they help a lot to find out what is wrong.
When you are stuck search the forum. Someone is likely to have had your problem before and it was solved.
If your can find the solution, post your set-up, items and rules and we’ll help.
Welcome to OH

1 Like

I managed to make it work without a Switch item or creating a Map file (I thought it was necessary.

For future reference I ended with a String item

String  movement_sensor		"Movement [%s]" <Motion> 	(FF_LaundryRoom)	{mqtt="<[broker:zigbee2mqtt/sensor:state:JSONPATH($.occupancy)]"} 

And a simple rule

rule movement_detected
when Item movement_sensor changed to "true"


Just a couple of small changes:
Use the item.sendCommand() method instead of the action sendCommand(String, String)
There are several reasons for this:

And you don’t need the ; in the rules DSL EXCEPT after the return statement

The name of the rule needs to be in ""

rule "movement_detected"
    Item movement_sensor changed to "true"

When I have some times, I will try to write a tutorial. There isn’t much to it though. The two links at zigbee2mqtt and mqtt should take care of everything.

For the Xiaomi sensor, the messages containing the battery comes less often, and could be independent from triggering of the motion sensor. It looks like this:

Jul 13 18:59:53 raspberrypi npm[32362]: 2018-7-13 18:59:53 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0001fa45fd', payload: '{"battery":"100.00","voltage":3025,"illuminance":112,"occupancy":true}'

You can examine the zigbee2mqtt log for debugging purpose.

sudo journalctl -u zigbee2mqtt.service -f

You can also look at the light rules I have for reference:

1 Like

I’d like to buy a load of xiaomi (aqara) sensors, but I’m not keen on using a wifi gateway/hub as its something else to go wrong.

Does anyone know if there’s a wired or USB gateway/hub that works well with those sensors?

Thanks in advance.



Thanks … I was excited right up until I saw I had to build stuff myself.

Are there any off-the-shelf wired/USB gateways/hubs?

That’s part of the fun!

I have extra CC2531 with a custom 3d printed cover. They are flashed with the correct firmware and ready to be used with zigbee2mqtt. Message me if you are interested. Another option is to pickup some Wemos D1 Minis for about 3 dollars each then flash ESPEASY Mega to them. From there you can pretty much make any sensor you need, there website list all of the compatible hardware. I have a multisensor that does motion, light, temp, pressure and humidity all for less that 10 dollars. I also have a 3d printer to package them all in a custom case. It does sound like a lot but after you build 1 it is cheap and easy to do more. My recommended 3d printer is the Anycubic Kossel Plus which can be had for around 220 dollars. Ever since I started making my own stuff for cheap, I wish I would have known about it earlier as it would have saved me hundreds. I use Zigbee2MQTT, Zwave via vera, Xiaomi (easiest, least expensive, and works flawlessly), but the Wemos stuff is the most flexible and can be customized to fit the requirement. If you order in bulk from Aliexpress it becomes even less expensive.

1 Like

that would be fantastic, thanks. I’ll msg you in a moment.

@jcf6288 That Wemos D1 idea sounds really interesting. Does it communicate with OpenHab using mqtt? Would you be able to share pictures of your final products, as well as some link references on how to get started? Do you power it through the USB plug?


Yes MQTT and Powered by USB or Battery20181108_170948 20181108_170952 20181108_170958 20181108_171104 20181108_171112 20181108_171124