[OBSOLETE] Xioami Zigbee Door/Window Sensor, Motion Sensor, & Smart Button Device Type

Yes, that seems to indicate either a problem with the network connection strength in that location or with the magnet alignment.

Also, I have read duplicate messages can be a symptom of problems with repeaters, again possibly because of network strength or repeaters that are incompatible with Xiaomi/Aqara products. But you said you are using Trådfri bulbs as repeaters, right? Are you using any other Zigbee devices that are repeaters?

Any interruption in the Zigbee network can lead to Xiaomi/Aqara devices dropping their connection. This is because they don’t follow the standard Zigbee protocol of rejoining the mesh when requested by the hub. That is also the reason for incompatibility with most Zigbee repeater devices, but in conjunction with Xiaomi/Aqara devices not checking in as often as the repeater devices expect.

Did your hub reboot or was there some interruption in the Zigbee network? Also, some kinds of other radio signals in the same frequency range can cause enough interference to disrupt the connections of Zigbee devices - including certain 2.4GHz WiFi channels, cordless phones, etc.

However, regardless of the reason, there is nothing that can be done to change the behavior of Xiaomi/Aqara devices not rejoining the network when requested. So the best way to handle this is to manually rejoin them.

To manually rejoin a Zigbee device, either do what @Jani explained:

or if that doesn’t work, follow the same steps as pairing (“Add a thing” in the mobile app and put the Xiaomi/Aqara device in pairing mode), but still make sure to leave the device in the hub’s device list.

As long as the entry for the device includes the ZigbeeId information:

then the hub should be able to match up the device being rejoined to that device entry. You won’t see it appear in the mobile app ready to rename as you will with a newly paired device, though. It will just be reconnected, and a new Device Network Id will be assigned to it.

Actually, my Roomba ran over the power strip switch that the ST v2 hub and WiFi router is plugged into. So that was likely what caused it. I thought the ST hub battery backup would prevent this but who knows? My WiFi is on channel 11 and Zigbee is on channel 14 so they should not interfere. However, I live in a city row home and the 2.4Ghz in very congested. I was able to reconnect 4/6 using the standard method so hopefully I can get the other two back on soon.

Interesting, so just have them close to the ST hub and use the add/search in the classic app without pressing the buttons on the ST devices? I didn’t know this was possible.

Note that this method may require a short-press of the reset button on Xiaomi/Aqara devices to “wake” them up to be seen by the hub.

Oh sorry guys. I do put them in pairing mode by keeping button pressed as long as blue led lights up.
Also I have to correct one other thing. I use trådfri bulbs as repeater with xiaomi sensors that are near my garage. These are the ones which loses their connection to ST hub in power cut situation and that’s because of relay I’m using in between.
Front door sensor which sends multiple opened or closed lines (this is btw only one from all my xiaomi sensors) does most likely have straight connection to hub because it is nearest. There’s 6 meters between front door sensor and hub. There’s 10m from hub to garage trådfri bulbs and other garage sensors. So there’s 16 meters from front door sensor to nearest trådfri bulb and there’s no other zigbee repeaters in my installation.

Got it, so this would be a solid LED blink I believe?

For most Xiaomi / Aqara devices, short-pressing the reset button will show whether it’s still paired to the hub or not. As you press the button the LED will blink, but wait for about a second for it to light up again:

  • 1 long flash = Not connected
  • 2 or 3 short flashes = Still connected

Again, that’s for most Xiaomi/Aqara devices. One exception I can think of right at the moment are the Aqara Wireless Smart Wall switches - when a button is pressed, the LED will flash only once if the device is still connected.

Thanks, those are my observations too. It also sends current data value as well if it is connected.

Is there a limit to the number of Xiaomi devices you can have connected? I know Zigbee is 32 on v2 of ST hub. I have a total of 12 Xiaomi devices.

Yes - 32 is the limit for devices connected directly to the hub. But every time you add a repeater (compatible mains powered Zigbee device) and connect through that, this limit is “reset”…
In other words… You can connect 32 devices to each mains powered Zigbee device (hub/repeaters)

Well… Actually, the number of end devices that can be connected to a Zigbee repeater depends on how that device is set up. Many repeaters have a limit that is well under 32, often in the 12-16 range from what I’ve experienced and read.

But if you are using Xiaomi / Aqara devices, it’s very important that all of the Zigbee repeater-capable devices you are using are compatible.

1 Like

Hi, did you find any spare time to add this feature? :roll_eyes:
It’s not just one sensor that does this. I have been using Alexa to announce when door opens and half of them are doing it. Some little more that others.

[veeceeoh] for Xiaomi socket appear that the energy is displayed at Watt/hour instead of kWatt/hour like the unit displayed. two solution here or change the unit to Watt/hour or multiply by 0.001

    energy = Math.round(energy * 100) * 0.01
    resultMap = createEvent(name: "energy", value: energy, unit: 'kWh')

log.debug “Energy Meter: ${energy}kWh”

1 Like

Thanks for the report! I used the second solution, and I have made some other improvements to the Xiaomi Smart Plug device handler. Please find the announcement and link to the updated code here:

[REMINDER] All Xiaomi / Aqara wireless button users

Hub Firmware 25.26 has been released for SmartThings v2 & v3 Hubs

The new firmware includes changes that “break” some functionality in the previous device handlers, but also allows for much improved functionality.

In order to fix the issues and add improved functionality, I have updated all Xiaomi / Aqara Button device handlers (DTHs). All SmartThings v2 & v3 Hub users are encouraged update to the newest DTHs immediately.

Please see this post for all details and links to the updated DTHs.

The code of these updated and improved device handlers is open source and free.
But if it has helped you, a coffee / beer donation is always very much appreciated!
PayPal: 37544ab59e07a5c90719f07501453cae3ed7b043 Venmo: @KeithPG

Sorry, I explained wrongly, should be the entire variable energy multiplied by 0.001 not replace the 0.01 for 0.001.
so the correct way should be:

energy = Math.round(energy * 100) * 0.0001
or
energy = 0.001*Math.round(energy * 100) * 0.01

Ahhh, okay. I have updated the device handler again, with no version change. That line of code now reads:

energy = Math.round(energy * 100) * 0.0001

Please let me know if the updated DTH is working for you, thanks!

I remember I probably already mentioned results in some of my posts lately but here’s again if my message wasn’t clear :slight_smile:

Taking few trådfris out from Hue and pairing them to Smartthings near Xiaomi sensors helped for those double/triple open-close log lines. I was having problems with 3-4 open close sensors. Worst were my front door and back door sensors. Trådfri bulbs are quite near my xiaomi sensors and now I do not have any additional log lines. It’s just either open or close just one time. It also made possible to use xiaomi buttons as doorbells. Without additional trådfri repeaters that wouldn’t work at all.

There is a way to disable the zigbee repeater in tradfri bulb? because when I disconnect power from the bulb using the dumb switch some xiaomi sensors goes offline.

As far as I know, there is no way to disable the repeater function of any ZigBee repeater devices on a SmartThings network.

To avoid any issues when power is cut off from repeating bulbs, I only have Sengled bulbs, which don’t have a repeater function.



So the multiple open/close message problem is solved? I am still working on a way to avoid that in the device handler, but it’s really difficult to test since my door/window sensors don’t have that behavior.

Just note that from what @Tiago_Goncalves said above, if the power is cut off to Trådfri bulbs, then any Xiaomi / Aqara devices connecting through them will go offline.

Yes, it is solved. I guess only way to test it would be taking one sensor far away enough from hub and see if that makes it.

Usually cut off for example in my home means that hub and repeaters are all off. So it doesn’t really matter if sensor is connected to hub or repeater. They all should be back online when cut off is over. Well… if cut off takes many hours then it might be issue for xiaomi sensors.

For some reason in few hour cut offs I have noticed that some of Ikea trådfri bulbs seems to be “unavailable” according ST app. When pressing “turn on” in application bulb turns on and “unavailable” status disappears. At the same time xiaomi sensors have not reported any activity or battery status to st hub but It usually start after Ikea bulb “unavailable” disappears and status in normal. It feels like xiaomi are trying to send information to ikea repeater but ikea has some problems and have to be refreshed. Have anyone else noticed this?
In short cut offs they all seems to usually come back online without problems. Especially now when I removed those residual-current relays from my system.