Motion-Activated Lighting Setup Guide
Disclosure: This post contains affiliate links. As an Amazon Associate, I earn from qualifying purchases at no additional cost to you. See our Affiliate Disclosure for details.
Why Motion-Activated Lighting?
Motion-activated lights are one of the most practical smart home automations. They improve convenience, save energy, and enhance safety—especially for hallways, bathrooms, and outdoor areas.
What You Will Need
Motion Sensors
The foundation of this automation:
- Aqara Motion Sensor P1 (Zigbee) – Fast, reliable, 2-year battery
- SONOFF Motion Sensor (Zigbee) – Budget-friendly option
- Philips Hue Motion Sensor – Works with Hue or ZHA integration
- Third Reality Motion Sensor (Zigbee) – Long range detection
Smart Lights
- Philips Hue Color Bulbs – Premium with adaptive lighting
- IKEA Tradfri LED Bulbs – Great value Zigbee bulbs
- Sengled Smart Bulbs (Zigbee) – Affordable, no hub needed with ZHA
Zigbee Coordinator (if needed)
- SONOFF Zigbee 3.0 Dongle Plus – Best bang for buck
- Home Assistant SkyConnect – Official Matter/Thread/Zigbee stick
Basic Motion-Activated Lighting Automation
Step 1: Add Your Devices to Home Assistant
- Install Zigbee coordinator (if using Zigbee devices)
- Go to Settings → Devices & Services → Add Integration → Zigbee Home Automation
- Put motion sensor in pairing mode (usually hold button for 5 seconds)
- Repeat for each light bulb
Step 2: Create the Automation
- Go to Settings → Automations & Scenes
- Click Create Automation → Create new automation
- Click Add Trigger → Device → Choose your motion sensor
- Select trigger: “Motion detected”
- Click Add Action → Device → Choose your light
- Select action: “Turn on”
- Save with a descriptive name like “Hallway Motion Light”
Step 3: Add Auto-Off Timer
To turn lights off after no motion:
- Edit your automation
- Add a second trigger: Device → Motion sensor → “No motion detected for 5 minutes”
- Add condition: Numeric State → Light brightness → Above 0 (only turn off if light is on)
- Add action: Device → Light → Turn off
- Save automation
Advanced Automation: Time-Based Brightness
Dim lights at night to avoid being blinded at 2 AM:
YAML Configuration
alias: Hallway Motion Lighting with Night Mode
triggers:
- entity_id: binary_sensor.hallway_motion
platform: state
to: "on"
conditions: []
actions:
- choose:
- conditions:
- after: "22:00:00"
before: "06:00:00"
condition: time
sequence:
- data:
brightness_pct: 20
color_temp: 454 # Warm white
target:
entity_id: light.hallway
action: light.turn_on
- conditions:
- after: "06:00:00"
before: "22:00:00"
condition: time
sequence:
- data:
brightness_pct: 100
target:
entity_id: light.hallway
action: light.turn_on
- delay:
minutes: 5
- data: {}
target:
entity_id: light.hallway
action: light.turn_off
mode: restart
What this does:
- Between 10 PM and 6 AM: Turn on at 20% brightness with warm white
- Between 6 AM and 10 PM: Turn on at 100% brightness
- Automatically turn off after 5 minutes of no motion
- Restart mode ensures the timer resets if motion is detected again
Occupancy vs Motion Detection
The Problem with Basic Motion Sensors
Standard motion sensors have a cooldown period (often 30-60 seconds) before they can detect motion again. If you are sitting still, lights turn off!
Solution: Create an Occupancy Helper
- Go to Settings → Devices & Services → Helpers → Create Helper
- Choose Toggle
- Name it “Hallway Occupancy”
- Create automation to turn it ON when motion detected
- Create automation to turn it OFF after 10 minutes of no motion
- Use this occupancy helper in your lighting automation instead of the raw motion sensor
This prevents lights from turning off while you are sitting in a room reading.
Multi-Sensor Logic
For larger rooms, use multiple motion sensors:
- Place sensors at entry points and key areas
- Create a group: Settings → Devices & Services → Helpers → Group → Binary Sensor Group
- Add all room motion sensors to the group
- Use the group entity in your automation
Lights stay on as long as ANY sensor detects motion.
Conditional Logic: Only at Night
To activate motion lighting only when it is dark:
- Add condition: Sun → Below horizon
- Or use illuminance sensor: Numeric State → Illuminance → Below 20 lux
This prevents lights from turning on during the day when natural light is sufficient.
Best Practices
- Place sensors high (7-8 feet) for better coverage
- Point sensors slightly downward to detect motion in the center of the room
- Avoid direct sunlight on PIR sensors (causes false triggers)
- Test detection range before permanently mounting
- Use occupancy logic for rooms where you sit still
- Set different brightness levels for day vs night
- Add manual override switch to disable automation when needed
Troubleshooting Common Issues
Lights Turn Off While I am in the Room
- Increase the off delay timer (try 10-15 minutes)
- Implement occupancy logic instead of raw motion
- Add additional motion sensors to cover blind spots
Lights Do Not Turn On
- Check battery level of motion sensor
- Verify sensor is triggering (check Logbook)
- Ensure light entity is available (not offline)
- Review automation traces in Settings → Automations
Too Many False Triggers
- Adjust motion sensor sensitivity (if supported)
- Move sensor away from heat sources (vents, radiators)
- Block part of the sensor lens to reduce detection range
- Add conditions like time of day or occupancy status
Inspiration: Where to Use Motion Lighting
- Hallways – Safe navigation at night
- Bathrooms – Hands-free operation
- Stairs – Critical safety feature
- Closets – Automatically light up when door opens
- Garage – Turn on when you enter from the house
- Pantry – Never fumble for a light switch again
- Outdoor paths – Security and convenience
- Laundry room – Detect when you enter with arms full of laundry
Related Tutorials
Conclusion
Motion-activated lighting is the perfect first automation project. It is practical, impressive to visitors, and teaches you the fundamentals of triggers, conditions, and actions in Home Assistant.
Start with one simple hallway light, master the basics, then expand to more complex scenarios with multiple sensors and conditional logic!
Affiliate Disclosure: This post contains Amazon affiliate links. When you purchase through these links, I may earn a small commission at no additional cost to you. This helps support the site and allows me to continue creating Home Assistant tutorials. All recommendations are based on personal experience and research. See our full disclosure policy.