
The Aqara RTCGQ11LM (sold in some markets as the Xiaomi Mi Motion Sensor) is a compact battery-powered Zigbee 3.0 PIR occupancy sensor using a CR2450 coin cell. It communicates with TapHome indirectly — the sensor pairs with a Zigbee2MQTT coordinator (e.g., Sonoff ZBDongle-P/E or a CC2652-based stick), which bridges the Zigbee messages to MQTT topics. TapHome subscribes to those MQTT topics via a PacketParser MQTT module.
The template maps the sensor as a binary occupancy input (motion / no motion) and exposes battery percentage, raw battery voltage and Zigbee link quality as service attributes.
Configuration
Zigbee2MQTT setup
Before importing the TapHome template, the RTCGQ11LM must be paired with a Zigbee2MQTT coordinator:
- Open the Zigbee2MQTT web UI and enable pairing mode (Permit join)
- On the RTCGQ11LM, press and hold the reset button for approximately 5 seconds, until the blue LED begins blinking
- The device appears in the Zigbee2MQTT device list with an IEEE address (e.g.,
0x00158d00036cd3e2). Optionally set a friendly name in the Zigbee2MQTT web UI under the device settings.
If pairing is unsuccessful, try a single short button press instead of a long hold. On CC2531-based coordinators, removing and reinserting the USB stick before restarting Zigbee2MQTT often fixes stuck pairing.
Module variable
After importing the template in TapHome, set the XiaomiRTCGQ11LM custom variable to identify the device on the MQTT broker:
| Variable | Description | How to obtain | Example |
|---|---|---|---|
XiaomiRTCGQ11LM | Zigbee2MQTT friendly name or IEEE address of this RTCGQ11LM | Zigbee2MQTT web UI → Devices → find RTCGQ11LM → copy IEEE or friendly name | 0x00158d00036cd3e2 |
The default placeholder in the template (0x00158d00036cd3e2) is an example and must be replaced with the actual address of your sensor. The listener script subscribes to zigbee2mqtt/{XiaomiRTCGQ11LM} and parses the JSON state payload.
Using a friendly name (e.g.
hallway_motion) instead of the raw IEEE address makes the configuration more readable and keeps it stable if the sensor is ever re-paired.
Device capabilities
Motion detection
The template maps the sensor as a Reed Contact device in TapHome. The reed-contact naming is a template-side convention; the behaviour is a standard PIR occupancy input. Motion events arrive on the zigbee2mqtt/{id} topic as JSON and are mapped to a numeric state:
| Zigbee2MQTT payload | TapHome value |
|---|---|
"occupancy": true | 1 (motion) |
"occupancy": false | 0 (idle) |
| other / missing | NaN |
The first occupancy: true message is published on the first motion event after the device joins the network — not on pairing completion.
The RTCGQ11LM hardware enforces a 60-second dead zone after every detection: once motion is reported, the sensor ignores further movement for 60 seconds. The Zigbee2MQTT
occupancy_timeoutoption should therefore be left at the default 90 s (or higher) — values below 60 s would generate anoccupancy: falsemessage while a person is still present. This limit cannot be bypassed without a hardware modification.
Battery, voltage and link quality
The sensor instance exposes three read-only service attributes parsed from the same JSON state message:
- Battery — remaining battery percentage (0–100 %), formatted as
"N%". May take up to 24 hours to report the first value after pairing. Shown as"-"until the first message arrives. - Voltage — raw battery voltage in millivolts (typically ~3000 mV on a fresh CR2450), formatted as
"N mV". Useful as an independent low-battery signal — battery percentage can still look healthy while the cell is already too weak for reliable Zigbee transmissions. - LinkQuality — Zigbee link quality indicator (0–255 LQI), formatted as
"N lqi". Values below 20 generally indicate an unreliable link.
Capabilities not currently mapped
The RTCGQ11LM also publishes the following entities via Zigbee2MQTT that are not parsed by this template — they can be added by extending the listener script in a future template revision:
illuminance/illuminance_lux— ambient light level in lux (useful for lux-gated motion automations)device_temperature— internal chip temperature in °C (diagnostic only, not ambient room temperature)power_outage_count— counter of battery-removal events
The Zigbee2MQTT availability topic (zigbee2mqtt/{id}/availability) and the occupancy_timeout configuration option (zigbee2mqtt/bridge/request/device/options) are also not handled by the template; LinkQuality and Battery are the recommended liveness signal for this sleep-capable device.
Troubleshooting
Sensor not reporting any state
- Verify the RTCGQ11LM appears in the Zigbee2MQTT device list with a green status.
- Check that the
XiaomiRTCGQ11LMvariable matches the friendly name or IEEE address exactly — it is case-sensitive for friendly names. - Trigger motion in front of the sensor. The first state message is only published on the first detection after join.
- Use an MQTT client (e.g. MQTT Explorer) to subscribe to
zigbee2mqtt/#and confirm that messages appear onzigbee2mqtt/{your_name}when motion is triggered.
Motion still active long after the person left
This is the expected 60-second hardware dead zone combined with the Zigbee2MQTT occupancy_timeout (default 90 s). The sensor does not report occupancy: false until the timeout expires with no further motion. Shorter timeouts are not reliable — the sensor simply ignores motion for the first 60 s after detection.
Random disconnections
Common causes for Aqara/Xiaomi end-devices dropping from the Zigbee mesh:
- Weak signal — check LinkQuality; values below 20 usually mean the sensor needs a closer mains-powered Zigbee router.
- Low battery voltage — the Voltage attribute is a better indicator than the percentage. Zigbee2MQTT explicitly notes that the sensor can drop from the network even while the reported battery percentage still looks healthy, so watch for a noticeable drop from the ~3000 mV fresh-cell value and replace the CR2450 when the link becomes unreliable.
- Incompatible routers — Centralite, General Electric, Iris, Ledvance, Legrand, OSRAM, Sylvania, SmartThings and Securifi routers are known to cause retention issues for older Xiaomi/Aqara devices. Bonding the sensor directly to the coordinator (reset the sensor while next to the coordinator) often resolves this.
Aqara Zigbee end-devices do not support pinging in standard Zigbee2MQTT availability mode and may appear offline even when working normally. Do not rely on the Zigbee2MQTT availability topic for liveness — use LinkQuality and Battery as health indicators instead.