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

Is it possible to use both buttons on the 2 button wall switch?

Tossing this out here. I’ve had NO luck with Tradfri. My Aqara will drop within a few hours. Guaranteed. Luckily my hub can hit almost every place I need an Aqara.

I unplug my smartthings branded plug along with a few tradfri plugs. Then I pair the devices no problem. THEN I plug my repeaters back in. So far that’s kept my Aqara from dropping. Pairing ontop of the hub didn’t prove to be foolproof as they would still occasionally decide to pair to a repeater and I wouldn’t know until I saw it offline later.

Which one, the Wireless (battery powered) or Wired (in-wall powered) Aqara 2 button switch?

Which model of SmartThings plug? Only the newest one from 2018 has been reported to repeat Xiaomi / Aqara devices without dropping them. So if you have an older SmartThings plug that could be the problem right there.

Right. And tradfri is supposed to work. But even with the ST unplugged and only tradfri plugged in, they aren’t repeating for me. I have to remove every single tradfri and the one ST plug. Once paired that way, insuring directly to the hub, they’ve remained online for weeks.

I see. Well you are the first person to report Tradfri Outlets appearing to not work well with Xiaomi / Aqara devices.

Without the use of an XBee to look at the ZigBee routing map and/or a ZigBee sniffer to see what’s happening in more detail, there really isn’t much troubleshooting to be done besides what you’ve explained (pairing the Xiaomi / Aqara devices first, and then pairing the repeaters - which isn’t guaranteed to be a permanent solution.)

Thank you for reporting this.

Hi @veeceeoh, I am quite new with ST and do not have much understanding on developing device handler. But I was wondering since the Aqara Wireless Light Switch WXKG02LMI DTH does not work for the new ST app, do you think it is possible to use the Aqara Wired Switch QBKG12LM approach?

In short, have it automatically create 2 child switch

  • Main: Allow us to set automation for Both button Press/Double/Hold. It also has the battery level and other information.
  • Child: Main will create 2 child, one for left, one for right. This allow us to set the automation for individual left and right button Press/Double/Hold.

I have tried to do up a MVP but due to my lack of knowledge on how to develop DTH, I am unable to get it to work. The following post which you have provide help to has a DTH that implemented the Main-Child approach.

Maybe, but at the moment I am very very busy so I am not sure when I will have time to try this approach.

I won’t lie, though. I really really dislike the new Samsung Connect mobile app because of all of the functionality that is missing, and also because developer documentation on how to correctly write device handlers for the new app is still not available.

No worries! I will spend some more time figuring out. If I ever get it to work, I will share it here. Thanks for the prompt reply!

I totally agree with you, they are taking too long adding functionality to the new ST app plus there is barely any documentation.

hi, let me ask you, i have been trying to get my new Aqara sensor to activate my bathroom sensor, but I think it reads moisture every hour, so its not practicle.how did you change the frequency of the readings to say every 5 minutes? Also how do you change the defualt parameters on a sensor and put in new code. thank you ahead of time for helping me out.

Both the Xiaomi & Aqara Temp-Humidity sensors only send reports when there is a change in temperature or humidity and the reports are not based on time intervals. This behavior cannot be adjusted or changed at all.

I am a contributor to and currently maintain all of the GitHub/bspranger/Xiaomi device handlers. What parameter would you like to change?

Bought one Aqara temp/humidity sensor a week ago. Loaded the DTH in the ST IDE. First pairing attempt, I had a smartthings outlet plugged in, but it paired up and the battery showed after a few minutes, but about an hour later it went offline. Removed it and added it again, this time I unplugged the smartthings outlet, it paired but the battery never showed and it went offline in about an hour. Tried one more time, plugged the smartthings plug back in, paired it, battery showed and it’s been online ever since. One week and counting working good.

Decided to buy 3 more to replace open close sensors I’m using for temperature only. Received the next 3 and started to get them paired. Over the course of 2 days, I tried multiple sensors and couldn’t get any to report the battery and stay online. I started counting how many attempts. I tried 52 times using two different sensors, did it exactly the same way as I first that’s still working and nothing. Tried it everyway that has been described in this thread, did all the tricks, no good. I even placed the newer sensor right next to the working one, still goes offline. Twice I got the battery to show, but it went offline minutes later. After 50+ attempts I give up.

Why one paired, reports the battery, and has been working fine for a week and the others won’t pair correctly makes no sense to me. I also don’t understand how on one makes a temp/humidity only sensor for smartthings. Why does Samsung not have one? If anyone knows of another temp/humidity only sensor that works with ST please let me know. Thanks.

HI keith,

Thank you for getting back to me. I wanted to mess around with the parameters of my Aqara Temp Humidity; I thought that it “took a reading” every hour, so it is not working well as a trigger for the bathroom fan (should be every 5 minutes). My goal is to have the sensor work in conjunction with a smart switch to replace the use of a regular “humidity sensing switch.” How would you go about doing something like this? Is there another sensor you would recommend?

Also I am new to the community, I love to be able to contribute, but have not been able to understand on a practical sense where I would access the sensor parameters and change them (using code) and apply the code to my particular triggers. In particular, I like to be able to use “and” and “if and if, else” statements to control lights. For example, in my bathroom, if it is a certain time (7 am to 10 pm) when I hit the switch, I want the light to be white, but if it is past 10 pm, I like my motion sensor to act as a trigger to activate my light and have them be red (acting as a night light). If I press the switch, I like it to turn white again. The light should only last 30 minutes after the motion sensor stop sensing motion or is press. I don’t know where to get started, where do I go to access my sensor and lights and modify the existing code, and where do I create the new code (the platform). I use the new smartthings hub (not the classic). If you have any good videos you recommend, I would truly appreciate it,or if you can give me a tutorial I would appreciate it. I value your time, so if I can compensate you somehow I would be more than happy to do that, the idea is to learn. I am pretty good with logic statements, I just have to understand the system a little. Thank you.

Well the since the Xiaomi / Aqara sensors send reports based on changes in temperature or humidity it is still possible to use them as part of an automated bathroom vent fan setup. I haven’t done this myself, but I have read of other people doing this.

Regardless of whether you use a Xiaomi / Aqara sensor or another humidity sensor, you will need to either set up an already included SmartApp or install a community-created one for the automation side of the equation. For this use case, I’d look at the choices available in the Marketplace section of the SmartThings Classic mobile app, in the SmartApps tab, perhaps under the Climate Control heading. There’s a SmartApp called Humidity Alert! which might do the trick:

As for other temperature / humidity sensors which may report based on a time interval, there are so many choices available at a wide variety of prices I’m afraid I cannot give a recommendation here. Perhaps search the SmartThings Community Forums here for a thread in which someone has asked for the same recommendation?

Hopefully you won’t ever have to modify code, because what you are looking for are SmartApps to help you create automations. The Device Handler (or “DTH” or “DH”) code for Xiaomi / Aqara devices that are linked to in this thread are just simply for making the devices accessible to SmartThings to use in conjunction with SmartApps. Thing of Device Handlers as device drivers that you need to install on your computer in order for it to recognize those devices when you plug them in, and SmartApps as the Applications that allow you to do things with the devices.

As for information on where yo get started, there is A LOT available on this community forum, so it can be overwhelming. Here are a a couple suggestions to get you going:

and also:


1 Like

This might also be of interest:

How to Get Started Creating Complex Rules in SmartThings (2017) (SmartThings Classic)

1 Like

If you want to do any kind of “programming” , I highly recommend using Webcore.
It’s super easy to create apps (they are called Pistons) that can do just about anything.
I switched to Webcore to control all my smart devices.

Hi @veeceeoh
(long time, no see :smiley:)

I actually tried the Xiaomi-Aqara humidity sensor (model: lumi.weather) with this SmartApp, but i can’t get it to trigger anything (tried with a Aqara relay and a virtual switch…
It is as if the SmartApp can’t read the info from the sensor… Could it be a integer/decimal issue with the readings from the sensor…? The DH shows only non-decimal numbers in the ST app (V2).

Here’s my Piston if someone wants to have a staring point.
Keeps the house at intHouseHumidity during the winter months when the doors and windows are closed and pops the fan on for 5 minutes whenever a poop is immenent!

1 Like

If this was mentioned before, I must have missed it somehow.

It’s possible that the temperature value used to create temperature events on the hub needs to be using a different data type. Right now, if the user hasn’t turned on the “Display temperature as integer” option in the preferences, then the temperature value is passed on a float number with 0.1 decimal precision. If the “Display temperature as integer” option has be turned on, then the value is passed on as an integer number.

The hub event handler in theory should be able to handle either of those data types for the temperature value, but if it can’t that would explain why the Humidity Alert! SmartApp isn’t being triggered.

When I have time, I will take a look at the latest temperature sensor device handlers on the SmartThings public repository, and also the Humidity Alert! code, if available to view, and publish an update to the Xiaomi / Aqara Temp-Humidity DTHs if needed.

Honestly I don’t know what is expected for the new SmartThings Samsung Connect mobile app, because the developer documentation isn’t completed. Also, the device handler preferences are completely unavailable in the new mobile app, making it far less useful than the old SmartThings “Classic” m mobile app at this time.

Hi @veeceeoh
Just to clarify: I’m trying to get the Humidity Alert! SmartApp working with humidity readings, not temperature… :slight_smile:
Didn’t think of setting the “Display temperature as integer” option - does it affect humidity readings as well…? I’ll test later today…

And a correction: i am using the classic app, not the new one… Sorry… :roll_eyes:

Oh, yes, silly me. Well the DTH’s function to generate humidity events uses SmartThing’s standard zigbee.getEvent() method, which returns the humidity value as an integer. The “Display temperature as integer” option does not affect the humidity value at all.

So perhaps the Humidity Alert! SmartApp doesn’t like working with integer values? I would find that very strange, though. I will have to do some testing… when I have time, of course. :wink:

1 Like

© 2019 SmartThings, Inc. All Rights Reserved. Terms of Use | Privacy Policy

SmartThings; SmartApps®; Physical Graph; Hello, Home; and Hello, Smart Home are all trademarks of the SmartThings, Inc.