---
title: "Motion-Activated Hallway Lighting - Real Home Automations"
description: "Use a Zigbee PIR sensor and in-wall relay to switch a hallway light quickly, then turn it off after a quiet delay."
canonical: "https://realhomeautomations.com/en/projects/motion-activated-hallway-lighting/"
language: en-US
updated: 2026-10-16T23:27:53+00:00
---

# Motion-Activated Hallway Lighting - Real Home Automations

Use a Zigbee PIR sensor and in-wall relay to switch a hallway light quickly, then turn it off after a quiet delay.

> Canonical HTML page: https://realhomeautomations.com/en/projects/motion-activated-hallway-lighting/

- **Difficulty:** Intermediate
- **Build time:** 1–2 hours
- **Reading time:** 8 minutes

## Tools required

- Insulated screwdriver and approved voltage tester
- Home Assistant with ZHA or Zigbee2MQTT
- Phone or laptop for live motion testing


## What readers will learn

- Choose a PIR position that avoids blind spots
- Create separate on and delayed-off automations
- Keep physical switching available during controller outages


## Skill requirements

- Basic Home Assistant entity management
- Understanding of triggers, conditions and delays
- Qualified electrical installation for the in-wall relay

## Project kit

- [Zigbee Starter Lighting Kit](https://realhomeautomations.com/en/product/zigbee-starter-lighting-kit/index.md)

## 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.

 ## Before you start

- Confirm that the relay fits the enclosure, the lighting load is supported, and a neutral conductor is available.
- Isolate and prove the circuit dead before opening any enclosure. Use a qualified electrician where required.
- Choose a sensor position with a clear approach path but away from radiators, direct sunlight and moving curtains.
- Back up Home Assistant and note the current wall-switch behavior.

 ## 1. Install and pair the relay

 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

 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.