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

The only log solution I ever found was looking for ''zbjoins" in the log. Incredibly tedious and in the end ineffective. You’ll love looking at it with XCTU.

[BETA UPDATE] Xiaomi Aqara Vibration Sensor (Model DJR11LM) SmartThings DTH v0.91b

It turns out I forgot to include an important line of code to correctly initialize the sensitivity level to low when the sensor is paired which results in that UI tile displaying “–” and not changing the level when pressed. This is now fixed, and all users are highly recommended to update to this new DTH code.

The new DTH code can be grabbed from here.


  • UI Refresh code now correctly initializes and displays the sensitivity level at low when the sensor is paired, or if not initialized at pairing, when the user saves preferences or presses the refresh UI tile button
  • Added initialization of a “blank” battery UI tile at pairing (or when preferences are saved / refresh UI tile button is pressed). Like with all Xiaomi devices, the battery tile will only display a percentage after the first battery voltage report is sent by the sensor, usually 1 or 2 hours after pairing.

No, there is not. In my experience with these vibration sensors, a lot of patience is required.

Here’s what you should try doing:

  1. Update the DTH code with my new version (see above link)
  2. Do not manually add the sensor in IDE - make sure to use the “Add a Thing” method in the SmartThings Classic mobile app.
  3. Once the mobile app is in “Add a Thing” mode, press and hold the reset/pairing button on the vibration sensor. The LED will stay on, and then when it blinks a couple times, release the reset/button.
  4. Watch for the LED to blink again. One long flash means pairing was unsuccessful, and a series of short flashes means successful pairing.
  5. Either way - successful or not - you need to short press the reset/pairing button, wait for the LED to flash after that (open long or multiple short flashes), and then short press again, etc.
  6. After you’ve seen the multiple short flashes in response and continued to short-press the reset/pairing button, it could take up to a minute or even more for the sensor to finally appear in the SmartThings mobile app ready to rename.

If this doesn’t make sense, I can take a video of the process tonight and then upload it to YouTube. What I’ve described above is actually the same for most Xiaomi Zigbee-based devices - just that these vibration sensors seem to take a little longer to complete the pairing process.

1 Like

Thank you…wow its VERY fussy…I have one of 4 successfully paired ! patience it seems is the key !

Bill P

1 Like

Glad to hear it! Please let me know how the DTH works out for you - any feedback is greatly appreciated.

I just had 10 or so drop today - I was running an XCTU scan and noticed the hub only had 20 devices connected (which is never the case - it usually hovers in the high 20s- and there you go… most (so far) have repaired with just a click or two - either to hub or to an XBEE (I’m up to 4 as of today). One was a total reset and redo - it’s been so long since I’ve had to do it. One paired to a SmartThings plug - I’ll let it go-offline and then repair close to an XBEE. Thanks for the heads up.


I am new to the community and hoping this is the place to post. Before I get started with the issue tought I’d list the tech.

Smarthub V3 (US edition)
2 x Xiaomi Aqara Temperature Humidity Sensor
Androind Smartthings App latest version

Right so on to the issue. I added the correct device handler and after a night of mucking around got the 2 sensors finally installed by forcing the hub to look for a diffferent sensor - no probs there and the data being reported back to the hub is correct.

However, when it comes to clicking on the device in the app all I get is “Cannot connect to device. Check device and try again.”

I know from watching logs that the sensors are working like a charm in terms of reporting and according the IDE are connected to the hub, hwoever the one difference I have seen is that “Execution Location” is set to cloud. Dont know if that matters.

Being no stranger to code I pulled up a sample of the Phillips hue bulbs and compared it to the installed device handler for Xiaomi and for the most part there are only small differences.

So anyone know what I am missing in terms of having the app read the devices data ?

Thanks in advance.

[BETA UPDATE] Xiaomi Aqara Vibration Sensor (Model DJR11LM) SmartThings DTH v0.92b

After some testing, I have found that initializing the battery percentage UI to display “–” causes a newly paired sensor to not appear in the SmartThings classic mobile app’s device list. So I have removed that feature. It’s unfortunate, because many users have posted about their confusion over no battery percentage being displayed when a Xiaomi device is first paired. This is because the first battery voltage report is sent 1-2 hours after the device is paired.

The new DTH code can be grabbed from here .


  • Removed initialization of battery UI tile

Welcome to the SmartThings community!

First off - are you using the “SmartThings Classic” app or the new app (just called “SmartThings”)?

The new SmartThings app does not yet officially support custom DTHs (device handlers) like all the ones for Xiaomi devices. So if you are using the new SmartThings app, in terms of operability, YMMV. From what I’ve read, it should be possible to install and use the “Classic” app alongside the new one, in the interim. I would search on the forums for more information, however.

If you are using the “Classic” app and getting that error, then I honestly don’t have any idea why that would be happening.

Only SmartThings officially supported devices can have device handlers with local execution, so what you’re seeing is totally normal. This may or may not change in future as SmartThings continues their transition to a new developer platform.

First off - are you using the “SmartThings Classic” app or the new app (just called “SmartThings”)?

Right that was what I was thinking - Currently using the "SmartThings (not classic) so I guess that explains that problem - on the plus side it does show up in the app - maybe I will fork the DTH and see if I can’t build it in based on other examples in the IDE.

Will also look into running the apps side by side as Im finding the newer appy really buggy in terms of setting automations based on sunrise and sunset.


This works - thanks !

1 Like

Sadly my success was short lived…my one paired sensor out of 4 has dropped off the network already …app reports “this device is unavailable” and I still cant pair the other 3 …So I guess I will have to try to re-pair the one that worked again …
this really is a laborious process compared to other things I have added …! :slight_smile:

Bill P

Thanks for this, I was wondering why my freshly paired Vibration Sensor was showing in the IDE fine but not in the Smart Things Classic application but would appear if I changed the assigned device type. It’s now appearing in the Classic app and will leave it next to the hub for 24 hours or so before moving it.

Sadly I also have issues adding the sensors. I tried it with a button, Temperature- and Door-Sensor.
I have a V3 (24.11) and use the Classic app. I copied the bspranger-DH.
But i can´t even see the catch all entry in the event log.
Tried it a dozen of times.

Any ideas?

Update: I was able to add the Temperature- and Door-Sensors. But the Buttons are not recognized as a button. They are just set as “Thing”.

What do you see in that paired sensor in the Device List page of your IDE - “OFFLINE”?

If yes, then I have to ask: Are you using something other than a v2 SmartThings hub (ie., a new v3 hub, NVIDIA Shield TV Link for SmartThings, etc)? I know for a fact that Xiaomi devices won’t stay connected to a Shield TV Link, and the jury is still out with regards to the new v3 hub.)

Also, are you using any Zigbee-based devices that are mains-powered (plugged into the wall, and not battery-powered)? If you do, that would possibly explain why your one paired sensor dropped it’s connections as well as why the others are giving you so much difficulty pairing.

That is just the way these Xiaomi sensor can be. They behave in a few non-standard ways where the Zigbee protocol is concerned and this leads to various issues for some users.

My apologies - I should have tested that new feature more thoroughly. Glad it’s working correctly now.

I’m afraid that your issues may be related to the new v3 hub. I haven’t read enough reports by people trying to use Xiaomi devices with it to be sure, though.

Another possibility - same question I asked @wakevortex: Also, are you using any Zigbee-based devices that are mains-powered (plugged into the wall, and not battery-powered)?

I recently purchased three of these temperature/humidity sensors (the new square ones). I paired one through a mains powered router, and sure enough after a day it dropped out. I then deleted and re-paired it directly through the hub. I left the device near the hub for a couple of days, and it worked like a champ. I then moved it back to the original location where it is connected via a router. Within an hour it dropped back out.

I’ve read the messages about not pairing through a router, but after doing so should I expect to be able to move it to a router-served location, or will these only ever stay connected if in proximity to the hub?

My hub is a V2 (UK)
The status of the sensor in IDE is indeed OFFLINE
As to mains powered, I have 2 aeotec 6 multi sensors which are kinda mains (USB powered connected to a mains adaptor so they report continuously)
Apart from that nothing else mains powered except a HUE Hub

all very frustrating !

thanks for the help though

Bill P

Xiaomi sensors also have issues with routers even after pairing. It’s just a side effect of them being non-standard. Frankly, we are lucky they work at all! It’s only the fact they look nice and are so darn cheap that we persevere.

If you search there is a list of which repeaters work/not work with the Xiaomi sensors.

I have a Xiaomi Aqara door/window sensor too far away from the hub (building with steel reinforced).

On the “boundary” of the ST signal I installed an Ikea Tradfri bulb as a repeater. Then the Xiaomi Aqara remain paired.

Sometimes the Tradfri bulb looses connection, the Aqara sensor also drops off. The Tradfri bulb needs to be a little closer to the ST to be connected reliable.

The Ikea bulbs are cheap (GU10 model). I leave the bulb connected to the mains, but with 0% brightness, only working as a repeater.

Grtn Ben

I have a “Xiaomi Aqara Motion Sensor”

Can’t find the proper DTH that shows luminance.

Motion is detected, but lux not.

Anybody knows which DTH to install?

Grtn Ben

I may be misinformed, but my understanding is that the Aqara Motion Sensor is model RTCGQ11LM, with the RTCGQ01LM being the earlier model sometimes branded as the ‘Mijia’ and I don’t think that actually has a luminance sensor.

Tnx for the update. My Chinese is not that good, but I see this logo underneath the motion sensor:


I stop trying to fix the luminance value.

Grtn Ben