What it exposes
| Feature | Property | Values | Control |
|---|---|---|---|
| Presence | presence | — | read only |
| Motion | occupancy | — | read only |
| Closest target distance | closest_target_distance | m | read only |
| Movement timeout | movement_timeout | s · 0…43200 | settable |
| Idle timeout | idle_timeout | s · 0…43200 | settable |
| Illuminance | illuminance | lx | read only |
| Far movement sensitivity | far_movement_sensitivity | 0…10 | settable |
| Near movement sensitivity | near_movement_sensitivity | 0…10 | settable |
| Near presence sensitivity | near_presence_sensitivity | 0…10 | settable |
| Far presence sensitivity | far_presence_sensitivity | 0…10 | settable |
| Closest detection distance | closest_detection_distance | m · 0.1…7 | settable |
| Largest movement detection distance | largest_movement_detection_distance | m · 0.1…7 | settable |
| Largest presence detection distance | largest_presence_detection_distance | m · 0.1…7 | settable |
| Restore factory | restore_factory | — | settable |
| Led indicator | led_indicator | — | settable |
MQTT: state and commands
Zigbee2MQTT publishes the device state to zigbee2mqtt/my_device (my_device is the name you give the device). An example message:
{
"presence": false,
"occupancy": false,
"closest_target_distance": 0,
"movement_timeout": 21600,
"idle_timeout": 21600,
"illuminance": 120,
"far_movement_sensitivity": 5,
"near_movement_sensitivity": 5,
"near_presence_sensitivity": 5,
"far_presence_sensitivity": 5,
"closest_detection_distance": 4,
"largest_movement_detection_distance": 4,
"largest_presence_detection_distance": 4,
"restore_factory": false,
"linkquality": 120
}
Send commands to zigbee2mqtt/my_device/set:
mosquitto_pub -t zigbee2mqtt/my_device/set -m '{"restore_factory":true}'
mosquitto_pub -t zigbee2mqtt/my_device/set -m '{"led_indicator":true}'
Watch the topics live from the browser: MQTT client.
Home Assistant automation example
Zigbee2MQTT creates Home Assistant entities from the device name. If it is called my_device, an automation in automations.yaml can look like this:
- alias: "Light on motion"
mode: single
triggers:
- trigger: state
entity_id: binary_sensor.my_device_occupancy
to: "on"
conditions:
- condition: sun
after: sunset
actions:
- action: light.turn_on
target:
entity_id: light.hallway
Check the YAML: YAML checker.
How to pair it
- In Zigbee2MQTT click Permit join.
- Put the device in pairing mode: usually a long press of the reset button (5–10 s) until the LED blinks; bulbs: switch the power off and on 5–6 times.
- Keep the device close to the coordinator or a router while pairing.
- Give it a clear name: MQTT topics and Home Assistant entities are built from it.
Exact procedure and model notes: the device page in the Zigbee2MQTT docs. No coordinator yet: coordinator picker.