[OBSOLETE] Xiaomi Sensors and Button (beta)

I did not count through them when I wrote my previous message “have around 40 of them…”

So here is an actual count;

12 Door/Window (mix of Xiaomi and Aqara)
4 Temp
6 PIR (4 in situ, 2 on my desk under he rubbish somewhere lol) Mix of Xiaomi and Aqara
1 Water/Flood
3 Power sockets but they are in their boxes even though they still appear in the app.
2 Aqara Buttons
2 double wall switches (they are in my list but sort of gave up playing with these due to time)

These are the ones which are in situ, I also have some at the bottom of my list which takes the total to 39, the ones at the bottom still all state as being online though. I wonder if the buttons/switches are treated differently. I only have one of them that seems to drop off occasionally and am pretty sure this is due to distance, quick press and it is back online though. Now been going through hell with my Z-Wave devices recently, ST seem to be messing with the cloud and config which is causing me misery at the moment with them dropping offline whereas my zigbee devices have never been more solid. Despite this I am actually moving more and more to Z-Wave. Have some decent outdoor PIR sensors now which are far more configurable etc. The only ones I will probably defo keep are the Door sensors, I have actually embedded the majority into the tops of my doors and on the smaller windows around the house and external building I have hidden them in the UPVC Window frames. On the Main windows and doors I use Fibaros and Sensative Strips.

I have never had any luck with routing them through other devices. The ONLY way to keep the alive is to have them connected directly to the hub, well at least whilst pairing and for them to establish the handshake fully. I do have a few Xiaomi sockets but they are hardly used these days and are back in their boxes so I currently do not have anything online that would act as a repeater. Sorry I cannot help further :frowning:

Thanks for looking. So it looks like you are still under the 32 direct connect slots. I’m only at 20-something myself but have direct-connect slots taken up by non-Xiaomi devices, too. I do really like these little critters.

HOw do you know what is direct connected? Is there a way.

Others may chime in - but to the best of my knowledge, unless you buy a Zigbee sniffer, only time you are told is in the IDE when the device first joins. Under Hubs/ [your hub]/ events you will see a zbjoin message with “parent: xxxx” [xxxx is the device network identifier for what it connected to - if it’s 0000 it connected to the hub].

But - after the connection event- no way to tell in the Smartthings IDE.

SmartThings support also has tools to identify what each device is connected to.

oops - sorry - missed that your total was 39. Maybe the ones that are not currently active have “given up” their slot because they are inactive?

I’ve just posted about pairing Xiaomi sensors on Brian S’ thread, but I’ll repeat it again here:

There are English-language manuals for some of the Xiaomi devices accessible on the FCC ID Search Database website. They are listed under FCC ID applications for Lumi United Technology Co., Ltd, here.

Of all of them, the most helpful is the manual for the Aqara Door/Window Sensor. Here is the section on how to use the button to reset / pair and what the LED flashes mean:

(NOTE: DWS = Door/Window Sensor)

The above information works for my Aqara Door/Windows sensors, Xiaomi “original” Door/Window sensors, and my Aqara leak sensor. Based on watching videos of people pairing other Xiaomi sensors (Temperature/Humidity, Presence, etc.) this information applies to those as well.

When you hold the reset button down, as soon as the LED flashes, the device has been completely reset and goes into pairing mode. 3 seconds is about right from everything I’ve seen, but really what you should do is hold the reset button in until the LED flashes and then stop pressing the reset button. This should all of course be done after you’ve selected “Add A Thing” in your SmartThings mobile app.

After that initial LED flash, there is a pause, and then you’ll either see the LED flash once (a long flash), or it will blink 3 times (short flashes).

If the LED flashes once, pairing was unsuccessful, and you should short-press the reset button to “wake up” the sensor to try pairing again. The LED will blink as you short-press the button, and after a pause it will either flash once (a long flash) or quickly blink 3 times. If it flashes only once, short-press the button again, and repeat until you see the LED quickly blink 3 times.

When the LED blinks 3 times, the pairing process has started, and you will see a “catchall” message appear in the hub event log in IDE (in My Hubs -> List Events, not in the Live Logging window).

Then, if you already have installed a correctly working Device Handler for the Xiaomi device in your IDE, a zbjoin message should appear in the hub event log shortly after the catchall message, and that’s when you’ll see the device show up in your SmartThings app, ready to be renamed.

However, because these are battery-powered “sleepy” ZigBee devices, the pairing process may not complete, so the best advice (based on a post by Ted Tolboom on this Athom home-automation thread) is to continue short-pressing the reset button every 5 seconds, even after you see the LED blink 3 times, until the pairing process is complete (and you see the device appear in your SmartThings mobile app.)

Following the procedures I’ve explained above, I have had 100% success in correctly pairing 4 Aqara Door/Window sensors, 4 “original” Xiaomi Door/Window sensors, and a Aqara leak sensor again and again in numerous tests. With my v2 hub, none of these sensors have dropped their connections.

NOTE: Before my v2 hub, I was using a SmartThings Link for NVIDIA Shield, and none of the Xiaomi devices could stay connected more than an hour, and others with the SmartThings Link have reported the same troubles. I have also seen one person with a ST Connect Home report they also had no success in keeping Xioami devices connected. So if you aren’t using a v2 hub, I can’t recommend trying to use any Xiaomi devices.

What I do recommend is trying your best to pair your Xiaomi devices so that they show up as a named device in the SmartThings mobile app instead of using the “catchall” method because then their ZigBee ID will be known by your hub, and some aspects of the “health” reporting and maintaining a connection depend on a known ZigBee ID.


I can confirm this as the apparent sole method to see whether a ZigBee device has connected directly to your hub or through a repeater / ZigBee router, unless you have a sniffer or are using another non-end-user tool.

I would really really love for ST to add access for users to view ZigBee / Z-Wave routing topography to aid in troubleshooting.

1 Like

So is there a way to change the button so that all you have is pressed and then after 5 sec or so it automatically goes into released or something like that. I am trying to use it to turn on a light using WebCore. However because Webcore does not recognize the release , only pressed and hold, you must cycle through the button three times to get to turn on and then turn off.

I am using a Xiaomi button to control some curtains via a webcore piston. I set the if statement to “Lounge curtains’ button gets pushed”. This works pretty well for me.

OK but if you press it again nothing happens? You must press it twice to get it to “press” again? If not what DTH are you using?

I am using the a4refillpad DH. I did try the bsranger one, but it doesn’t work. Using this DH I can get it to register a press every second or so. More often than that and it can confused. Also, the held function works with the a4refillpad DH, not with the bspranger one. At least not for me.

OK I Like how that works in Smarthings but having issues with WebCore Recognizing the push states with that DTH. You have an example from WebCore?

import webcore back code 3r5mp and you can see the button section at the bottom.

Thanks but that is weird. Have the same setup and I get nothing in webcore. If I change the DTH to the other one I can see it but with the DTH that you are using it has not effect in webcore. SO I am wondering if the DTH is right from his repository.

If I change the DTH back to the bsranger it works fine. For some reason I can’t get a4refillpad to work in WebCore

Just conforming your have the original button and not the Aqera one?

Also it may help if you refresh the devices in webcore by going onto the webcore app and del-select/re-selcet the button. then go back into the piston and choose the button and action again?

Yea I have the Aqera one

Also…Soooo I read somewhere that there is a limit to the ZigBee devices and that is 40. Is that True?

Zigbee limit is 32 directly connected devices. Xiaomi has to be direct connected.

I am using some cheap xbees as repeaters and dont have an issue with xiaomi being connected through a router.

Through bulbs acting as a repeater…yes disastrous

What a great source!!! Thanks for pointing us there!

Interesting point - I just have Samsung Smart Plugs (and one Osram bulb) - looks like it may depend on the repeater. Could you give a link to the repeaters you’re using?