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

(Randy Thomas) #849

Thank you for the quick reply. By “ugly” I mean not the same as the screenshots I see here that include temp, humidity, and battery life. Here is what I see:

Clicking on the gear icon gives me no way to edit anything:

(edit: won’t let me attach more than one image, so please see here):

Again, I have not installed any device handler / custom anything. I managed to get the samsung ST app to recognize one of my two temp/humidity sensors, but if I understand correctly, there is a way to create a custom device handler.

So that’s my question – how to install this downloadable custom device handler (and/or should I)? I did so for my Dome water sensors and water shutoff valve, but I followed some specific instructions to do so that I can’t find again or convert to work for these temp/humidity sensors because I am dumb.

Also, I have two of these “new” square aqara temp/humidity sensors and I have no idea how I managed to get one to link but the other won’t. I got the triple LED flash initially, and the double flash happens every time I press the button on the device (as described in the guide), but it just shows up as “tile missing” or not at all. I’ve added and deleted the 2nd device repeatedly, but no luck in getting it to actually sense/report anything.

Also, the first sensor, which seems to be paired OK, updates quite irregularly. It was updating every 10 minutes or so until about 6am today (~15 hours ago) and hasn’t updated since:

My final question, for anyone: is there a temp and humidity sensor that “just works” with ST hub v2? Regardless of cost. I’m sick of the hoop-jumping required to get these things to work (also they are woefully inaccurate.)

Thanks for any help.

(Toranja) #850

Hi vwwxwwoh.

Did this work for you?
I’ve placed a humidity offset but it doesn’t work… placing 10, -10, 20 or anything else is just the same…

Best Regards

(Keith G) #851

Without installing a custom device handler (also known as “DTH” or “DH”), messages from Xiaomi devices may or may not be interpreted correctly, which means you’re missing out on either partial or complete functionality, and correct display for the device in the SmartThings Classic mobile app.

There’s a very thorough FAQ on installing custom Device Handler or Smart App code here:

In a nutshell, you need to

  1. copy the text of the code for the Aqara Temp/Humidity Sensor DTH from here
  2. Create a new Device Handler in the IDE for your ST hub and choose the “From code” option
  3. Paste in that code you copied in step 1
  4. Click Create, and then Publish

After that, when pairing your sensor, your SmartThings hub will use “fingerprint” information contained in the DTH to match up and assign the custom DTH to your Aqara Temp/Humidity sensor. If for some reason that doesn’t happen, the custom DTH can also be manually assigned (discussed repeatedly in this forum thread.)

This is completely normal behavior for the Xiaomi sensors. To conserve battery, they only report temperature / humidity when either has changed beyond a minimum threshold, rather than reporting every X minutes.

There are loads of great smart devices which require the “hoop-jumping” of installing custom DTHs or Smart Apps to work properly or work well with SmartThings, so it’s a shame to miss out on all of that. But I can understand wanting the achieve the promise of simplicity that Samsung’s and other device manufacturer’s marketing portrays.

I’d suggest a search of the forums here for an “accurate” temperature / humidity sensor. Or start a new thread asking about it. In a quick search I only found this:

…and unfortunately the Fibaro FGK-101 “Door/Window & Temperature Sensor” w/ optional DS18B20 that the last poster recommends does require a custom DTH…

(Keith G) #852

There was an error in the DTH code, which I’ve just fixed, thanks to a user issue report on GitHub.

Both the Aqara and “original” Xiaomi Temperature / Humidity Sensor DTHs have been updated to v1.2 with the correctly working humidity offset.

So you’ll need to update your copy of the DTH code in your IDE for it to work.

Sorry for the inconvenience!

(Toranja) #853

Hi veeceeoh.

Thanks a lot for the extra fast feedback.
I downloaded and updated the DHL now and on the next readout I should already have some data :slight_smile: thanks a lot.

By the way, if you’re using ºC instead of F does the collours have the expected behaviour?
I’m using ºC and if the temperature is for example at 23ºC then the icon is fully red… strange…

Btw I was just looking for the code:

map.value = humidOffset ? (int) map.value + (int) humidOffset : (int) map.value

I don’t quit understand this…
what does the ? stands for?

I was trying to understand in order to also help developing the DHL :slight_smile:
Thanks in advance
Best Regards


I have only 10 devices, so it should not be a device limit issue. I was also using the buttons without issue for a few months before it crapped out, so I’m doubtful it’s a weak connection issue, but I am open to trying the channels for in case of interference.

Other than these, however, is there anything else I can do? Am I missing something? The fact that both my buttons crapped out a few months after using it is really weird to me.


(Drew Worthey) #855

Do you have any zigbee routers in your home? I have some Osram Lightify LED strips that serve as Zigbee routers, and I had to unplug them to get my Xiaomi Aqara motion sensors to pair directly with the hub and stay paired for more than a few hours.

(Toranja) #856

Hello all.

I’ve just bought two aqara window door sensor, but when I try to pair them with ST they appear as “Thing”…
Anyone had the same issue?

Thanks in advance
Best Regards

(Toranja) #857

Hello all.

Just for the recording they are already working…
If anyone runs into the same problema follow this instruction:

  1. Place the correct device handler,
  2. Pair them (they will appear as thing);
  3. Go the “My Devices” under the webpage from your ST account;
  4. Select the thing you wanna change;
  5. Go to “Edit” button;
  6. Under type choose the correct device handler;

Hope it helps :slight_smile:
Best Regards

(Joel) #858

my xiaomi motion sensors were stable for about two months now two of them are offline. I can’t even reconnect from scratch!

very frustrating.

(MarkTr) #859

One of my water sensors dropped off recently after being solid for several months. Haven’t managed to get it reconnected yet, though I’ve only spent about 5 minutes on it so far…

(Joel) #860

yeah i got one back online - the other one (two were having issues) i got connected i think but then it just goes dead again.

will try new battery. but they are only 2 months old.

(Brian Spranger) #861

I had over 30 sensors some via an xbee for almost a year. This weekend I had 8 drop.

(steve grout) #862

didn’t smarthtings release a firmware upgrade on monday? Wonder if the hub reboot might of made them drop. I know since then i’ve been having intermittent issues with aqara door sensors that have been rock solid for months.

(Keith G) #863

Another user has mentioned this as well, and I still need to do some tests with a revised set of temperature/color values to make sure the colors are appropriate both in ºF and ºC in all conditions (hot-medium-cold). My main home automation hub is now a Hubitat, and it’s summertime, so I’ve been slow in doing this… :frowning:

This is called a ternary operator. It’s a way to implement ifelse in a short way, like this:

if condition = true
 value = A
 else if condition = false
 value = B

can be implemented as a ternary with
value = condition ? A : B

So the code in the DTH:

map.value = humidOffset ? (int) map.value + (int) humidOffset : (int) map.value

says if humidOffset is true (i.e., it has a value), then map.value = map.value + humidOffset, otherwise map.value remains unchanged.

I hope that helps!

(Max Tay) #864

Is the change to support multiple end points included in SmartThings recent firmware update?

(Max Tay) #865

Is there any solution in supporting multiple end points device, like the Aqara wireless switch with two buttons, from SmartThings recent firmware update?

(Darren) #866

Many of my xiaomi sensors which had been stable for months have also dropped off.

I put it down to the hub upgrade. Either way its very frustrating (yes I know they aren’t fully compatible) but still.

(Waterydan) #867

Hi, I posted this question on the other Xiaomi thread. Maybe it should be posted here instead:
I have a few Xiaomi zigbee outlets setup as repeaters. How do I check if devices are connecting via the outlets/repeaters or directly to ST?

(Brian Spranger) #868

I think the only way to know is when you join the sensor to the network. In the hub logs you will see a zbjoin message. In there there is a parent ID. The hub is 0000. So if the parent is anything but 0000 it is routed through a different device.