Xiaomi Infrared Motion Sensor

Does anyone know if these will work with the ZHA integration?

https://www.aliexpress.com/item/32827961707.html?spm=a2g0s.9042311.0.0.27424c4dOtz61U

Yep, they work with deconz, zha, z2m and practically every zigbee router device. Great little sensor with long battery life.

Not sure about the ZHA integration I have a hub. But agree solid little affordable sensor with very good battery life. I have some used in the kitchen constantly. moved and they went sleep/dormant for nearly a year. Til just moved recently. Still going strong on og battery.

I am using ZHA and I cannot get the test unit I bought from aliexpress to pair… I am wondering where to turn to for assistance or where I should post log files? I have 2 Sengled tunable white bulbs, an Osram A19 tunable white bulb and a Sonoff BASICZBR3 successfully paired and working so the basic functionality of ZHA/Conbee II would seem okay…

I can confirm they do work with ZHA. I’m running ZHA with Conbee ll and have multiple of these sensors working. Trying to remember how I paired them, I do remember they were a pain. I think I needed to keep pressing the pair button on the sensor every 1 to 2 second. It can take a dozen or more attempts to find the sensors, but it will eventually pick them up.

Thank you, thank you, THANK YOU!
Initiating paring mode with 5 second press and then pressing reset every couple of seconds got a device to show up! However, it has no triggers…


It looks like ZHA hasn’t picked it up correctly, or at least the device info is completely different from what mine are being displayed as. Interestingly I have a Hue outdoor motion sensor that when initially paired works fine but on HA reboot the device info changes to what you are seeing now: unk_model by unk_manufacturer, at that point it stops functioning.

I’m guessing this is a default signature or something and have so far been unable to fix it :frowning:

My details:

I have a xiaomi button that changes to unk_manufacturer and unk_model after HA is restarted; and then is non-functional.
Re-pairing with zha.permit doesn’t clear this even though the log says:

2020-07-25 00:49:51 INFO (MainThread) [zigpy.application] Device 0x79c9 (00:15:8d:00:00:01:02:03) joined the network

I have to remove the device in ZHA and then re-pair to get it working again.
UPDATE: Actually, it seems i need to: Remove the device, Restart HA, re-pair.

Oddly enough, I have the xiaomi vibration sensor and it has no problems after HA restarts.

My router is a CC2530+CC2591 running router firmware (very happy with this router).

Ok, I’ve found a workaround. I sniffed zha_event in node red* and saw that HA events are indeed firing when I single/double/triple tap my xiaomi button. It’s just that the events are not decoded to human-friendly names like single and double.
The events seem to contain raw number values, which i guess makes sense since HA thinks it is unk_model.

Here’s an example event:

That’s a double tap of the button, value = “0x2”. Notice device_ieee is there and correctly identifies the button that was tapped. So all i had to do was add a few nodes to switch based on the attribute_id and value.
I kept my old code too, in case the human-friendly events return someday.

At least now I don’t have to re-pair the device after HA is restarted.
Back to other things on the HA to-do list…

* Using the [events: all] node with “event type” = zha_event