[OBSOLETE] Original Xiaomi Aqara Smart Wireless Switch (Aqara Button)

Usually I have to add Xiaomi devices once leave them connected for over an hour and they stop responding like you are seeing then remove it from the system and re-add them, they usually stay connected after that.

The button I have doesn’t respond to a physical button push anymore however it does respond when I ‘press’ it in the app. Does that still mean it’s dropped off as such? Or is there something else going on? That’s the second time it’s done this now. And it’s the second time my motion sensor has dropped off.

I’ve also changed my WiFi channel of the router to be as far away as possible from my Zigbee channel.

It sounds like they are both disconnected from ST. Xiaomi devices don’t conform strictly to the standards so ST will likely never support them on their own and I wouldn’t expect them to be as reliable as all the other zigbee devices although maybe try replacing your battery.

I just managed to pair the WXKG11LM type button - but it only shows up as “thing” and “unknown” so it does not work. I have used this DH: https://github.com/bspranger/Xiaomi. Is there another DH to use or does anyone know what could be wrong? Thanks for any advice

Try the DH at the top of this page, you’d want to unpair and repair it or just assign it via the IDE.

There is a new revision of the WXKG11LM Aqara Button, and I have published a new beta device handler which adds support for it. You may have one of the new WXKG11LM buttons, so you should try this beta DH.

The download link is different from the current release version. Please see my post here for more information and the beta DH download link:

1 Like

Thank you. But still no luck here. Shows up as thing. But I have ordered the “12” version and hope that will work better. Also the button states it have will make it very flexible and the cost is low.

Did you try logging into the IDE and change the device type of the newly paired device to use the custom device handler?

Super! Working now - thanks a lot!

1 Like

Cannot get it to work then you post 4 gearbest links. Really?

[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


Uhmm got it to add the button as a thing, battery is showing, got the automation set up with smart light, everything works from the classic app but nothing happens if i press the button :frowning: no change of status in the app, nothing… am i missing something? my smartthings samsung button works like a charm


Xiaomi devices are close to conforming to the zigbee standards that they connect and work after a bit of playing but aren’t strictly following the standard so there are some issues with them. I’ve always added mine then an hour later the device would drop and I would reset it and join it again and they would then stay connected. The best way to see what the issue is is to check the logs of the device when you push the button to see if the logs even reflect the push if not then reset the button and rejoin it or if it had been working for weeks or more and suddenly stopped then just try replacing the battery.

Thanks, where can i see the logs of the device?

On the My Home Tab choose the device then choose the Recently tab at the top of the device screen. Or go to live logging in the IDE.

Xiaomi / Aqara devices require the use of a custom device handler (also known as “DH” or “DTH”). Basically think of it as a device driver.

My post right before yours links to post in another thread dedicated to Xiaomi / Aqara devices that is a recent update of device handlers for a number of different Xiaomi / Aqara button models.

You will need to log into what’s known as the SmartThings Groovy IDE. Click on the Locations tab, choose your locations, and then click the My Device Handlers tab where you can add the corresponding custom device handler for your button. This is done by creating a new device handler, copy-pasting the code, and clicking the [create] button at the bottom of the web page. The code to copy from will be found in the corresponding link of the post I mention above.

Then since you’ve already added the button and it’s showing up as a “Thing” (meaning no device handler has been assigned), you need to assign the correct device handler to it. This is also done while logged into the SmartThings Groovy IDE, in the My Devices tab. Find the button, click on its name to view its details, scroll down and click [Edit], and in the pop-up menu next to Type: (which refers to “Device Type”, the name given in each device handler), find the correct device name, for example “Xiaomi Aqara Button”, which will be down near the bottom of the list because that’s where custom device types are found. Then save, and you can start using the button in the “classic” mobile app (Xiaomi / Aqara devices aren’t fully supported in the new Samsung Connect mobile app).


Thanks Veeceeoh! I already used the code to create the DTH before adding the button through the classic app. Just checked into the IDE and the button already has the type Xiaomi Zigbee Aqara Button AQ2 maybe I don’t have the right DTH code?

Just saw your new code, added it to my handler and assigne it to the button, i’ll test it tonight when . i’m back home

thanks a lot

HI, thanks, I removed the old one and the device handler, added your code for my model WXKG11LM. Classic app found it right away. Went to change the type. But it always shows in Released… even when i press the button :frowning: Any idea?


The display of the button status is a kind of “hack” that I came up with to make the UI for the button device handlers more useful. As such, due to the nature of SmartThings executing code “in the cloud”, the display of the button status may be slow or not display at all. However, the actually button 1 pushed event will always work (unless ST is down, which does happen).

So… you should double-check whether a pushed event occurs by looking at the Recently tab for the button while viewing it in the ST “Classic” app.

If you don’t see the correct events occurring there, then I can help with live logging output. You’d want to enable the display of “info” and “debug” log messages in the preference settings for the button (by clicking the gear icon while viewing the button in the ST “Classic” app). The Live Logging settings toggles are at the bottom, so scroll down:

After pressing [save] then open up the SmartThings Groovy IDE for your hub and change to the Live Logging tab so that log messages can be viewed while pressing / holding / etc. the button. That’s what I’d need to see if events aren’t occurring.