A night light that guides you to the bathroom without waking you
A motion sensor switches on a dim light along the way to the bathroom at night. The Sonoff kit contains an SNZB-03PR2 sensor with a light sensor and a ZBMINIR2 Zigbee relay.
- Level
- Intermediate
- Active time
- 45–90 minutes
- Home Assistant required
- Optional
You get up at night to go to the bathroom. The ceiling light is too bright and wakes the others. Motion in front of the room switches on a dim, separate light only at night, and during the day the ordinary switch remains.
What you will get
A motion sensor switches on a small lamp or strip along the way to the bathroom at night and switches it off after a pause without motion. The relay only switches on and off, it does not dim. That is why the night light is a separate source on its own circuit: a plinth strip or a small lamp.
What we need
- The Sonoff “Night light” kit, which contains:
- Sonoff SNZB-03PR2 – a motion sensor with a light sensor, Zigbee 3.0, CR2477 battery;
- Sonoff ZBMINIR2 – a 10 A Zigbee relay, neutral wire required.
- A night lamp or strip on a separate circuit and a relay for it.
You need a Zigbee hub or Home Assistant with a Zigbee adapter.
How it works
The logic is one: motion → if it is dark → switch on the night lamp → switch it off after a pause without motion. Sonoff describes the SNZB-03PR2 with a separate light sensor (conditions in lux), a cooldown between two detections of 5 to 60 seconds, a range of 6 m and an angle of 120°.
How it is at our place
In Marto’s Home Assistant the hallway uses the “Sensor light” blueprint: during the day a normal scene with an off delay of 1.5 minutes, and in a “sleep lighting” period a night scene with a delay of 0.5 minutes. The night lamps there are dimmable and glow at 1%. A relay can’t do that, so here the night light is separate.
Steps
- The relay is installed on the night lamp’s circuit.
- Pair the sensor and the relay with the Zigbee hub or in Home Assistant. Expect the sensor to show “motion” and illuminance, and the relay a switch for turning on.
- Place the sensor so that it detects a person leaving the room and doesn’t see the night lamp itself.
- Automation: trigger – motion; condition – dark (a threshold in lux, an example value, measure it at your place) or hours; action – switch the relay on; switch off after a pause without motion, for example from 30 seconds to 2 minutes.
- The normal lighting stays on the wall switch.
Checking the result
- Walk through the area during the day: the night lamp shouldn’t come on.
- Walk through at night: it comes on within seconds and goes out after the pause.
- Take the battery out of the sensor: the night lamp stays off, and the wall switch turns on the normal lighting.
If it doesn’t work
- The sensor doesn’t pair → the hub is far away → bring it closer for pairing.
- The lamp is on and triggers the sensor again → the sensor sees it → move it.
- Delay or no detection → weak battery or weak Zigbee signal → replace the battery and check the network.
Limitations
- The sensor detects motion of animals too.
- Without the Zigbee hub or Home Assistant the automation doesn’t work, but the wall switch does.
Sources and verification status
Checked against the Sonoff and Home Assistant documentation, 22.11.2026.
At home
MartoSince April 2026
In Home Assistant the hallway uses the "Sensor light" blueprint with a night scene. The night lamps there are dimmable to 1%; a relay only switches on and off, so this project is different.
Need a hand?
We can set up and install everything in this project. In some regions we install it ourselves — ask us.
Contact us



