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

Looks like you are right. It died shortly after

Hello, I am using this and I am very glad. Is it possible to view the Temperature and Humidity on a Samsung TV within Smartthings? Water leak Sensors and Door/window sensors are shown…

@orangebucket Is there a way to add your Github repository? When I try to add a new repository in Groovy IDE by using “orangebucke” ] and “Anidea-for-SmartThings”, the system brings up an error message that I don’t have access to the repro.

Did you leave the ‘t’ off the end of the username?
It should be fine, I do nothing to prevent it being used. I’m not actually sure I can.

I’ve recently removed all my ‘Xiaomi’ sensors, apart from about three buttons. They just get in the way of flexibly building a decent mesh.

I’m sorry. That was just a typo on my side. This is how I tried to add your repo:

Bildschirmfoto 2021-06-09 um 14.07.53

When I hit save, it brings up an error message:

Bildschirmfoto 2021-06-09 um 14.08.18

Oh I see, what a shame. I was really hoping somewhat could port the old code from B.Spranger over and make it compatible with the new ST app. I’ve got a couple those WXKG02LM and WXKG03LM switches that used to work fine with the B.Spranger code but can’t be properly assigned in the new app. Can I somehow help to get those 2018 revisions working again?


I’m also trying to get one of the new Aqara Zigbee 3.0 switches to work. They don’t seem to have the old issues with reliability and dropped connections anymore.



Well it looks correct to me, and that is how I just added the repo to another of my accounts.

I’ve seen that error mentioned a number of times on this forum over the last year or two. I think the usual solution is to disconnect the IDE from GitHub and reconnect it.

I just tried to test this. However, after disconnecting the GitHub connection in the IDE, I can’t find a way to enable it again. Should there be a link or button to “Enable GitHub Integration”?

There ought to be, though I’m not sure it made it to all shards. I think it is just a link to /githubAuth/step1so that should so just as well.

Ah, that did the trick, thanks. I’m now able to add the repo to my IDE.

Do you have any feedback whether one of your button DTHs also works with those Aqara single- and double-rockers pictured above? Or do they only apply to this actual “button”-device?

has anyone had any luck pairing an Aqara DJT11LM vibration sensor? mine keeps giving the single long blink which indicates paring failed. using a V3 hub on firmware 37.00004.

tried rebooting the hub, pulling the battery out of the sensor over night, tried the “keep pressing the button every second to keep it from going to sleep” but nothing seems to get it paired.

I have the DHT installed and published, and I was just able to pair a few temp/humidity sensors.

Any tips?

I have the same sensor with a V2 hub and i had a bit of trouble as well. I was getting that as well for a bit. What I did was get closer to the hub (i was within 2 feet) and hold the button down for ~3 seconds to get it in pairing. You should see 3 blinks. then i did the pressing button ever second or so. If you get the single blink, hold it down again for 3 seconds and then start over until you get the rapid 3 blinks rather than the single long one. Sometimes it takes a few tries to get it to pair. I also switched from trying to use my finger to a screwdriver or stick as it pressed the button better than my finger could since its a tad recessed. Keep trying until it pops up in Smartthings additional it could take up to a min or two for it to finally register.

Additionally I’ve been trying to get it to work with my washer/Dryer but can’t get the sensitivity to change. By default its set to low but both the Bspranger or the orangebucket DHT’s don’t seem to allow you to adjust the sensitivity and its set to Low by default. Let me know how you get on after you successfully got it paired.

I’ve never looked but I’d be surprised if they did. They are essentially stripped down ‘bspranger’ handlers and Zigbee side of things has been pretty much left alone.

@orangebucket Is there a way to change the sensitivity on the vibration sensor or set it to High as default?

I never did update the sensitivity handling to be compatible with the ‘new’ app, but legacy apps like webCoRE can call changesensitivity() to cycle through low, medium and high. Mind you I’ve absolutely no idea whether it actually works (see update below).

Looks like you can change the value line 89 from 0 to 2 and that might change the default sensitivity (you’d need to update the device in the IDE to force the installed() method to run again).

Update: I should clarify that I know that changesensitivity() cycles through the sensitivity settings fine, and that it is sending Zigbee commands to the device that purport to change the sensitivity. What I don’t know is if the sensitivity actually gets changed on the device.

Amazing! I did actually see line 89 but wasn’t sure what values to use. I set it to 2 and now the accelsensitivity is set to High. Now the real testing starts to see if the sensor actually senses the vibrations and reports it properly lol. Thanks @orangebucket !

Oh interesting, gonna give that a try thanks!

Any chance you might help me to adopt the old bspanger handlers for the wireless single- and double-rockers in a similar way?

Do you have some kind of before and after version so that I can maybe reconstruct which parts you had to chance to get the handlers working with the new app?

Well the ‘before’ versions are the ‘bspranger’ handlers.

Is the ‘bspranger’ handler really still the go to one for the WXKG02LM and WXKG03LM? I keep seeing discussions about handlers for similar looking Aqara switches but I guess they might be the Zigbee 3.0 ones. What is the deal? Are they basically working with legacy apps like Smart Lighting and webCoRE but just showing up as a single button in the mobile app and Automations?

That’s right. They used to work fine, but just don’t surface the buttons and different press patterns (single, double, held) in the new app.

At least to my knowledge. Couldn’t find any newer code for the single and double-rocker switches.

I actually got a couple of those new Zigbee 3.0 wireless switches (basically the successor to the WXKG02LM) at hand. But I wasn’t able to bind them to the hub. They instead seem to establish a direct link with all of my Zigbee lights and plugs instead.

Yes, in legacy apps the button capability only had the concept of pushed or held for a button. The de facto standard, and one used in stock handlers as well as by community handlers, was to add a buttonNumber to the event data to identify the particular button on a multiple button device, or to represent multiple clicks on a single button device. The new app doesn’t stand for that nonsense. It expects each button on a multiple button device to be a component button, and there are shed loads of values for button attributes now. Smart Lighting is OK with that because it can see the component devices and understands the full range of attribute values, and webCoRE will cope.

If you wanted a quick fudge, rather than getting into child devices, you could slightly abuse the capability attribute values. Instead of the current arrangement, which seems be to use button numbers 1, 2 and 3 with the pushed and held values events on the left, right and both buttons, and then to represent double clicks with the pushed value on buttons 4 and 5, you could munge the button events so that, for example:

pushed on buttonNumber 1 becomes up
held   on buttonNumber 1 becomes up_hold
pushed on buttonNumber 2 becomes down
held   on buttonNumber 2 becomes down_hold
pushed on buttonNumber 3 becomes pushed
held   on buttonNumber 3 becomes held
pushed on buttonNumber 4 becomes up_2x
pushed on buttonNumber 5 becomes down_2x

Oh and if you did want to code that, assuming I picked the correct DTH, replace lines 245-251 with something like:

    def attributemap = [ pushed: [ '', 'up', 'down', 'pushed', 'up_2x', 'down_2x' ],
                         held: [ '', 'up_hold', 'down_hold', 'held', 'up_hold', 'down_hold' ] ]
	return [
		name: 'button',
		value: attributemap[ eventType ][ buttonNum ],
        descriptionText: descText,
		isStateChange: true

I don’t think it will screw up anything else going on in the DTH, but there is a lot of extra fluff in there so who knows?