I’ve been using the new Xiaomi battery-powered PIR+mmWave Occupancy Sensor for the past three months, and I wanted to share my experience and some tips for integrating it with Home Assistant.
My Take: I’ve found it to be a pretty reliable sensor for my setup. Here are a few things that stood out to me (image 1/2/3 in the gallery):
Three-year battery life on a single CR2450 battery (no need for a power cord).
It supports motion detection up to 6 meters, stationary body detection at 4 meters, and light intensity reporting with a 130-degree field of view.
The smart algorithm leverages PIR for detecting motion (as PIR is better at this), while the low-energy mmWave radar maintains detection for stationary bodies.
It only supports BLE broadcast for data reporting, so there is no easy way to make it work in Home Assistant with Local Automation (before 2024.10.0 release).
I submitted a modification to HA (which is already included in the 2024.10.0 stable release), adding support for a local BLE solution. This method directly listens to the sensor’s BLE broadcasts, without relying on the cloud, allowing for local automation.
(A friend of mine also uses ‘Xiaomi Gateway 3 for Home Assistant’ integration to read the sensor’s data, but I haven’t tried it myself because it requires downgrading Xiaomi Multimode Gateway’s firmware, which I prefer not to do. However, if you have an old gateway firmware and haven’t upgraded it, you could give it a try.)
[update@2024-10-04] The change is already included in the 2024.10.0 stable release!
How to Enable “Xiaomi BLE” Integration:
Check out the Xiaomi BLE integration setup guide at Xiaomi BLE - Home Assistant . After initial setup, neither the Xiaomi Gateway nor Mi Home app is needed, and the sensor will communicate directly with HA.
To improve BLE coverage, I recommend using a Bluetooth proxy like the “M5Stack Atom Lite.” You can find more details here ( Bluetooth Proxy — ESPHome )
Additionally, after the sensor is connected to HA, you can use the “Homekit Bridge” integration to link it with the Apple Home app.
Thank you for your work to integrate these sensors into HA.
I just ordered them since I need presence detection in areas without an outlet.
Do I need a Xiaomi gateway for initial setup? The documentation from the Xiaomi BLE integration states that you need one to get the encryption keys. Though I used an Xiaomi scale and didnt need one. Just the Mii fit app for initial setup. Would be a showstopper to be honest.
[Dian] I don’t think so. The initial setup can be done on your phone. The initial encryption key is sync-ed between the cloud and the sensor by Mi Home app on your phone. After that, the encryption key can be extracted from the cloud and Xiaomi Gateway should not be required…
Thanks for the great work! Was following your changes on GitHub and finally included in 2024.10.0 release.
To anyone who doesn’t have occupancy sensors (occupancy, detection detected/cleared etc) in HA after setting up, make sure your battery cover is firmly locked (dots match each other). Spent lot of time debugging this
Hi, this sensor and integration looks great, I made local integration. It is connected to HA but I cannot see sensors(I can se just signal). What am I doing wrong:).
Thanks for help
I’m trying to add the sensor to the Mi Home app without the gateway, but it seems to not recognise the QR code on the back of the device, and it doesn’t seem to find it when I use the nearby devices feature either.
The earlier comments suggested that I might be able to do it without the gateway - am I missing something?
I’m using them for some days now, they’re pretty reliable and fast. Using them in combination with esphome bluetooth proxys.
I don’t have a gateway and just used the nearby device feature. Have you pushed the button on the sensor for a few seconds till it blinks, prior searching for devices?
The QR Code didn’t work for me either.
Don’t know if its related: I have set the country to china in the Xiaomi Home app
Android device (Pixel 7 Pro) and the same app. Strange that it doesn’t work for you.
I’m out of ideas.
Maybe try another phone. You really only need to have the devices in your account so you can extract the bind key.
Switching the region to “Chinese Mainland” (which also switch server) is required to discover the sensor in Mi Home app.
Also, please enable the phone’s bluetooth connection.
Then, the device should be discovered in “Add Device” nearby list.