A few weeks ago all of a sudden, a bunch of my Xiaomi Aqara devices dropped off the network. I cannot get them to reconnect. Anyone else having this issue. Do I need to remove them from the hub? I would like to avoid that.
[OBSOLETE] Original & Aqara Xiaomi Zigbee Sensors (contact, temp, motion, button, outlet, leak, etc)
I have been having the same issue for the past two weeks or more with some of my xiaomi devices. I canāt get them to stay connected for more than couple hours anymore and nothing changed in my setup so Iām thinking it has to do with the latest hub firmware update st pushed 
Have just added this DTH and changed my button to use it. Pulled this from the log:
14:05:00: info Button 3 was released
14:04:59: info Button 3 was held (Button 1 held)
14:04:55: info Button 3 was double-clicked (Button 2 pushed)
14:04:48: info Button 3 was single-clicked (Button 1 pushed)
Iām about to try a few things in webcore.
Anything in particular you want testing?
How do I use the custom events? I can only see pushed or held in webcore.
I have two of these. Since changing to the new DTH is see this in the events.
2018-11-04 2:59:08.823 PM GMT
moments ago DEVICE button held Lounge Wireless was held
2018-11-04 2:58:26.405 PM GMT
moments ago DEVICE button pushed Lounge Wireless was double-clicked
2018-11-04 2:58:19.849 PM GMT
moments ago DEVICE button pushed Lounge Wireless was single-clicked
2018-11-04 2:58:12.791 PM GMT
moments ago DEVICE numberOfButtons 3 Lounge Wireless number of buttons is 3
Thanks for that
Thanks for that.
Interesting read. Shame they canāt choose how the data is processed based on a profile of the device.
[BETA] Xiaomi Aqara Button SmartThings DTH v1.3.1b
With @mikejclark reporting back on his 1-button Aqara Wireless Smart Wall Switch (model WXKG03LM), it appears that there are actually two revisions of this product: One which only sends a ābutton pushedā message, and the other which has single-click, double-click, and held functionality. From his report, it appears my update to the Aqara button DTH is working as expected, but Iāve added comments regarding the different revision models.
Also, I decided to add lastHeld and lastHeldCoRE custom attributes for events that can be used with WebCoRE.
The updated DTH code can be copied directly from here.
Changes
- added custom attributes
lastHeld(with human-readable date/time stamp) andlastHeldCoRE(with UNIX Epoch date/time stamp) which can be utilized in WebCoRE - added comments in header section related to original/new revisions of 1-button Aqara Wireless Smart Wall Switch model WXKG03LM, and the 2-button WXKG02LM
- added comments specific to new revision of WXKG03LM in button press parsing function
- other minor fixes
Thanks for reporting back on what youāre seeing with your model WXKG03LM. So it appears there are two revisions of this model!
In your WebCoRE screenshot it looks like you are using button events to compare values to. The custom events are based on custom attributes, not on button events.
Look for these: lastHeldCoRE, lastPressedCoRE, and lastReleasedCoRE. When the events on these custom attributes happen, they are set to not display in the events list, because it would just clutter the events list display in the SmartThings (Classic) Mobile App. You can confirm they are happening by turning on debug message logging in the preference settings for the button in the Mobile App.
It would be super helpful to make sure your model WXKG03LM button doesnāt send any message when you release the button after holding it (which some of the other Aqara buttons do). The way to check this is turn on debug message logging and then look for a message after the āLounge Wireless was heldā message which includes āParsingā but without being followed by āCreating eventā.
The other thing Iām curious about is whether the two different models of the WXKG03LM button report the same ZigBee model information. This can be found in the āDataā section of the Device page for your button in the IDE (My Devices tab ā click on the name of your button), like this:
It looks like the latest contact, switch, water and button from Lumi (manufacturer of Xiaomi Mi and Aqara) are zigbee 3.0 certified. Which means in theory they will work with standard zigbee communication
In theory!
However, looking through the certification documentation for just the new Door & Window Sensor, this appears to be the good news weād want to see from Xiaomi moving forward:
So from what I understand, this and the other new ZigBee 3.0 certified Aqara devices will attempt to rejoin a mesh network that it was previously on, which is something all previous Xiaomi devices fail to do. Even after searching through some of the ZigBee Allianceās certification documentation, Iām not sure what the āZLT3ā designation refers to, but the āMā means āMandatoryā, and āYesā of course means that function is supported. My hope is that the new Aqara devices will also automatically rejoin the network of a ZigBee 2.1 hub.
Interestingly this certification process has been going on since 2015, and thankfully all of the ZigBee 3.0 certified Aqara devices have new model numbers, and the new product names listed on the ZigBee Certification website end with āT1ā, except for the āWall Switch (with Neutral, Double Rocker) S2ā. I say āthankfullyā, because recently Xiaomi has released new revisions of some of their Aqara ZigBee products under existing model numbers, but with different hardware feature sets.
Because Xiaomiās website hasnāt been updated to display the new āT1ā & āS2ā product lineups, and there are multiple older models with the same external case but different features, I expect things to be a confusing mess for people looking to buy Xiaomi devices. Itās also a complete mess in terms of supporting all of the models / variants in SmartThings device handlers. With that in mind, I am building a spreadsheet to make sense of all of the different models / revisions of Xiaomiās ZigBee smart home devices.
Hereās a preview:
| Xiaomi Device Name | Device Type | Model / SKU | Zigbee Model | Certification |
|---|---|---|---|---|
| Aqara Cube Controller | Multi-function Controller | MFKZQ01LM | lumi.sensor_cube | |
| Original Door and Window Sensor | Magnetic Contact Sensor | MCCGQ01LM | lumi.sensor_magnet | |
| Aqara Door and Window Sensor | Magnetic Contact Sensor | MCCGQ11LM | lumi.sensor_magnet.aq2 | |
| Aqara Door and Window Sensor T1 | Magnetic Contact Sensor | MCCGQ12LM | ZigBee 3.0 | |
| Original Motion Sensor | IR Motion Sensor | RTCGQ01LM | lumi.sensor_motion | |
| Aqara Motion Sensor | IR Motion Sensor | RTCGQ11LM | lumi.sensor_motion.aq2 | |
| Aqara Smart Bulb | Smart Bulb (E27) | ZNLDP12LM | ||
| Original Smart Plug | Plug-in Outlet Switch | ZNCZ02LM | lumi.plug | |
| Aqara Smart Plug | Plug-in Outlet Switch | ZNCZ12LM | lumi.ctrl_86plug.aq1 | |
| Original Temperature and Humidity Sensor | Temp & Humidity Sensor | RTCGQ01LM | lumi.sensor_ht | |
| Aqara Temperature and Humidity Sensor | Temp & Humidity Sensor | WSDCGQ11LM | lumi.weather | |
| Aqara Wall Outlet | In-wall Outlet Switch | QBCZ11LM | ||
| Aqara Wall Switch - Single (no Neutral) | Wall Switch (no neutral) | QBKG04LM | lumi.ctrl_neutral1 | |
| Aqara Wall Switch - Double (no Neutral) | Wall Switch (no neutral) | QBKG03LM | lumi.ctrl_neutral2 | |
| Aqara Wall Switch - Single (w/Neutral) | Wall Switch w/Neutral | QBKG11LM | lumi.ctrl_ln1.aq1 | |
| Aqara Wall Switch - Double (w/Neutral) | Wall Switch w/Neutral | QBKG12LM | lumi.ctrl_ln2.aq1 | |
| Aqara Wall Switch S2 - Double (w/Neutral) | Wall Switch w/Neutral | QBKG20LM | ZigBee 3.0 | |
| Aqara Water Leak Sensor | Water Contact Sensor | SJCGQ11LM | lumi.sensor_wleak.aq1 | |
| Aqara Water Leak Sensor T1 | Water Contact Sensor | SJCGQ12LM | ZigBee 3.0 | |
| Original Smart Wireless Switch | Multi-function Button | WXKG01LM | lumi.sensor_switch | |
| Aqara Wireless Mini Switch | Multi-function Button | WXKG11LM (2015) | lumi.sensor_switch.aq2 | |
| Aqara Wireless Mini Switch | Multi-function Button | WXKG11LM (2018) | lumi.remote.b1acn01 | |
| Aqara Wireless Mini Switch | Multi-function Button | WXKG12LM | lumi.sensor_switch.aq3 | |
| Aqara Wireless Mini Switch T1 | Multi-function Button | WXKG13LM | ZigBee 3.0 | |
| Aqara Wireless Remote Switch - Single | Multi-function Button | WXKG03LM (2016) | lumi.sensor_86sw1 or lumi.sensor_86sw1lu | |
| Aqara Wireless Remote Switch - Single | Multi-function Button | WXKG03LM (2018) | lumi.remote.b186acn01 | |
| Aqara Wireless Remote Switch - Double | Multi-function Button | WXKG02LM (2016) | lumi.sensor_86sw2 or lumi.sensor_86sw2Un | |
| Aqara Wireless Remote Switch - Double | Multi-function Button | WXKG02LM (2018) | lumi.remote.b286acn01 | |
| Aqara Vibration Sensor | Accelerometer Sensor | DJT11LM | lumi.vibration.aq1 | |
| MiJia Honeywell Smoke Detector | Smoke Detector | JTYJ-GD-01LM/BW | lumi.sensor_smoke |
That screenshot was of the events and then WebCoRE-specific log output. What Iām hoping to see is the debug & info message output for just the button itself on the Live Logging page of your IDE. Log output for a specific device or SmartApp can be isolated by clicking on the URL link of its name at the top of the Live Logging page - so in this case, clicking on the name āLounge Wirelessā (if thatās the new revision lumi.remote.b186acn01 switch).
To turn on debug message logging, it needs to be turned on in the preference settings for that device, in the SmartThings āClassicā mobile app, as seen here:

Iād only need to see the log output for your lumi.remote.b186acn01 version of the WXKG03LM switch. This is the new revision that I wrote a post about back in October.
I am sorry to say that the āoriginalā lumi.sensor_86sw1 version of the WXKG03LM switch definitely only supports single press in hardware, and not double-press or hold. Also note that if you hold the button of the lumi.sensor_86sw1 version for 5 or more seconds, it will go into pairing mode.
From your screenshots and further testing, I see that the new beta Aqara Button DTH needs some fixes and edits. I should hopefully be posting with a new beta version to try soon.
Thanks for all your help!!
I take it the double switch will not work still though as a double�
I donāt yet have any information about how the new lumi.remote.b286acn01 version of the WXKG2LM Aqara Wireless Smart Wall Switch switch sends Zigbee messages. And thereās no information about the new QBKG20LM Aqara Wall Switch S2 either.
So the answer is: I have no idea.
Thanks for your continued work on this. One small note, all my original Temp and Humidity sensor have a different model - from the IDE devices page:
- application: 02
- endpointId: 01
- manufacturer: LUMI
- model: lumi.sens
Thanks for the report, but thatās not a different model.
The full ZigBee model text just gets truncated for some reason during the pairing process if the reset button is pushed repeatedly (which is what SmartThings users need to do to complete the pairing). This behavior has been mentioned in a forum thread for another HA solution here.
I can not get these guys to stay connected for more than an hour or two. I followed the pairing instructions and made sure to see the collectall and zbjoin message for each device when pairing. Iāve tried resetting and repairing multiple times. My device breakdown is the following:
5x Aqara Leak Sensors
3x Aqara Motion Sensors
3x Aqara Temperature Sensors
6x Aqara Door Sensors
My hub is the Samsung SmartThings dongle for my Nvidia Shield⦠Not sure if that is the difference maker?
I tried adding a Zigbee repeater to the mix after I paired everything to see if that would help. It did not.
Every device shows a Zigbee ID and Device Network ID on the developer portal.
Any tips or things to look for? Appreciate it!
Yes it is.
Before I bought a SmartThings v2 hub, I was using the SmartThings Link for NVIDIA Shield TV. My Xiaomi devices NEVER stayed connected to it for more than an hour or two.
The reason for this is quite well documented. ZigBee hubs and repeaters (routers) will drop the connection of ZigBee end devices that donāt check in often enough based on whatās called End Device Aging Timeout. However, ZigBee end devices whose connection have been dropped but attempt to check in can still rejoin the network after receiving a rejoin request from the hub / repeater.
Unfortunately, Xiaomi devices do not follow ZigBee protocol of rejoining the network when requested.
The only way to get around this issue is to use a hub / repeaters which have an End Device Aging Timeout period that is longer than the normal check in frequency of Xiaomi devices (50 or 60 seconds depending on the model.)
The End Device Aging Timeout period length is not user-adjustable (with the exception of XBee devices) and is not normally part of any published ZigBee information for hubs / routers. So compatibility with Xiaomi devices can only be discovered through trial and error.
Based on my experience and reports by various users, the SmartThings Link for NVIDIA Shield presumably has an End Device Aging Timeout period shorter than the check in frequency of Xiaomi devices, while the v2 hub does not. Also a seeming majority of ZigBee repeater-capable devices are incompatible with Xiaomi devices because of the End Device Aging Timeout period / no network rejoin issue.
Good sources of information:
Thank you very much for that detailed response. I may go pick up a v2 hub and give it a try. Appreciate it!
So i tested a bit further with the 1.3.1bā¦
I think there might be a small bug with this version and my WXKG03LM and a WXKG12LM iāve tried it on.
When i tap the button in the (Classic) app for this device, it shows a Held instead of a Pushed in the app.
I still canāt get the HOLD to work with the physical button, but now the IDE log show this when i press the button in the app:
[4ce011fe-a84b-4d84-9ffa-cae07dbdce4d](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#4ce011fe-a84b-4d84-9ffa-cae07dbdce4d) 18.57.28: debug Aqara Switch WXKG03LM: Setting Last Held to current date/time
[4ce011fe-a84b-4d84-9ffa-cae07dbdce4d](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#4ce011fe-a84b-4d84-9ffa-cae07dbdce4d) 18.57.28: info Aqara Switch WXKG03LM was held (Button 1 held)
[4ce011fe-a84b-4d84-9ffa-cae07dbdce4d](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#4ce011fe-a84b-4d84-9ffa-cae07dbdce4d) 18.57.28: info Aqara Switch WXKG03LM: Virtual App Button Pressed
[4ce011fe-a84b-4d84-9ffa-cae07dbdce4d](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#4ce011fe-a84b-4d84-9ffa-cae07dbdce4d) 18.57.28: debug Aqara Switch WXKG03LM: Setting Last Held to current date/time
[4ce011fe-a84b-4d84-9ffa-cae07dbdce4d](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#4ce011fe-a84b-4d84-9ffa-cae07dbdce4d) 18.57.28: info Aqara Switch WXKG03LM was held (Button 1 held)
[4ce011fe-a84b-4d84-9ffa-cae07dbdce4d](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#4ce011fe-a84b-4d84-9ffa-cae07dbdce4d) 18.57.28: info Aqara Switch WXKG03LM: Virtual App Button Pressed
It stays in HELD mode in the app until i press the physical button, and then shows this:
[4ce011fe-a84b-4d84-9ffa-cae07dbdce4d](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#4ce011fe-a84b-4d84-9ffa-cae07dbdce4d) 18.59.08: debug Aqara Switch WXKG03LM: Creating event [name:button, value:pushed, data:[buttonNumber:1], descriptionText:Aqara Switch WXKG03LM was pushed, isStateChange:true]
[4ce011fe-a84b-4d84-9ffa-cae07dbdce4d](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#4ce011fe-a84b-4d84-9ffa-cae07dbdce4d) 18.59.08: debug Aqara Switch WXKG03LM: Setting Last Pressed to current date/time
[4ce011fe-a84b-4d84-9ffa-cae07dbdce4d](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#4ce011fe-a84b-4d84-9ffa-cae07dbdce4d) 18.59.08: info Aqara Switch WXKG03LM was pushed (Button 1 pushed)
[4ce011fe-a84b-4d84-9ffa-cae07dbdce4d](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#4ce011fe-a84b-4d84-9ffa-cae07dbdce4d) 18.59.08: debug Aqara Switch WXKG03LM: Setting Last Pressed to current date/time
[4ce011fe-a84b-4d84-9ffa-cae07dbdce4d](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#4ce011fe-a84b-4d84-9ffa-cae07dbdce4d) 18.59.08: debug Aqara Switch WXKG03LM: Parsing 'on/off: 1'
[4ce011fe-a84b-4d84-9ffa-cae07dbdce4d](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#4ce011fe-a84b-4d84-9ffa-cae07dbdce4d) 18.59.08: debug Aqara Switch WXKG03LM: Parsing 'on/off: 1'
Thought that you maybe could use this info⦠
Hi everyone I just want to confirm xiaomi device working with Samsung connect pro without any issue since they release new firmware which is 22.52 Iām using xiaomi device with new firmware where since 4 days without dropping any connection and without disconnecting working perfectly fine without any problems I have more than 30 device which is leaks sensors open and close sensor motion sensor humidity sensor and push buttons since 4 days they all working fine Iām so happy because I have Samsung home connect pro since long time and I was waiting for new update







