[OBSOLETE] Xiaomi Sensors and Button (beta)

You only install the custom DTH once. When you pair the switch you can go in to the IDE and edit the new device and point it to the correct driver that you installed on the very first plug.
Sounds like the new ones just aren’t pairing automatically. You may be in the “Catchall” realm to get these guys online.

I have the Buttons but unfortunately they don’t work right. You have to hit it first to turn it on then again to activate unless you had used them recently then they stay on a while and only have to hit it once. Can this be right? Yes it is the Xiaomi standard button.

[UPDATE] “Original” Xiaomi Button DTH v1.3

(For Xiaomi’s round button, model WXKG01LM)

This release adds support for previously hidden functionality that is being “revealed” with firmware version 0.25.20. Because firmware 25.20 (which is being deployed starting March 6 2019) is required, this new DTH should only be used by SmartThings Hub v2 and v3 users.

[UPDATE] Aqara Button DTH v1.4b BETA

(For models WXKG11LM (original / new revisions) and WXKG12LM

This release fixes “broken” functionality for the original revision of Aqara Button model WXKG11LM due to a change in firmware version 0.25.20 (which is being deployed starting March 6 2019). However, this new DTH also adds multi-click functionality for the same Aqara Button model, which was not available in previous firmware versions.

NOTE: These updated DTHs only work with Firmware 25.20 or newer, which is currently only available for SmartThings v2 or v3 Hubs.

Please see this post for details and links to the updated DTH code.

1 Like

[RELEASE] Aqara Wireless Smart Light Switch DTH v0.9b BETA

For 2016 & 2018 revisions of the 2-button WXKG02LM and 1-button WXKG03LM

This new device handler (DTH) was split off from the “old” Aqara Button DTH in order to best support the two revisions of the one and two-button Aqara Wireless Smart Light Switches. The code has been written so that this device handler can be used with any firmware version, but for users with hub running on Firmware 25.20 or newer, all three actions of the older 2016 revision two-button model WXKG02LM are now recognized: left, right, and both button(s) pushed.

Please see this post for full details about this new device handler in addition to the other two updates announced in the above post, along with the link to the DTH code.


I just realized that the battery died in two of my temp/humidity sensors. I didn’t know because they still showed a status of ACTIVE in the IDE. Is there any way to fix that? If they would have gone OFFLINE, my piston would have alerted me.

1 Like

In the over 1.5 years I’ve been using Xiaomi / Aqara devices I’ve never had the batteries die, but I can confirm that their Status can be marked as “OFFLINE”, even with SmartThings’ Device Health feature turned off:

I have read reports of Device Health being unreliable, so I have it turned off.

Really the best way to know whether a Xiaomi / Aqara device has gone offline for any reason is to look at the time of the most recent battery percentage report.

All battery-powered Xiaomi / Aqara ZigBee devices check in with the hub every 50-60 minutes and send a battery voltage report at the same time. So I would suggest setting up a piston with logic that sends an alert if no battery percentage event has been generated by the device in over 2 or 3 hours.

If having trouble setting up a piston with that kind of logic, there is also a very nice customizable SmartApp which can send notifications based on time since the last XXXX event, or battery level, or temperature:

EDIT: It would be really helpful if you could check the events lists for the final battery voltages / percentages just before those sensor’s batteries died, and share those values.

Yeah, the problem is that these devices apparently don’t go OFFLINE in the IDE even if they haven’t communicated in over a month. I assumed that would be a good value to watch for device issues, and it seems it is - except for these. Of course, I can create a new piston to just watch the value of my Xiaomi devices, I was hoping that kind of device specific piston wouldn’t be required.

I’ll take a look at Simple Device Viewer, but man would I prefer to have all my automations in Webcore.

And finally, as far as battery percentages go, they seem to vary pretty wildly. I’m about 90% sure that one of them last checked in with 80% before dying.

1 Like

@veeceeoh I am hoping that you can help me figure out what the problem is with my aqara WXKG11LM buttons.

I was happily using my aqara buttons to open and close my gate and garage door until they stopped working a few days ago. When I pressed the buttons, there is no event button being pushed when I checked the events log. However, I do see the lastcheckin and lastcheckinCore events as shown below. Any idea?

Aqara Button WXKG11LM last checkin is Sun Mar 31 2019 5:19:08 PM
Aqara Button WXKG11LM last checkin co re is 1554027548374

The V2 firmware was recently updated. You will need to update your DTH with this one.

1 Like

@TylerDurden it works! Thank you very much.

Yes, there were changes in the latest firmware, and I updated all the Xiaomi / Aqara button device handlers:

[ANNOUNCEMENT] All Xiaomi / Aqara wireless button users

Hub Firmware 25.26 has been released for SmartThings v2 & v3 Hubs

The new firmware includes changes that “break” some functionality in the previous device handlers, but also allows for much improved functionality.

In order to fix the issues and add improved functionality, I have updated all Xiaomi / Aqara Button device handlers (DTHs). All SmartThings v2 & v3 Hub users are encouraged update to the newest DTHs immediately.

Please see this post for all details and links to the updated DTHs.

The code of these updated and improved device handlers is open source and free.
But if it has helped you, a coffee / beer donation is always very much appreciated!
PayPal: 37544ab59e07a5c90719f07501453cae3ed7b043 Venmo: @KeithPG


Hi everyone

stupid question. i have the original button and have updated my handler. it now registers single, double triple etc. however cant seem to get it to work in core / how to pick up the different presses in smartthings. pleases can someone let me know the right ‘instructions’ / app to use to take advantage of the now 5 options?

thank you

My smart lighting app doesn’t seem to give me those options…

Hi Davey, please disregard my response. My wires got crossed and I thought I was responding to a question about double tapping on a GE Jasco switch. Sorry about that.

I have a question. The readings from the temperature,humidity sensor are visible in the new version of the application?

Any exams of how to use in core please? Struggling to get it to recognise the different taps.

Thank you

Yes they are.

1 Like

Here is an example of how I use the humidity reading and some logic to set a variable that dictates whether the fan should come on in my bathroom.

Thank you :slight_smile:

Anything in single, double, triple presses etc? Can’t get it to recognise however in smartthings it shows these actions…