1. SONOFF SNZB-03 configure for home assistant by Zigbee2mqtt
sensor:
- platform: mqtt
name: pir-state
state_topic: "zigbee2mqtt/0x00124b00251e530f"
value_template: "{{ value_json.occupancy }}"
Note: ID need replace with your device. such as '0x00124b00251e530f'
2. create a new automation:
create automation-1 (turn on light)
-------------------------------------------
Trigger type: State
Entity: pir-state
To: True
Actions:
Action type: Call service
Service: Switch:Switch: Turn on
+ Choose entity
create automation-2 (turn off light)
------------------------------------------
Trigger type: State
Entity: pir-state
To: False
Actions:
Action type: Call service
Service: Switch:Switch: Turn off
+ Choose entity