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

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) and lastHeldCoRE (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:

Thanks for explaining, I’ll give this a go.

Not really sure what this means. Do I need to enable the logging first?
I held the button first, followed by a single push a short time after. Does this help?


Looks like I have two versions of this switch. The first shown here is for the logs above.
image

image

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

3 Likes

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
7 Likes

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:

IMG_4458

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:

1 Like

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… :slight_smile:

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

But please make sure use DH by bspranger

That’s great news - thanks for reporting it!



Just to be clear, you are talking about the “virtual button” in the SmartThings Classic App user interface for your buttons, right? If yes, I have fixed that in a new beta release (see below).

However, because you have the original revision of the 1-button model WXKG03LM Aqara Wireless Remote Switch which reports the ZigBee product ID lumi.sensor_86sw1, it does not support double-click or hold in the hardware. Only the new revision that reports the ZigBee product ID lumi.remote.b186acn01 supports single/double-click and hold.



Information about new revisions of Aqara Wireless Remote Switches

As identified in my chart of Xiaomi’s ZigBee devices a few posts above, there are new 2018 revisions of the Aqara Wireless Remote Switches. After some research, I have found out the following information:

The new revisions of the Aqara Wireless Remote Switches (1-button model WXKG03LM and 2- button model WXKG02LM) are known as the “international version” and are designed to work with Xiaomi’s Aqara’s new Apple HomeKit bridge-capable hub.

The boxes of the new revision ZigBee button devices will have CE and RoHS logos, and the EAN-13 code for the new model WXKG02LM is 6 970504 210516 (while the previous revision’s code was 6 970504 210049.) However, once removed from their boxes, the only way to identify whether you are using the old 2016 or new 2018 revision is by looking at the ZigBee product ID, which is listed as “model” in the device details page of a successfully paired device in your SmartThings IDE, like this:

ee88093a4299dc05d820279868b8df410c6e01c2

The new revision of the 1-button model is identified with lumi.remote.b186acn01 and the new 2-button model as lumi.remote.b286acn01. Both of them now support single-click, double-click, and hold in hardware; however, the 2-button model is still only recognized as one button due to the limitation in SmartThings of not recognizing ZigBee messages from different endpoints.

One of my sources of information on these new revisions of the Aqara Wireless Remote Switches claims that they can be purchased from this seller on AliExpress - however, there is no guarantee you won’t receive one of the older revision models.



[BETA] Xiaomi Aqara Button SmartThings DTH v1.3.5b

This release adds untested support for the new revision of the 2-button Aqara Wireless Smart Wall Switch model WXKG02LM, which has single/double-click and hold support. It also fixes the issue reported by @AnubizDK with the “virtual button” that can be used in the SmartThings “Classic” mobile app UI for the button.

The updated DTH code can be copied directly from here.

Changes:

  • pressing the virtual app button now correctly creates a button 1 - pressed event
  • added a check for unknown button model in init() which result in numberOfButtons being set to 3 to accommodate all possible button types.
  • edited compatibility notes in header section of DTH for clarity
  • added fingerprints for new revisions of models WXKG03LM (ZigBee model lumi.remote.b186acn01) and WXKG02LM (ZigBee product ID lumi.remote.b286acn01)
  • added UNTESTED support for new revision of 2-button Aqara Wireless Remote Switch WXKG03LM (product ID lumi.remote.b286acn01) with single-press, double-press, and hold functions, although both buttons are only recognized as one button due to a limitation in SmartThings
  • edited code comments for clarity on functions of different models

Isn’t it technically’s Lumi’s AQara Homekit bridge? The Xiaomi Mi platform doesn’t have a Homekit compatible hub AFAIK.

I have always been of the understanding that Aqara is just one of many of Xiaomi’s sub-brands.

Either way, it is an Aqara-branded hub that acts as a HomeKit bridge, though apparently it can be added in the Xiaomi Mi Home app, and some older Xiaomi Mi (and older Aqara) devices can be added to it. Some more useful information can be found here: