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


Just remember the battery eventually needs replacing. Not a job I’d want!

How did you get it working with webcore? It asks you for a button number. I didn’t select any. Cannot get it to work but see the toggles on the live logger.

Is the Aqara button working? I can’t get it to fire a webcore piston on a button press event. It seems that it only sends released anyways, so will it not work as is with webcore?

I am not sure what you want, but I use my button like this.
East Side’s temperature was less than 16°F for less than 25 minutes

  • add a new condition
    Bedroom Button
  • add a new task
    end with;
    end execute;

Recent UPDATES to all Xiaomi Device Handlers in the bspranger/Xiaomi GitHub repository:

  • Battery Changed date reset has been moved to the settings page
    Flip the toggle, press “Save” and the date displayed for Battery Changed will update to the current date. This is helpful for tracking how long your batteries last before they need to be replaced. Thanks to @tmleafs for implementing this change.

  • 24 hour clock option added in the settings page
    User @cscheiene requested this, and after checking I found that SmartThings does not provide a global setting to display any time stamps in 12 or 24 hour clock format. So I’ve added this feature.

Example screenshots:

(Click the gear icon to access the setting page)

Many thanks again to @ArstenA for hosting the device handler repository and for all his support!


Should we try to get the magic cube added to the Xiaomi DHs?

1 Like

Can. I have a Mi Cube, have looked through the DH code, and don’t see much in the way of need for changes / improvements.

I haven’t really put it into major use, but have tried to figure out what fingerprint would get it to pair without the need for the catchall method. Unlike with my other Xiaomi devices, I have not been able to pair my cube with a fingerprint, and it never even shows up as a generic Thing.

I’m just looking for a simple button press, and I can’t even accomplish that for some reason. I have the aqara button. Maybe it’s because it doesn’t register button press, but only release.

I don’t use WebCoRE yet, but isn’t this is just a case of what word is used when the button is pushed.

I think the device handler had to use a “released” event when in Momentary mode, because otherwise, the mobile app would just show “pushed” and stay stuck that way. But in Momentary mode, it also produces a “pushed” event first, and then “released”. Are you not seeing the “pushed” event?

Also, couldn’t you change the piston to say if Keypad 1's button #1 gets released?

Just so everyone understands the limitations of these Xiaomi buttons on SmartThings:

Although the button device itself may send different messages on button push and button release, all we have to work with that SmartThings passes on to the device handler is a message that says “On/Off: 1” when you push the button. This is because the SmartThings ZigBee event parser removes the data that we could use to know when the button is pushed vs released. There’s nothing we can do about that, and if you want that feature, then send an email to ST support asking them to add endpoint data to the ZigBee event description parser. That would help for a lot more devices than just the Xiaomi Buttons.

So, again, all we get is “On/Off: 1” when the button is pushed. Then the device handler has to announce that as a SmartThings event so that it is recognized by SmartApps. In this case, the device handler now has two modes: Momentary, and Toggle. If it’s set to Momentary in the settings, then a button push produces a “pushed” event, with a delay (that you can set in the settings), followed by a “released” event.

This means if you’re using Momentary mode, whatever SmartApp you’re using to make things happen should be able to take action on a “pushed” or “released” event. The timing would depend on which one you use, and what delay you’ve set.

If you use Toggle mode, then the event for the button in SmartThings alternates between “pushed” and “released” every time you push the button. In that case, your SmartApp would have to be able to take different actions based on whether it sees a “pushed” or “released” event from your button.

If that isn’t going to work for WebCoRE or other SmartApps, then @ArstenA and us others helping to improve the device handlers will have to work out a different method for the device handler to provide a different labeled event, but also still have the same functionality (e.g., the virtual button tile). However, as far as I can tell, with the option of Momentary or Toggle modes, most people should be able to make use of the Xiaomi button.

So is the Smartthings Link still not working properly with these Xiaomi sensors? I finally tried my Link hub (firmware 17.00113, ZigBee 2.2.22) and can’t get the sensors to stay active past 1hour. Changed 2.4Ghz wifi channel away from ZigBee channel, and I don’t have any other ZigBee devices. Xiaomi sensors were placed 1 ft away from Link hub

It never worked for me. I gave up and bought a v2 hub. You’re on the same firmware I had on my ST Link, so it hasn’t been updated, while the hub has seen 4-5 updates since December.

With my v2 hub, I have had zero problems pairing and keeping connections to 8 Xiaomi “original” & Aqara door/window sensors, 1 Aqara leak sensor, 1 Aqara Motion Detector, 1 Aqaba Temp/humidity sensor, and a Xiaomi Mi Cube.


Can we ad the Xiaomi Aqara square switch ?

I have posted some of my experience in this thread. You can find it here. This gist was the ST Link works with official devices just fine, but I, along with others, have the same problem of keeping a connection with Xiaomi and Aqara devices. I borrowed an actual v2 hub and had no more issues.
So the Link is nice but does function in the exact same was as the hub does, which is a shame.

I just received one of these yesterday in the mail.

Unfortunately, due to the limitation I explained a few posts up, SmartThings does not provide the information we need to know which button is pressed.

If I press the left button, the right button, or both buttons, the exact same event is sent to the device handler: “on/off: 1”.

So, if you’ve already bought one, I’m sorry to say that for right now, it can only act as one button with SmartThings. You can use the Aqara Button device handler for that purpose. Also note: it doesn’t pair easily, and the catchall method has to be used.

Again, I encourage people to email SmartThings support to ask that ZigBee endpoint information is passed on by the SmartThings event parser. That will open up some possibilities in getting Xiaomi devices to play better with SmartThings.

EDIT: The switch I was referring to is actually the WXKG02LM, which is the wall-surface-mounted ZigBee 2-button switch, not the mains-powered 2-button switch (WXKG03LM). I was confused by the link to the WXKG02LM on GearBest in your post. My apologies for the confusion.

I don’t have the mains powered switch, but the Aqara button device handler definitely won’t work with it, because it’s a different type of device (can receive control commands in addition to sending control commands). To create a device driver for it, someone would need to have one to do a good amount of testing. I’m sorry to say since I’m in the US with 110-120V/60Hz power, I have no plans to buy one of these mains-powered switches.

Thanks @veeceeoh and @rottentinkerton…looks like I’m going to need to find a v2 hub if I want the Xiaomi sensors to work. Atleast I only spent $15 on the Link, and should be able to sell it fairly easy as they can’t be bought directly in canada from what I remember

Is there a way so that I can use the button with both single and dubble click?

But it does work. And a single switch option would be fine.

Can we still get a handler added to this git hub so we have them all in one place.

At this time, there’s no need to add a new handler for the WXKG03LM (sorry - meant the WXKG02LM) Aqara wall-mounted two-button switch.

Just use the already existing Aqara Button device handler. It works fine with my WXKG03LM WXKG02LM, and even reads the battery correctly.

In future, if things change with how SmartThings parses events on ZigBee devices so that we have access to the different button press events, you can be sure that I will update the handler to work with that (since I really want to make use of both buttons on my switch!)

If you have any troubles with pairing, let me know, and I can walk you through it.

EDIT: The switch I was referring to is actually the WXKG02LM, which is the wall-surface-mounted ZigBee 2-button switch, not the mains-powered 2-button switch (WXKG03LM). I was confused by the link to the WXKG02LM on GearBest in your post. My apologies for the confusion.

I’d like to get some feedback from any users of both kinds of Xiaomi Temperature & Humidity sensors.

I’ve done some fairly major reworking of the code for the device handler, and changed the method for parsing temperature and humidity reports to the one that is used by SmartThings’ officially published device handlers.

However, that official method supplies the temperature (in C or F) as an integer, so without tenths of a degree in the reading. Instead of 34.7 C you’ll see 35, for example.

I have checked Xiaomi’s specifications for the temperature accuracy, and they claim it is + / - 0.3 degrees Celcius, which is a 0.6 degree spread and not extremely accurate.

However, I know some people may still like to see tenths of a degree displayed, so here’s a poll, please choose your preference.

  • Display temperature as an integer
  • Display temperature with tenths of a degree
  • Add a setting to choose display as integer or with tenths of a degree

0 voters

After we’ve heard from a fair number of people, then we’ll know how to proceed.

Mine is the wired with neutral.

But yeah gues we wait in ST to sort stuff. Anyone requested it???