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:

Smart Lights

Zigbee Coordinator (if needed)

Basic Motion-Activated Lighting Automation

Step 1: Add Your Devices to Home Assistant

  1. Install Zigbee coordinator (if using Zigbee devices)
  2. Go to Settings → Devices & Services → Add Integration → Zigbee Home Automation
  3. Put motion sensor in pairing mode (usually hold button for 5 seconds)
  4. Repeat for each light bulb

Step 2: Create the Automation

  1. Go to Settings → Automations & Scenes
  2. Click Create Automation → Create new automation
  3. Click Add Trigger → Device → Choose your motion sensor
  4. Select trigger: “Motion detected”
  5. Click Add Action → Device → Choose your light
  6. Select action: “Turn on”
  7. Save with a descriptive name like “Hallway Motion Light”

Step 3: Add Auto-Off Timer

To turn lights off after no motion:

  1. Edit your automation
  2. Add a second trigger: Device → Motion sensor → “No motion detected for 5 minutes”
  3. Add condition: Numeric State → Light brightness → Above 0 (only turn off if light is on)
  4. Add action: Device → Light → Turn off
  5. 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

  1. Go to Settings → Devices & Services → Helpers → Create Helper
  2. Choose Toggle
  3. Name it “Hallway Occupancy”
  4. Create automation to turn it ON when motion detected
  5. Create automation to turn it OFF after 10 minutes of no motion
  6. 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:

  1. Place sensors at entry points and key areas
  2. Create a group: Settings → Devices & Services → Helpers → Group → Binary Sensor Group
  3. Add all room motion sensors to the group
  4. 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:

  1. Add condition: Sun → Below horizon
  2. 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.