3 min read

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

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

  1. The relay is installed on the night lamp’s circuit.
  2. 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.
  3. Place the sensor so that it detects a person leaving the room and doesn’t see the night lamp itself.
  4. 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.
  5. 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

Related projects

Project kit

Original price was: 33,80 €.Current price is: 32,12 €.
View parts

What you need

Night Light Kit – Sonoff (motion sensor + relay)

Original price was: 33,80 €.Current price is: 32,12 €.

Added to cart

Real Home Automations

Sign in to your account

With a code sent to your email

Continue with Google
or

By continuing, you accept the Terms and Conditions and the Privacy Policy.