[OBSOLETE] Xiaomi Sensors and Button (beta)

Do you have the device health feature enabled?

My experience is that is doesn’t work correctly with Xiaomi devices due to the different way they check in as compared to other Zigbee devices. Device Health lists them as “unavailable” when they are actually still connected and working fine.

Unless you have a real need for the Device Health feature, I’d recommend turning it off if you’re bothered by the “unavailable” status on Xiaomi devices.

1 Like

I run a number of original non Aqara Xiaomi sensors (motion, temp and door) and have device health turned on. None of then report as unavailable. I am using the original a4refillpad DTHs for all of them.

Perhaps you’re one of the lucky ones. I should mention that I didn’t have the “unavailable” Device Health status all of the time - just a number of times. When I looked for information about it at the time (late last year), what I found was that Device Health only officially supports devices that use SmartThings DTH code.

Having worked extensively on the bspranger/Xiaomi DTHs, I can say that the code of setting up the device health check time interval is exactly the same as it is in the a4refillpad DTHs.

Based on recent troubles that people have been having, though, I think maybe it might be a good idea to remove that code completely until SmartThings announces formal support of Device Health for devices using custom DTH code.

SmartThings has publicly admitted troubles with Device Health last week, and they claim that everything is resolved now:

Also, from the SmartThings Status page:

@tommyincville Please forgive my ignorance, but (If you would share it) I would like to use your refined “Humidity focused” xiaomi humidity sensor code. I can only find reference to it and cannot find anywhere that I can copy and paste the entire code from. Can I use it? of so, will you email it to me or post it so I can copy it? Please advise (either way).

Warmest Regards,

Could someone help me out regarding the original xiaomi button. Obviously there is something I am missing/not understanding here; I paired the button successfully but when I add the “smart lightning” in the classic app and select it as a dimmer I can only change between “turn on” and “turn on and set level”. The set level seems to be a static value.
I would love to be able to long press it and have the levels go up and down. Is this possible?
I am trying to change the dimming levels on an ikea trådfri bulb.

I also have tried using the LONG press and single and double press with these buttons. No luck but haven’t reached out to see if its even possible. If it is then it opens up Many possibilities . But the New Samsung buttons they do what you want. Sorry to say but also they seem to be V3 hub only…

Unfortunately, no.

In order to use a held button action to ramp up or down the level of a dimming bulb, there would need to be a separate “button - held” event at the start, and a “button - released” event at the end.

Both the A4refillpad and bspranger/Xiaomi device handlers for the original Xiaomi button only send the “button - pushed” or “button - held” event when the button is released. Also, the SmartThings button implementation doesn’t support a “button - released” event, which explains why the Smart Lighting app doesn’t have an option to raise / lower the level of a dimmable switch/bulb when button XXX is held.

There are workarounds for this which involves using other SmartApps or WebCoRE and assigning “button 1 - held” to the start of raising/lowering the level of a dimming switch or bulb, and then “button 2 - held” to stop changing the level. In the device handler, it would have to send the corresponding events when the button device is held and then released after being held, but it only really works if the button hardware itself can recognize the difference between a press and being held and sends different messages for those two actions. The original Xiaomi button hardware does not support sending a button held message.

As explained above, both device handlers for the original Xiaomi button support “button - pushed” (short press) and “button - held” (long press), but those event messages only happen when the button is released. However, double-press of the original Xiaomi button is not supported in SmartThings.

Hi All,

I’m new forum member and I still don’t have ST hub .
The Xiaomi DH is super critical for me as I read that not only the prices are great but they are very good sensors .
I read that ST v3 has issues with Xiaomi sensors .
The problem is that I can’t find affordable ST v3 Europe as they out of stock in some online stores or very expensive .
Saying this, I have 2 questions:

  1. Is it possible to make ST v3 compatible with Xiaomi sensors ?
  2. If not, where can I buy ST v2 Europe frequencies in reasonable price that also send to Israel .

Appreciate Any other Ideas

Thanks All

Hi guys!

first of all sorry for my English, its not my main language.

I am asking the users who has the door/window sensors for a long time.
Does it now working properly? I read lots of disconnections, problems and so on…

But now 1 year later this topic started, is it stable and good?
Also what about the battery life?

I am asking this because i am moving to a new house and i want to put lots of these sensors into it.

thank you

My experience is that they are Rock solid…
As long as you have a good Zigbee network or are in range from the hub…
Mine have run on the same batteries for little over a year know, and shows 97% left…

Hi Brian,

Check this post:

There is special procedure that you need to follow to avoid frequent disconnections.
Following the procedure described in the attached post, I have had 100% success in correctly pairing Xioami/Aqara devices.

Thank you for your answer!

I am going to use it with V3 HUB, i hope everything will going well.


What is the correct way to re-pair a Xiaomi button? I have the round Xiaomi button that has been working for months. And then 1-2 weeks ago, it is shown as disconnected. This occurs around the same period which my hub seems to be dead running out of battery. After fixing the hub, the Xiaomi button is the only one not working. I tried replacing the CR2032 battery of the button but no help.

I have seen instruction about how I need to turn off zigbee repeaters. I only have 1 repeater which is a light switch. It is not convenience to turn it off as I need to do it from the breaker.

What I am still not clear is if I need to remove the Xiaomi button from my list devices, which means I have to redo all my automations as well. Do I need to remove the Xiaomi button from my Hub?

I have pushed the reset/link button several times. I have not seen any Event listed under my hub related to the button press. Is this expected?

First, I would go get yourself an IKEA Trådfri outlet as a repeater for the Xiaomi devices. They are inexpensive and work great for not only Xiaomi, but other Zigbee devices as well. Most repeaters are not compatible with Xiaomi, but the Trådfri outlet is. I added two of them on November 18, 2018 and I have not had a single Xiaomi or any Zigbee device for that matter, drop off since.

Next, @veeceeoh recommends this method on Hubitat. It would be something similar on SmartThings.

I have also had success on occasion by simply removing the battery for 30 seconds, put it back in and then single pressed the button. It reconnected. Did that a few times with success before I had the Trådfri outlets. Now I don’t have to. Of course, if I lose power long enough I might have to.


Hello! Just got my smartthingshub and trying to add som sensors to it, got some motionssensors and temprature sensors and leaksensor added succesfully, im trying to add xiaomi original button but it wont pair like the others in the app but i can see them working in the eventlist.

I see that i can add device manually but what info do i need to edit to the device from eventlist? Network id? Button wont change state in app when ive tried.

Should i just keep trying add throught the app untill it pops up?

Thanks for help.

Guys is there a different device handler for long press of the xiaomi button from just the standard press, if so can you point me in the direction of the long press option.

Cheers in advance :slight_smile:

You could try the catchall pairing method, which is detailed nicely in Post 165 of this thread. It works great for pairing, though some here feel that it results in less stable performance, and devices dropping off easier. I’ve a few xiaomi devices I paired with the catchall method over a year ago that have never dropped off though.

The a4refillpad button DTH in the first post of this thread has an emulated hold function. The hold function isn’t super reliable just due to the fact that it’s emulated and the nature of potential delays in the cloud processing, and you need to have the timing right to get it to work, but it’s the only DTH I’m aware of with that capability.

1 Like

@MinerJason so fingers crossed that should work with the single press button as well then.

Cheers again.

Yes, single press works just fine with that DTH, and hold works most of the time once you figure out how long you need to hold it. I use that DTH with several buttons around my house, two acting as doorbells, and one controlling some lighting.

1 Like

Outstanding, TVM