SmartThings Community

[RELEASE] Xiaomi Sensors and Button (beta)

dth_motionsensor
dth_remotes
dth_sensors

(Wayne) #1

Following on from the thread here

I’ve starting my own thread for my versions of the Xiaomi Motion, Contact and Smart Button device handler. This is so that people are able to find my device handlers easier and concentrate any discussion specific to my version of the handlers rather than previous ones made by others.

I’ve kept the status as “beta” as the actual hardware do not claim official HA1.2 compliance and are very tricky to pair initially. However, once they stay successfully paired for a few hours, they have been proven over the last couple of months to be extremely reliable.
However, I think it is fair to warn people that this is no guarantee that they will continue to work in the future.

More information about pairing in the original thread here and here. I would suggest people refer to that thread for lot of valuable discussion about the devices and pairing rather than asking here.

EDIT:
pinning this [post] ([RELEASE] Xiaomi Sensors and Button (beta)) as very useful for people having issues pairing.

EDIT:
I’ve now created a handler for the Temperature & Humidity sensor and uploaded into the same github repository.

EDIT:
Warning: Although I’ve included the outlet DH in the repository for completeness, I found that it consistently disrupted my zigbee network for my smartthings sensors causing them to drop off. Therefore personally, I cannot recommend them, however I’ve not heard anyone else reporting the same. So YMMV.

EDIT:
Some people have tried with the V1 hub. I do not expect these to work as it only started working on V2 after a firmware update Q4 of 2016.

EDIT:
This post contains a translated FAQ for the devices from the native Xiaomi website.

Contact Sensor:

Motion Sensor:

Button Handler:

Temperature and Humidity Sensor:


Xiaomi Zigbee Door/Window Sensor, Motion Sensor, & Smart Button Device Type [beta]
Xiaomi devices on sale (buttons/sensors/cubes)
Temperature sensor
Xiaomi Zigbee Door/Window Sensor, Motion Sensor, & Smart Button Device Type [beta]
Xiaomi devices on sale (buttons/sensors/cubes)
Xiaomi/Aqara Temperature Sensor
Xiaomi vs Aqara door/window sensors
Original & Aqara Xiaomi Zigbee Sensors (contact, temp, motion, button, outlet, leak, etc)
Aqara Xiaomi Mijia Smoke / Gas Detectors 2
Xiaomi Zigbee Door/Window Sensor, Motion Sensor, & Smart Button Device Type [beta]
Xiaomi devices on sale (buttons/sensors/cubes)
IKEA Trådfri
Definitive list of 'Things' that will work with UK SmartThings?
Xiaomi Zigbee Door/Window Sensor, Motion Sensor, & Smart Button Device Type [beta]
Adding Xiaomi door sensor
Xiaomi Zigbee Door/Window Sensor, Motion Sensor, & Smart Button Device Type [beta]
Original Xiaomi Aqara Smart Wireless Switch (Aqara Button) [Beta]
Switch to control a smart plug?
How to use GitHub in a simple way as a non-dev to install apps
Rooms Manager: Smarter Rooms: Personalized home automation with Occupancy
3rd Party Sensor - Eva Logik Zwave Products
[SUSPENDED] Blink Camera Device Handler with Motion Sensor, Live Video Streaming, Integration with SmartThings/SHM, Temperature, Signals and Push Notifications
[SOLD]: Xiaomi Temperature Humidity, Door Contact, Motion Sensors and Button
FAQ: Which devices work/double as a Zigbee Extender? (2018)
FAQ: Full list of buttons and remotes confirmed to work with SmartThings
Lighting Automation ideas for Home Theater/Basement?
Do reliable buttons/remotes exist?
Will Z-wave device manufactured in US work in INDIA? (if we use ST manufactured in US)
Your Ideas for New ST-compatible Security Products Needed for Academic Project
Fibaro Dimmer 2
Hub disconnect issues
Light Switches - where to start? (UK)
Potential New Owner - Where to buy accessories?
Hack the Amazon Dash button to control a SmartThings switch
This ST thing is becoming a problem
This ST thing is becoming a problem
Cheapest (reliable) door/window sensor (UK)
Hub Firmware Release Notes - 18.18
Cheap lighting (UK)
Can't add new Aqara devices but they are reporting
Xiaomi devices on sale (buttons/sensors/cubes)
IRIS Smart Plug - How to tell if it's acting as a repeater?
Best Sensor's for someone who is new to home automation (I am in US.)
FAQ: Full list of buttons and remotes confirmed to work with SmartThings
Bulbs, switches and sensors, oh my....what to buy (device class features)
@bamarayne Tell me about your Toilet!
Corded devices to ST (Finland)
$9 Zigbee Xiaomi Door/Window Sensors (works for some people)
Just a Button? 1 button, nothing more fancy?
Keen vents, Hub or no hub?
Can ST do integrations between Ring and Xiaomi Yeelights & door sensors?
Crawl space temperature sensor
(Paulo Nóbrega) #2

Any news on your temp sensor? :slight_smile:


(Wayne) #3

I never received them and still trying to get my money back. Have not reordered in the meantime so will not be able to work on that device any time soon.


#4

Great to see you starting your own thread. Thanks again for your work.


(Vineet) #5

Good work, I’ve paired my first Xiaomi sensor, a door close sensor, paired by furiously pressing the pairning button before & till about a minute after pairing. But I still do not get the battery update, does it take time initially to appear ?

Also pressing the configure tile does not respond, i.e. it does not show anything.

EDIT: I paired a Xiaomi motion sensor using same method, and same symptoms, no battery level and the configure tile does not work. However I’m able to comfigure using the icon on top right.

EDIT: with the same method, paired a Xiaomi button, it shows battery status, but the other two (motion & door sensor) still does not show battery status.

EDIT: Door close sensor reported battery as 90%


(Wayne) #6

All of this is in the original thread. If you get nothing after a few hours you need to repair until it sticks. This is nothing to do with my handler. I strongly recommend people have a look through the links in the OP to help answer these questions.


(Bob) #7

Hi Wayne.
I have some of these on order so I’m following this with interest.
Sorry to split hairs here.

Do you mean re-pair or repair as in fix.
Again sorry for the question. :smile:


(Wayne) #8

You are correct… “re-pair”. It is a pain, but you only need to go through it at the beginning , once done they seem to work great. In fact, in my set-up more reliable than my smartthings branded sensors.


(Bob) #9

Thanks.
I hope they are better than the ST ones as I am sick of continually having to remove/put back the batteries twice a week.


(Wayne) #10

I’m glad I’m not the only one doing that recently… since the last hub update, i’ve been doing this randomly on my 27 smartthings sensors… Not had to do it once on any of my Xiaomi sensors yet… fingers crossed.
If it weren’t for the most excellent simple device viewer, my system would be completely up the creek by now.


#11

I appreciate all you’ve done here a4refillpad, but I’m struggling with this and I’m hoping you can help,or at least tell me from the folowing where I’m going wrong.

So, I created a device handler from your code (motion sensor) and saved and published. I have then added a new device using the ‘Xiaomi Motion Sensor’ from the drop-down, inserted the ‘catch-all’ string as mentioned in the other thread and added the device. But it just doesn’t seem to recognise motion. Initially the app reads as ‘Motion’ in orange, I then reset that let it sit for a while and try to trigger it, but nothing.

This is the first time I’ve tried working with something which isn’t generally compatible with ST so although I think I’ve followed the process correctly I could be way off.


(Wayne) #12

Do you see any events for the device you’ve added in the IDE? I suspect you haven’t successfully paired it to be honest. If you don’t see any events then you’ve not been successful in pairing and will need to try again.


#13

Ye, nothing other than the event following me clicking the “Reset Motion” button within the app. I’ve tried 4 or 5 times with this now and each time it’s the same result, so I must be doing something wrong along the way, just not sure what. Thanks though, I’ll keeping on trying.


#14

Right, initially adding it as a new device in the IDE is what was causing the problem for me. Removing that and just standing next to the hub and pushing the reset button in a random fashion finally found it as a new device and seems to be working well, for now.


(PH) #15

Thanks a4refillpad for setup a new thread and putting everything together.
I finally got my Xiaomi motion sensor today and was able to paired it with SmartThings in less than 3 minutes.
The sensitivity, distance, and motion detect angle are way better than Samsung SmartThings Motion Sensor.
It reported 83% battery life left for my Xiaomi motion sensor brand new out of box.
Question, is the Configure button suppose to do anything? When I clicked on it, it didn’t do anything.


(Wayne) #16

It does in fact enrolls some configuration down to the device. I not 100% certain the device fully recognises it but does not complain. It’s something i inherited from early device handlers that were successful with getting them stick. The handler does now send the config down automatically when the device joins so may not be necessary having the tile any more. It’s something that I’m playing with and may remove in future revisions.


(Aamil Fazal) #17

@a4refillpad Thanks for your hard work regarding this. I have read through all 800 post regarding this and I’m looking to pull the trigger on these however I just wanted to confirm if we need the xiaomi hub or I can connect them directly to smart things. I also wanted to know the best place to get the motion sensors as I saw you did not receive some of your products?


(Wayne) #18

You can connect without the hub. I would advise adding insurance option to any orders made with gearbest and others if you make a larger order. I found that you are left without any compensation if you item does not turn up otherwise.


(Paulo Nóbrega) #19

as long as You pay with paypal you are safe… allways do that…

I only had one issue with GB in many many orders, and was about a refund and return… they were taking to long and paypal resolved…

no store that that can afford having paypal issues :slight_smile:


(Aamil Fazal) #20

@a4refillpad @Paulo_Nobrega Thanks for the reply, anyone have experience of them in UK I’m about to put an order in just now