There’s no mains version. Some of the sites have mislabelled the description - when I ordered mine it supposedly had a mains plug option which had to be selected for the order to proceed which surprised me but I received a battery powered one.
[OBSOLETE] Original & Aqara Xiaomi Zigbee Sensors (contact, temp, motion, button, outlet, leak, etc)
That is great news, any tips on pairing this thing?
@veeceeoh
I actually use the “held” functionality with the original xiaomi button.
I use this to turn on one light, or two lights when held. Works fine with the a4refillpad-version, although i have to hold the button for about 6 seconds.
I haven’t been here for awhile, but glad to see the lastCheckinDate is still in there. Very useful in WebCore.
We’re trying to find a way to bring back and improve on the “held” function, because the method in a4refillpad’s DTH doesn’t seem to work 100%.
I just got my own round Xioami button that arrived yesterday, to do testing. And unfortunately, I’m quite sure the reason why it doesn’t work consistently is because of it’s multi-click capability.
The multi-click feature results in a delay of sending the single-click message to the hub while the button’s hardware waits to determine if a multi-click is happening. To make things worse, due to the way SmartThing’s ZigBee message parser works, the messages for double, triple, and quadruple-clicks are not passed on to the device handler to make use of.
So what I have seen in my initial testing is that some normal press & release actions (to produce a “pushed” message using the a4refillpad DTH) are completely missed. The button needs to be held for about half a second for it to decide a multi-click is not happening. Then the “single press” message is sent to the DTH, and a “release” message is sent when the button is released.
Don’t give it too much attention, it’s something i could figure out in WebCore to make it work i think.
I have had my own version of the handlers for quite some time, but i deleted my fork and use the bspranger version now, since so many things have been updated and it’s much easier to update via git.
Thanks to everyone who contributed!
The prescribed 3 presses of the button should work (no need for catchall). Although I had to do it a couple of times for it to “take”.
Brian,
Thank you so much for the device handlers! This is my first Xiaomi device and your DTH made it so simple. I added the Aqara leak sensor, and while I did first try your pairing instructions, they did not produce results. I instead held the button for 10 seconds as I have done with other Zigbee devices, and it appeared immediately in the app. Short pressed the button one more time for good measure and tapped “Save”. Appeared as Xiaomi Leak sensor. No need to rename. Works perfectly.
I’m very encourage by your report that they have not dropped the connection. This is a very nicely designed sensor. I will be ordering more of these for which I paid only $12 and likely returning my $55 Iris sensor that keeps dropping its connection.
Hope to see you in the Hubitat community as well. Several members looking for Xiaomi DTH
Not sure if Brian has any plans to purchase a Hubitat hub, but I have bought one, and am currently working on porting over all of the DTHs.
Unfortunately, all of my Xiaomi sensors lose their connection to the Hubitat, and some other users have reported the same on the forums.
Besides writing a number of forum posts about the issue, I have emailed support. I haven’t heard back from them yet. Fingers crossed!
Thanks for reporting back on your pairing experience. I will have to do some tests with my over a dozen sensors to check again if that works any better. I know the technical reasons for difficulties in pairing to the SmartThings hub, and there’s not much that can be helped on the user’s end, except to make sure the device doesn’t “fall asleep” during the pairing process.
Thanks Keith. My hub is on its way. Hopefully things will get sorted by the Hubitat team. Still very early days there.
Thanks for this DH, recieved my Aqara temp/humidity sensor a few days ago and after some expected initial connection issues it now appears happy and is reporting as expected
I have a couple of questions and was wondering if someone could help
In the main display i have Temp as main image and below i have battery, Humidity, pressure under that there is the last event field but under that there appears to be a field for info that just shows – is there supposed to be info there ? and also i have tried to adjust the temp offset in the settings but there is no minus sign available on the keypad, only a . i need to take the temp offset down a degree, is there anything i can do to get the offset ?
I am using an Android Galaxy S7e
Hi Fido,
The last tile you descdribe records the battery change date, if you go into settings and click the battery changed option and then save this will register todays date.
As for the negative symbol. double tap the button to access this.
Hope that makes sense.
Thanks Foz, in the end i went into the IDE and adjusted the settings from the Devices section, i did try a double tap just as a side note but for me it didnt bring up the - sign ?? no probs though all sorted now
Many thanks for the reply
and the battery date time setting was just me not poking around enough, my bad on that
So you’re still not able to get the negative sign to enter in a negative offset?
Just wondering because if it doesn’t work for all Android users, we can change the device handler allows numbers to be entered (but unfortunately also allows other characters to be entered).
Well, well, well…I received the two Original Xiaomi Smart Human Body Sensor (Not Aqara) yesterday. I already had the DH loaded in IDE. They took a bit of pressing the pairing switch multiple times. They finally showed up as paired. These motion sensors have a pretty good range to them. I think the website says 7 meters. I’d say the range I have one set up at is about 5-6 meters and it seems to be pretty sensitive.
I’m really impressed with the sensor. It took about an hour for the battery to report and show the percentage which is standard for these, I know.
I’m also really impressed with the motion sensitivity and the small package. These things are tiny.
Hats off, yet again to the folks who were/are part of developing the DH and made these work like they do.
One word of caution, if you order through Gearbest, you better pay for the expedited shipping, or not be in any kind of hurry to get them. Delivery took 42 days on the slow boat free shipping.
Hi Keith, 100% i tried double tapping and it didnt work… BUT due to your post i have just retried double tap … it freakin worked !!! which is good and saves you messing with any more code but is stupid user error on my part, maybe i just was not paying enough attention when i did it, the - sign is pretty small even on a S7e, perhaps i just didnt recognise it … duno but for whatever reason it DOES work with double tap, my apologies
Next thing i will probably get wrong is changing the temperature colours, at the moment outside it is -1.2 deg C but the main panel is showing a red colour when infact i feel a deep blue would be better, unfortunately the IDE is not letting me edit anything at the mo, must be a server error somewhere there end
Ok using the DH and changing to repository to NON for now just to allow editing, i have deleted the 13 lines and removed the // as mentioned in the code for Celsius colour scheme, bare in mind i am no expert with the code it does appear the lowest value is 0, so i added [value: -6, color: “#58d8e1”], at the beginning of the colour set line, my thoughts were to have a colour from -6 to 0 in colour #58d8e1 but i am still getting an orange colour that has always been the default colour i guess for negative values, definately due to my lack of knowledge my small changes are not working, any pointers just to have negative temp values in a colour other than orange
i think i may have sort of found where the issue lies, the code is set up mainly for Farenheight, -2 Celsius is 28.4 F, 28.4F in the colour set is orange ! so it appears the temperature value is reporting properly but the colours are not honouring Celsius values, the background colours are only honouring Farenheight temperatute to colour
is this line of code to blame
temp = (temperatureScale == “F”) ? ((temp * 1.8) + 32) + offset : temp + offset
there is no mention of Celsius ?? i `m probably wrong though
Yeah, Smarthings IDE farted today, affects git smartapps and DHs… there is a thread over here…
yeah seen it Foz, thats where i read about switching the repository name to none… hopefully it will be sorted soon
I’m sorry to say I didn’t do extensive testing of the alternate color set for Celcius users, but that set and the default set were taken from example code mentioned by the SmartThings Developer Documentation here.
Looking at their suggested colors for Fahrenheit, you could do something like this for Celcius:
0 #153591 (dark blue)
7 #1e9cbb (medium blue)
14 #90d2a7 (light green)
21 #44b621 (medium green)
28 #f1d801 (yellow)
35 #d04e00 (orange)
38 #bc2323 (red)
It’s possible there is a bug in the SmartThings user interface that uses the wrong colors when temperatures go into negative values. I will have to investigate. However the code you asked about:
temp = (temperatureScale == “F”) ? ((temp * 1.8) + 32) + offset : temp + offset
has nothing to do with any issues you see in the displayed color. That is a ternary operator and is just a short way to write a conditional. It converts the native celcius temperature from the sensor only if the user’s hub is set to display Fahrenheit. A simplified long form would look like this:
(assume temp is the sensor's reported temperature in Celcius)
if (temperatureScale == “F”) "if hub is set to display Fahrenheit"
then temp = ((temp * 1.8) + 32) + offset "then convert value to F, plus offset"
else temp = temp + offset "otherwise add offset to C value"
Announcing: Update to v1.1 for all Xiaomi device handlers
(except ZigBee Outlet & Mijia-Honeywell Fire Sensor)
Available now from the bspranger/Xiaomi repository on GitHub.
Changes:
• New custom battery tile icon
• New custom humidity tile icon (both Temp/Humidity sensor DTHs only)
• New custom pressure tile icon (Aqara Temp/Humidity sensor DTH only)
• Rearranged order of first three tiles of Aqara Temp/Humidity sensor DTH
• Changed battery event text to “battery at % ( Volts)”
Screenshots:
(iOS on left, Android on right)
So, it turns out that it’s not easy at all to create a custom icon for the SmartThings mobile app, because the user interface renders them in very different ways on iOS versus Android. With the help of @foz333 and @tmleafs, we finally found a happy balance of displaying the same icon on both platforms.
Note that for iOS users, the icons don’t show up in the list of events in the “Recently” tab. So the event description now lists the battery percentage in addition to the reported Voltage.