[OBSOLETE] Original & Aqara Xiaomi Zigbee Sensors (contact, temp, motion, button, outlet, leak, etc)

Well, Aqara / Xiaomi devices never rejoin when requested to leave and rejoin by a hub or repeater device, and the only identified circumstance leading to that is when Aqara / Xiaomi devices try to check in after a check-in timeout has passed by, as explained here.

There are very likely other cases where a hub or repeater would request an end device to leave and rejoin, but a short interruption in the ZigBee mesh network due to a hub rebooting, etc., is not one of them, based on my experience and everything I’ve read of other user’s experiences.

If you don’t have any ZigBee repeater devices, and have attempted to avoid 2.4GHz WiFi interference, then I have a couple of guesses about the reason for the connectivity issues with your Aqara Door/Window Sensors:

  1. The signal strength between your hub and the Aqara Door/Window Sensors may be relatively weak (weaker than that of the Aqara Temp/Humidity sensors) and some change in the environment has led to the signal being too weak to maintain a consistent connection. The best solution in this case would be to add a repeater device (like the IKEA outlet you’re getting) in a location between the sensors and the hub, and then either re-pair / manually re-join the door/window sensors so that they (hopefully) choose to connect through the repeater. Only a ZigBee sniffer or preferably an XBee module would allow confirmation of the routing of those sensor, though.

  2. The ZigBee network 32-end-device limit of the hub may have been reached. The solution here is also to add one or more repeater devices, which don’t count against that 32-end-device limit, but do allow additional end-devices to be paired to the Zigbee network.

I should note that among my over 40 ZigBee devices (over 30 of which are Xiaomi/Aqara), I have 6 each of the Aqara and Xiaomi door/window sensors along with a couple of XBee modules (which serve as repeaters in addition to allow a view of the network’s routing map) and one IKEA outlet, and I have only seen two of the Aqara Door/Window sensors drop off the network a couple of times in the past year-and-a-half. But that was most likely due to all the testing I’ve done with a few repeater devices (which turned out not to be compatible with Aqara / Xiaomi devices).

3 Likes

I probably have 35 odd Aqara door and motion sensors. All of them were added without any issue at all. At some point I bought a Sylvania/Lightify smart plug, to extend network to lights and motion sensors outside my garage. Last week I tried to add a few more of these door sensors. Some of them connected, some failed to connect. Some would disconnect during next check-in. Of the ones that connected, some of them didn’t work properly, will show open even when they were closed / would not update and so on. The solution that seems to be working for me was I unplugged the smart plug and re-added the new motion sensors. All of them connected successfully, left them near the hub. After 5-6 hours I plugged back the smart plug. They stayed connected for 3-4 days. Yesterday I moved the sensors to their ultimate location and will leave them there for another 3-4 days before I install them. My hub is downstairs and these new sensors are all upstairs. There seems to be no issues at all. I am keeping my fingers crossed and hope they all stay connected.

Planning to pick up a Tradfri outlet this week and will test using it instead of Lightyfi and hope my outside motion sensors as well as all my Aqara sensors work as usual. At that point maybe ditch Lightify and use only Tradfri outlets going forward.

Is there any zigbee devices that could be used as repeaters and their end device timeout could be configred? If repeaters timeout could be set near 1h (close xiaomi sensors timeout setting) would it fix this issue?

There are two variants of this plug. The model 72922 has been reported to work with Xiaomi / Aqara devices - for the most part, but model 72922-A definitely doesn’t work with them. If that “-A” model is the one you have, then I’m not surprised by the behavior you describe. For most ZigBee repeater devices, if by some luck the repeater device does allow Xiaomi / Aqara devices to stay connected, then there can be issues with the repeater not passing on messages from Xiaomi / Aqara devices. I’ve witnessed it with a Securifi Peanut Plug I tried out, and I’ve read of the same behavior with the Sylvania 72922-A Smart Plug.

Although this may seem like a good way to avoid Xiaomi/Aqara sensors from routing through an incompatible repeater, unfortunately it isn’t, because by design, ZigBee devices may choose the best available route to connect through, and that route can change at any time as conditions or the topography of the network change. For the vast majority of ZigBee devices, users have no control of how, when, or where they choose to connect to any particular repeater (or directly to the hub).

Again, I have witnessed this first hand, using an XBee module to view the map of my ZigBee network, and watched as some Xiaomi / Aqara devices decided to move to a new repeater device I added. On the other hand, I have read that with some Xiaomi / Aqara devices, they seem to be stubborn in deciding to change over to a repeater with a stronger signal, after the user moved them to their install location. The end result of that can be a weak connection to the hub and the potential for those devices being dropped off the network.

For best results, ZigBee devices should be paired in their install location so they connect via a nearby repeater if the signal is strong enough (and if that repeater has available slots for more end devices.) The only way to confirm the route they have decided to take is with an XBee module (see this thread for more information.)

I would recommend that. I have one TRADFRI Outlet and it works great as a repeater for Xiaomi / Aqara devices on my Hubitat hub’s network (which works pretty much the same as a SmartThings v2 / v3 hub’s ZigBee network) , and plenty of Hubitat hub users have found the same.

I would highly recommend reading this thread I started over on the Hubitat Community Forums which contains a lot of very helpful information on keeping your Xiaomi / Aqara devices happily connected to your ZigBee network:

In the least, make sure to read through my opening post of that thread.



To my knowledge, only the XBee ZigBee modules can be configured like that. All other ZigBee repeater devices are “hardwired” with their particular settings.

It would fix it for the most part. As I understand it, if the ZigBee network was down or inaccessible long enough, Xiaomi / Aqara devices would be dropped and then wouldn’t rejoin when requested.

Also, adjusting that end device timeout would not fix any issues that some repeaters have in simply not forwarding messages from Xiaomi / Aqara devices (as I mention in my reply to @rumrunner424, above.

Will do. Thanks

Thanks for the good information. I’m still wondering what is the difference between my 10 sensors connected straight to st hub and 10 sensors connected via ikea repeaters. It really seems to be the problem that in power cut those sensors connected via ikea repeaters drops offline. Sensors connected straight to hub are always okay and back in business after hub comes back online. Why those 10 sensors connected straight to st hub are acting differently? There was power cut at weekend and hub and repeaters were offline for a 20min. After that short time ikea repeater (just one of them) was shown as offline and same happened all those sensors behind it. When pressing ikea bulb “on” from st app it turned normally on and offline status disappeared. Then I had to open those Doors with offline sensors (I manually opened Door so that status changes). They came back online after opening and closing Door manually.
If I would left them as they were after power cut, Xiaomis would have changed to offline and then they have to be manually rejoined. It might take hour or two but in the end ST app would have shown that xiaomi sensors behind that repeater are offline and they do not wake up anymore just by changing open and close status. They have to be manually rejoined. So is my problem more of a Ikea bulb/repeater problem which can’t handle power cut for some reason.

Thanks bspranger and others for this handler. Do I have to unplug all my repeaters when connecting? Could I just pair it within inches of the hub itself.

Hi and welcome @chj4545.

The short answer is that you should not unplug any ZigBee repeaters, and the devices should preferably be paired in room/area where they will be installed, so they connect to the nearest appropriate repeater from the start.

Are you concerned about having repeaters on your network that are incompatible with Xiaomi/ Aqara devices? What ZigBee repeater devices do you have?

I’d recommend reading posts from the past few days - starting with this post - where I explain about incompatible repeaters and also why temporarily unplugging them won’t really help avoid issues.

tldr:
{Yeah, concerned about repeaters getting in the way. I have original xaomi buttons, were working great for a while, now 2/3’s of them dropped off; really no rhyme or reason, hoping batteries. I have to start trouble shooting them, really didn’t want to connect/reconnect repeaters each time.

I have maybe 6-8 peanut plugs, all on their newest firmware. And then a couple of Samsung Plugs, 1 box 1 oval.}

That’s funny that you had just written about it so thoroughly, didn’t think to search. I know previously, the idea was to unplug everything. I was hoping I wouldn’t really have to do that over and over again and could just try to get it connected to the hub by pairing right next to it. I’ve been troubleshooting a bunch of the original wxkg01lm’s.

All of them were working perfectly for months, maybe almost a year, and recently 2/3’s of them dropped. And continue to drop. I’m guessing or hoping it’sthe batteries but it could possibly be interference with maybe 4 wyze wifi cams I’ve recently installed around the house. However, I really don’t think it’s that because buttons in the same room will either be connected or unavailable. I’ve also installed maybe 4 extra peanut plugs throughout the house possibly around the same time, I think I was also updating firmware on those plugs and the others around the same time(bought an almond router to update so I could get watt info). Again, though, specifically in 1 room where the buttons are 6 feet away, 1 stayed connected the other didn’t.

I don’t have many repeaters - by my reckoning just a Aeotec Nano Dimmer and Aeotec Siren - both are my only plugged in Z Wave devices and both are in the same room as the hub. I’ve been pairing up the motion sensor this morning and it’s… interesting but the instructions helped me through it. I had to fully reset it 2-3 times and go through the tapping the reset every 5 or so seconds to make it work. It’s now paired (right next to the hub in my case) so I’ll try moving it to another room as intended later and see if it still works.

Seeing as I’ve paid many times more than this for motion sensors i’m really hoping for success - after all there’s so much clever than can be done if you know people are moving through a room :slight_smile:

Hello Gys, I’ve something here that I’m not able to find a solution… Here we go…

I’ve the smartthings modem completely setup with those xiaomi outlets on it using the catchall method, but what happens is that I’ve delete the location and call Samsung, they give me a new welcome code for my modem but I’ve lost everything and need to setup all sensors again, but those xiaomi… no way… I can’t use the catchall method because I think is already setup on my previous modem like everything that I’ve to exclude and include again, but, in this case of catchall… How can I manage that? I’ve tried to exclude but nothing works, tried to catchall again… no luck… any advise will be very welcome!

This is so cool @veeceeoh !!

I just got firmware’d to 25.00026 and here is my feedback so far:
(meant in the most positive way) :wink:

  1. The WXKG03LM (2016 revision) displays “Left pushed” in the app, when physically pressed.
    The log reads: TV Aqara Switch WXKG03LM: Left button was pushed (Button 1 pushed)
    This looks a little odd, given the device only have one button.
    If you push the button “virtually” in the app it displays “PUSHED” correctly.
    When you press the button either physically or virtually, the app keep showing the “Left pushed”/“PUSHED” message for 30 seconds, before it returns to show “RELEASED”.
    This means that you can’t use the button virtually for the next 30 seconds after it is pressed.
    (Don’t know if this is a Hub-, button hardware- or DH-issue. But i don’t recall seeing this before)

  2. The round WXKG01LM works great with hold, single, double, triple, quad and shizzle-click.
    It also displays is correctly in the app, but keeps showing the “pushed” message for 20 seconds.
    If you press the button virtually in the app, it doesn’t show the press in the app - the push is still being recognized and sent to the hub though.

  3. The WXKG12LM also works great with both Hold, Single, Double and Shake.
    It also displays is correctly in the app, but keeps showing the “pushed” message for 15-20 seconds.

  4. The WXKG11LM (orig) works great with single, double, triple, quad
    It also displays is correctly in the app, but keeps showing the “pushed” message for 20 seconds.
    If you double click the button fast, it sometimes only registers a single-click.

  5. I have a WXKG02LM in the mail from China - i’ll get back to you when tested…

All in all it seems that all the buttons reacts faster. The different Smart Lighting rules i have set up to eg. control my smart bulbs, now turns the light on with near zero delay…
That could be the ST firmware - i know - but i would like to think that it’s because of your DH’s. :thinking: :wink:

Once again: THANK YOU for all your effort on keeping the Xiaomi’s alive…!!

2 Likes

Thanks for the feedback, Kenneth!

I’d like to address a couple of things:

First:

The new driver actually does a check of which specific model and revision is being used, and if a one-button model WXKG03LM has been detected, both the log message and event description text is customized with “Button was…” instead of “Left button was…”

I just realized that I made a small error that will make the feature not work, but only for the 2018
revision
. I’d like to fix that, but let’s look at why it’s not working for your 2016 revision WXKG03LM.

One thing I want to check is whether you already had the old driver assigned to your WXKG03LM and just assigned the new driver without pairing it. If that’s what you did, then you should try opening up the preferences for it in your SmartThings Classic mobile app, and then hitting the save button. That should force the DTH to check the model again, and may fix the issue.

If that doesn’t work, the next thing to check for is whether the ZigBee model information was received by the hub when the Smart Switch was original paired. Log into your hub’s SmartThings Groovy IDE, go to the “My Device” tab, and then click on the name for your WXKG03LM in the Display Name column, so you can view its device details. Look at the Data and Current State sections.

In the Data section, you should see a model: listed, and for the WXKG03LM the ZigBee model is lumi.sensor_86sw1. Here’s an example screenshot for my 2016 revision two-button model WXKG02LM:

If you see the correct model listed there, then have a look at numberOfButtons in the Current States section. For the model WXKG03LM it should read numberOfButtons: 1. If those two pieces of information don’t match, please let me know. If they do match, there’s one more thing to try, which is to manually force the switch re-join with a new Device Network Id (DNI). Before this, while you are viewing the switch’s device details page, just make sure there’s a hexadecimal string in the “Zigbee Id” section, like this:

To manually force a ZigBee device to re-join with a new DNI, you just follow the same steps as pairing, but don’t remove it from your device list first.

So, in the mobile app, start pairing mode with “Add a Thing”, and long-press the button to put it into pairing mode also. If the one-button is like my two-button model, then after the long-press, there’s a pause before the LED flashes. One long flash means successfully connected, two flashes means unsuccessful (so try long-press the button again.) After that, the DTH should go through the initialization process again to determine the model and set the number of buttons that are used for events in SmartThings. Let me know how that goes.

Second:

That can’t be correct. The tile display and the actual button events are completely separate. Please check your “Recent Events” list in either the mobile app or in IDE to verify that you can continue to press the button and events are recorded.

However, the tile display should not be clearing after 30 seconds. It is set to automatically clear after the last press/hold/etc. after 1 second, because it’s just for user interface display feedback purposes only. With the delays of the cloud-based execution, I normally see it clear within 2-3 seconds (I just tried it now and it took about 2.5 seconds), but definitely never 30 seconds. That would be a SmartThings platform issue and there’s very little I can help with in the DTH.

Third:

That is just the way the WXKG11LM model hardware works. For all double-click capable Xiaomi / Aqara buttons, there is a specific timing to get the double-click correctly, a certain rhythm. The same applies to the buttons with the holding for 400ms to send a “hold” message. I hope that makes sense. Again, there is nothing I can do in the DTH to change or help that.

Hi,
since yesterday my XIaomi button is acting weird,
If I press the button the “last event” timestamp gets updated (so the button is connected and working)
but the state doesn’t change to “Pushed” and any automation connected to the push of the button doesn’t work.
If I “Push” it in the ST app, it works and automations work as well.

My firmware version is 25.00026

Any Advice?

SmartSelect_20190328-113251_SmartThings

My two buttons behaves the same, did you solve it somehow?

Yes, I’ve installed this beta Device Handler
https://github.com/bspranger/Xiaomi/blob/3ae185462b9ce024111e07450b9f02ef849e4d2b/devicetypes/bspranger/xiaomi-aqara-button.src/xiaomi-aqara-button.groovy

[WIKI] How to find your Aqara Button or Wireless Switch model

If you have an Aqara Button:

aqarabutton
There are three versions, each with different functionality:

Model Revision ZigBee Model ID Functions
WXKG11LM original lumi.sensor_switch.aq2 Single, Double, Triple, & Quad-click
WXKG11LM new lumi.remote.b1acn01 Single/Double-click, Hold, & Release
WXKG12LM lumi.sensor_switch.aq3 Single/Double-click, Hold, Release, & Shake

* Note: Sometimes the ZigBee Model ID for model WXKG12LM is truncated (cut off), so “lumi.sensor_swit” might be seen instead of “lumi.sensor_switch.aq3”.

The product model is printed on the back:


If you are using model WXKG11LM, then there are two revisions, only identified by checking the ZigBee Model ID after pairing the button. Please see the Checking the ZigBee Model ID instructions, below.

If you have an Aqara Wireless Light Switch


There is a one-button and two-button model, each with two revisions for different functionality:

Model Revision ZigBee Model ID Functions
WXKG03LM 2016 lumi.sensor_86sw1lu 1button: push
WXKG03LM 2018 lumi.remote.b186acn01 1button: single/double-click & hold
WXKG02LM 2016 lumi.sensor_86sw2Un left/right/both: push
WXKG02LM 2018 lumi.remote.b286acn01 left/right/both: single/double-click & hold

* Note: Sometimes the ZigBee Model ID of the 2016 revisions is truncated (cut off), so “lumi.sensor_86sw1” might be seen instead of “lumi.sensor_86sw1lu”, or “lumi.sensor_86sw2” is seen instead of “lumi.sensor_86sw2Un”.

Since both the 2016 and 2018 revisions have the same product model printed on the back, the only way to identify the revision is to check the ZigBee Model ID by following the instructions below.

Checking the ZigBee Model ID

Here are the steps to look up the ZigBee Model ID of your Aqara Button or Wireless Light Switch:

  1. Log into your hub’s SmartThings Groovy IDE
  2. Click on the My Devices tab:
  3. Click on the name of your button in the Display Name column, for example:
  4. In the device details page for your button, look for the Data section to find the ZigBee Model ID text next to "Model: ", for example:

    If there is no text in the Data section, it is probably because the button was paired using the “catchall” method. In this case, the only way to know the ZigBee Model ID is by testing the functions of the button / smart wall switch.
6 Likes

First:

I’ve just realized that i was using the V0.9b and NOT the Version 0.9.1b DH - Sorry - hadn’t seen you made a newer version… :zipper_mouth_face:

The tile is now showing the correct action: PUSHED

One thing though:
My data section looks correct:

  • application: 04
  • endpointId: 01
  • manufacturer: LUMI
  • model: lumi.sensor_86sw1

But my current states shows numberOfButtons = 2:

So the number of buttons does not match what you expected? (i’m pretty sure i have the 2016 version, since no double clicks is available) :face_with_raised_eyebrow:
Zigbee ID is ok - i’ve paired the button the correct way, and not with the catchall method. :smirk:

Second:

Just to be clear:
I am perfectly able to use the physical button while the tile i busy showing the “PUSHED” state.
I just can’t push the button virtually by tapping the tile while it shows “PUSHED”. Today it’s down to 15 seconds…
I understand that this is out of your hands, i was just wondering since i never had this issue before (normally it’s about 2.5 seconds, as you describe) and it started right after using the new DH… :slight_smile:

1 Like

This might have happened because of a mistake in the method of setting the number of buttons in the earlier version 0.9b of the DTH.

If you are using v0.9.1b then the log messages and text for events should correctly display “Button was pushed” instead of “Left button was pushed”. Having the number of buttons available to SmartThings set to 2 won’t hurt anything, just make sure that in any SmartApp you choose button 1 pushed as the trigger. For example, if making an automation in SmartThing’s Smart Lighting App, choose “One” for the button number, not “Two”:

If it really bothers you then you can reset the number of buttons either by removing your WXKG03LM(s) from SmartThings and pairing it/them again, or by manually re-joining as I explained in my previous post.

Hmm, I understand now. This is definitely an issue with cloud execution of the code. However, I think there might be a different way to implement the same feature of the momentary display of the button action (“Pushed”, “Single-clicked”, “Held”, etc.) in the UI of the ST “classic” mobile app, but with more reliable timing of when it resets the display back to “Released”. I will do some testing and post back with my findings, and hopefully updates to the drivers to resolve the issue.

1 Like

On a bothering scale from 1-10 it’s only a 1½… :grin:
I am using the v0.9.1b though. Just for the sake of experimenting and to help others with the same issue, i just tried a manual re-join, by searching for a new device, resetting the button and re-pair it again. No luck - It still shows numberOfButtons = 2

Cool…! Let me know if i can help with something…

Any ideas for this one…:
(It really is a minor detail…)

(i’m using the Xiaomi Button v1.3 DH)