[OBSOLETE] Xiaomi Sensors and Button (beta)

Hi @ArstenA

Could I have a link to your DHs? Sorry I couldnt find it. I am currently using a4refill’s DH and I have battery issues. Would like to give yours a go.
Thanks

Sorry I just found them above… :slight_smile:

2 Likes

I tried a Google search for that documentation, but couldn’t find it.

Would you mind sharing the URL for this Aqara communication protocol documentation?

Also - for anyone interested - while doing my Google search I discovered that someone figured out how to hack a Xiaomi sensor into a ZigBee network sniffer! It involves writing new firmware, but perhaps this could be a way to get more reliable information on the data Xioami devices transmit?

His blog post is here (in French). Apologies if this has been mentioned before - I’ve read through a lot, but not read every single post in every single thread relating to Xiaomi sensors.

EDIT: After reading more posts by the author of the blog, Frédéric Dubois, I now see he has become something of an authority on Xiaomi’s ZigBee protocol, and has developed a “universal” ZigBee to USB/TTL gateway device called ZiGate (website in French), born out of a successfully funded Kickstarter campaign (again in French).

1 Like

When trying different device handlers , how do you choose which handler handles your sensor?

Ok, here is a link describing the button data.

Here is some info for the temp/humidity

Potentially more info to look at:

It have this statement :
“Aqara body illumination sensor:
The human body sensor detects that someone moves and reports a report immediately, and also reports the light value “lux”. In the case of someone moving, in order to save electricity, the body sensor sends a report as soon as a minute. The body sensor also reports the current lux value at each heartbeat. In the remaining cases, the human sensor does not report the value of light intensity.”

See this link https://aqara.gitbooks.io/lumi-gateway-lan-communication-api/content/

As expected, all my motion sensor was dead last night (including the door/window sensor) on ST app marked as unavailable (last status show as inactive". It will never get back online even I press the button on the device it self or restarted the ST app. I guess remove the device from the app and re-add back is the only way. Any idea how to fix this ?

Hi @IoTUser, Thank you very for your help :slight_smile: , what DH do you use for Aqara Button?

If you paired them properly and not using catchall then try going into the app and hit the Add Thing button. Then press the pairing button a few times and see if that helps.

If you used catchall then there is no way to get it back as the Network ID would have changed. Remove from ST, press and hold the pairing button for until the LED stops flashing (about 8 ot 10 seconds I think) then press and hold it again, this time you will get a series of very fast flashes, wait until they stop it is now reset completely.

Pair it back up via the app and not catchall. As mentioned numerous times, make sure you turn off ALL other hard wired Zigbee devices at the mains, so all bulbs, power outlets etc. before you start to pair te sensors, this prevents the sensors routing via any other devce and connect directly to the ST hub.

Hit the Add button in the app, press the pairing button on the sensor, wait a few seconds for he LED to respond, press again wait for the LED response. Keep doing this until the LED responds with 3 flashes, again keep repeating in the same manner, it will eventually appear in the app, once it does press the button again and wait for the LED response. Save the Sensor in the app and after that I would press the button again, wait for the LED, do this a couple of times. To be safe I would keep the other Zigbee devices turned off until the battery starts reporting. Once this happens then you know you know the sensor has connected directly to the hub properly and chances are it will never drop again.

I have paired over 30 sensors this way ( actually carried out over 300 pairings a few months back when we had an issue after a Hub F/W update) and all of them have stuck without issue. Well with the exception of one that is a great distance from the hub and has dropped a few times but a few quick presses of the button brings it straight back.

I use my own (xiaomi-zigbee-button.src
https://github.com/snalee/Xiaomi/tree/master/devicetypes/a4refillpad/xiaomi-zigbee-button.src).
It’s a bit laggy (sometimes the event isn’t triggered) with the SmartThings
app, but it works.

1 Like

You can either edit the device and select the handler for that device or I just edit the DH code that is already associated with the devices, save the changes and publish to self. The new code then gets applied to all associated devices. The only thing I’m not sure about is if it updates the configuration on the device if the DH configuration code changes.

Does anyone have a Xiaomi Button handler that supports multi-clicks? (Double, triple, and quadruple clicks)

All my Aqara sensor was paired using the ST app and not catchall method. I do this many times after I got the sensors. I totally ordered 7 of them and each time only paired one unit at a time. (still have 5 unit still in the box unopened) I don’t have any Zigbee device besides the ST hub which is my Shield TV with ST link module.

The main problem here is the drop off compare to pairing. But you do highlight a good point that it might route through my other aqara sensor (those still the box) to reach the hub. There’s also no on/off button on the sensor itself which it cannot be turn off. In this case, should I take out all the battery for all my sensor then pair one by one again ? (the first sensor unit does paired to the hub directly this can be sure but it still dropped off for some reason)

That only applies to hard wired Zigbee devices like light bulbs and power outlets. Battery powered devices do not act as routers.

It is really strange that a handful of people experience these drops yet others like myself are rock solid across dozens of sensors. There must be something, be it the distance from the hub to the sensor, some sort if interference in the area, external source or something within ST that causes these drops.

You could try a few things link moving your WiFi Router or hub by even just a few feet to see if that helps and have a think of what else in your home could possibly be causing the drops etc.

I would also just try 2 new sensors out the box, you just never know.

Thanks Mark, I am trying remove and re-add back the device to the ST app again. This time I used back Brian’s DH (the battery level continue display as --, light level seems not accurate as showing more than 100% when pointing toward windows on a cloudy day).

My router and the hub is 4-5 meter away, but I don’t think this will cause any interference as it can work for many hours before it get dropped off. And once it get drop off, then there’s nothing can bring it back online so I guess something (network/zigbee ID I don’t know) get changed/updated when it went off. Else it should connect back to the hub whenever I press the button on the sensor to reestablish the connection after it get drop off. But this was not happened no matter how many times I press the button on the sensor (try with two Aqara motion sensor and one Aqara door sensor)

Later I will pair all my remaining motion sensor (all Aqara Motion Sensor) and put it on different location around the house and see which one will drop off first (to see whether distance between the client and the hub make any different, it is just a small house)

I went through some thread on the ST Link (Shield TV is my only ST hub), and it look like other Shield TV user having the same issue with other Zigbee device too. I am now also suspect something to do with the sleep mode setting on the Shield TV setup which I totally turned off the sleep mode setting now.

I got the Xiaomi Temp/Humidity sensor and I am using the device handler provided in the post and it works well providing Temp, humidity and Battery.

My issue is that the device has lost close to 40% battery in two days. Is anyone having issue with battery? I ll try to reach out for a battery replacement but want to make sure if its not Smarthings which is causing it to loose battery so soon or incorrect reporting.

I finally got all 7 Temp sensors to get recognized through the catchall method. However after a few hours they all dropped off. So I did not delete them. Ran the catchall got the new ID put it in and it worked…for a few hours and then dropped off again. Man I wish I could find a temp sensor that is reliable.

I have a sensor no less than 15ft…worked for a little while and then nothing. I am sure it is interference so going to have to play with location. Question for you do you have any other zigbee devices that are close to these devices.

I have the Aqara temp sensors, the square ones, and it has stayed connected for about 2 weeks now without issues, and I paired not using the catchall method, although it did seem to not want to pair at first, and the first time it paired it dropped off but then I repaired it and hasn’t dropped since. I order 6 more so we’ll see the mileage I get on these.