Motion-Activated Hallway Lighting
Use a Zigbee PIR sensor and in-wall relay to switch a hallway light quickly, then turn it off after a quiet delay.
- Level
- Intermediate
- Active time
- 1–2 hours
- Home Assistant required
- Yes
What you will build
The two-product kit combines a Sonoff SNZB-03P motion sensor with a Sonoff ZBMINIR2 relay. The battery sensor detects movement and ambient light; the powered relay switches the existing hallway circuit and strengthens the Zigbee mesh. A compatible Zigbee coordinator is required and is not included.
1. Install and pair the relay
- Back up Home Assistant and note the current wall-switch behavior.
- Confirm that the relay fits the enclosure, the lighting load is supported, and a neutral conductor is available.
Have the ZBMINIR2 installed according to its wiring diagram. Pair it near the coordinator before closing the enclosure, name it Hallway light relay, and verify that both Home Assistant and the physical wall switch can turn the light on and off.
2. Pair and position the motion sensor
- Choose a sensor position with a clear approach path but away from radiators, direct sunlight and moving curtains.
Pair the SNZB-03P, name its motion and illuminance entities, and test the planned mounting position for at least ten passes from every direction. PIR detects movement rather than stationary presence, which is appropriate for a transit area such as a hallway.
3. Create the light-on automation
- Trigger when the motion entity changes to detected.
- Start with a simple time condition such as sunset to sunrise. Add an illuminance threshold only after observing reliable readings.
- Turn on the relay only when the light is currently off.
4. Create the delayed-off automation
Use a separate automation triggered when motion remains clear for 90 seconds, then turn the relay off. A separate off automation restarts its timer naturally when movement returns and is easier to troubleshoot than one long action sequence.
5. Commission the finished setup
- Walk the hallway slowly and quickly from every entrance.
- Confirm that new motion during the delay keeps the light on.
- Restart Home Assistant and verify that the physical wall switch still controls the circuit.
- Review false triggers for several evenings before shortening the delay.
Need a hand?
We can set up and install everything in this project. In some regions we install it ourselves — ask us.
Contact us






