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.
Product links:
- https://www.aliexpress.com/item/1005007294321293.html or https://www.aliexpress.com/item/1005007104780534.html
- https://detail.tmall.com/item.htm?abbucket=13&id=799439604767 or https://www.mi.com/shop/buy/detail?product_id=19994
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, but there are a couple of ways to make it work in Home Assistant (HA).
Option 1: Cloud-based Solution with “Xiaomi Miot Auto”
The easy way to add the sensor to HA is to use “miot-auto” integration (at GitHub - al-one/hass-xiaomi-miot: Automatic integrate all Xiaomi devices to HomeAssistant via miot-spec, support Wi-Fi, BLE, ZigBee devices. 小米米家智能家居设备接入Hass集成 ), but it only support poll-based sensor data reading from the xiaomi cloud, which is not only slow but also reduce reliability. There are a lot of public articles to tell how to use it, and I assume any HA user can figure it out.
And, to ensure its low latency for (sensor → switch/light automation), I set the polling interval to 1 second in configuration.yaml brutally and it does work most of the time.
Customize via device model
xiaomi_miot:
# https://github.com/al-one/hass-xiaomi-miot/blob/96ae163cf2823c97561b5dabea25085d66ba7d32/custom_components/xiaomi_miot/core/device_customizes.py
device_customizes:
xiaomi.sensor_occupy.03:
interval_seconds: 1 # Seconds between each update state (Requires reload config entry)
Option 2: Local BLE Solution (Highly Recommended)
I submitted a modification to HA (which will most likely be included in the 2024.10.0 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.)
Since HA 2024.10.0 release isn’t officially released yet, you can try it out by either using the nightly dev container or my custom branch. The custom branch is based on the stable 2024.8.3 build, with cherry-picked commits specifically for the sensor.
-
HA dev container (Nightly): The easiest method if you’re comfortable with a dev build. (see image 4 in the gallery for details)
-
My custom branch: If you’re worried about dev build stability, you can use my private branch ( GitHub - ldfandian/homeassistant-core at 2024.8.3-xiaomi-ble-0.32.0 ).
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.
Feel free to ask if you need further details on the setup.
Enjoy~