Motion lighting is one of the first automations many Home Assistant users create.
A motion sensor detects movement, the light turns on, and after a few minutes without activity, the light turns off again.
It is simple, useful, and often the automation that makes people realize the potential of a smart home.
However, many motion lighting automations are still built around the hardware instead of the actual goal.
A typical automation looks like this:
“Motion sensor in the hallway changed to active → turn on hallway light.”
It works, but it creates a hidden problem.
The automation does not understand the hallway. It only understands one sensor.
As Home Assistant systems grow, this approach becomes harder to maintain. More sensors are added, rooms are changed, devices are replaced, and suddenly a simple lighting automation becomes a collection of exceptions and special cases.
A better approach is to move from sensor-based automation to room awareness.
Instead of asking:
“Did this specific motion sensor detect movement?”
we ask:
“Is there activity in this area, and what should the room do?”
This small change creates much more flexible and future-proof automations.
The Traditional Motion Lighting Approach
The classic Home Assistant motion light automation usually contains three parts:
- A motion sensor trigger
- Conditions such as time or brightness
- An action that controls a light
For example:
- Motion detected in the hallway
- Lux level below 30
- Turn on the hallway light
- Turn it off after no movement
This works well in small installations.
The problem appears when the smart home becomes larger.
Imagine a hallway with:
- One PIR motion sensor
- A door sensor
- A presence sensor
- A wall switch
- A future mmWave sensor
Which one represents “activity”?
The answer is not one specific device.
The answer is the room state.
From Sensors to Intent
The biggest change in modern Home Assistant automation design is thinking in terms of intent.
A sensor is not the goal.
A sensor provides information.
The goal is something like:
- “The hallway needs light”
- “Someone is active in the kitchen”
- “The bathroom should be comfortable at night”
This creates a layer between devices and actions.
Instead of:
Motion sensor
↓
Light
we create:
Sensors
↓
Room awareness
↓
Automation decision
↓
Light
This makes the system easier to expand.
The Components Behind Smarter Motion Lighting
Motion and Presence Sensors
The first component is still the sensor layer.
Home Assistant supports many different technologies:
- PIR motion sensors
- mmWave presence sensors
- Door and window sensors
- Bluetooth presence detection
- Device trackers
Each technology has different strengths.
A PIR sensor is excellent for detecting movement but cannot detect someone sitting still.
A mmWave sensor can detect stationary presence but may require more tuning.
The important part is that the automation should not care too much about which technology provides the information.
Groups and Binary Sensors
A powerful method is creating a combined room activity sensor.
For example:
binary_sensor.hallway_activity
This sensor could represent:
- Motion detected
- Door opened recently
- Presence detected
The automation does not need to know why the hallway is active.
It only needs to know:
“The hallway is currently in use.”
Example:
template:
- binary_sensor:
- name: Hallway Activity
state: >
{{
is_state('binary_sensor.hall_motion', 'on')
or
is_state('binary_sensor.hall_presence', 'on')
}}
Now additional sensors can be added later without rewriting every lighting automation.
Adding Intelligence With Environment Data
A good lighting automation should also understand the environment.
Turning on a light because motion was detected is not always correct.
During a bright summer day in Norway, hallway lights may not be needed.
During a dark winter evening, the same movement should immediately create comfortable lighting.
Useful information includes:
- Sun elevation
- Illuminance level
- Time of day
- Presence at home
- Sleep state
For example:
- Daytime: use natural light
- Evening: normal brightness
- Night: dim warm lighting
The same room can have different behaviour depending on the situation.
Example: A Smarter Hallway Lighting Automation
The following example combines:
- Room activity
- Low light conditions
- Different brightness levels
- Automatic turn-off
The goal:
“When someone uses the hallway, provide comfortable lighting without wasting energy.”
alias: Hallway Smart Lighting
description: Turn hallway lights on based on room activity and conditions
trigger:
- platform: state
entity_id: binary_sensor.hallway_activity
to: "on"
condition:
- condition: numeric_state
entity_id: sensor.hallway_illuminance
below: 40
action:
- choose:
- conditions:
- condition: time
after: "23:00"
before: "06:00"
sequence:
- service: light.turn_on
target:
entity_id: light.hallway
data:
brightness_pct: 20
color_temp_kelvin: 2200
default:
- service: light.turn_on
target:
entity_id: light.hallway
data:
brightness_pct: 70
color_temp_kelvin: 3000
- wait_for_trigger:
- platform: state
entity_id: binary_sensor.hallway_activity
to: "off"
- delay:
minutes: 3
- service: light.turn_off
target:
entity_id: light.hallway
This automation does not just react to movement.
It understands:
- Someone is using the hallway
- The room is dark enough to require lighting
- The time of day changes the lighting behaviour
Why This Approach Is Easier To Maintain
The biggest advantage is not that the automation becomes shorter.
The advantage is that it becomes easier to evolve.
Imagine replacing a PIR sensor with a new presence sensor.
With a traditional automation:
- Find every automation using the old sensor
- Replace entity IDs
- Test everything again
With room awareness:
- Update the room activity sensor
- The lighting automation continues working
This is especially valuable in larger Home Assistant installations.
Better Energy Management
Smart lighting is also about energy efficiency.
A single LED bulb does not use much energy. A typical smart LED light may consume around 5–10 W while active.
However, dozens of lights accidentally left on every day add up.
For example:
A 10 W light running unnecessarily for 6 hours every day:
0.01 kW × 6 hours × 365 days
= 21.9 kWh per year
Several rooms with multiple lights can quickly increase unnecessary consumption.
Good automation design reduces waste without reducing comfort.
The goal is not:
“Turn everything off.”
The goal is:
“Only use energy when the home needs it.”
The Future of Home Assistant Automations
The future of smart home automation is not more sensors.
It is better understanding.
A mature Home Assistant installation should slowly move away from:
“If this entity changes, do that.”
and toward:
“This is what is happening in my home, so make an appropriate decision.”
Motion lighting is a perfect example.
The first version is a sensor turning on a lamp.
The advanced version is a home understanding activity, environment, time, and user expectations.
That is the difference between a collection of smart devices and a truly smart home.
Some of the links in this article are "affiliate links", a link with a special tracking code. This means if you click on an affiliate link and purchase the item, we will receive an affiliate commission. The price of the item is the same whether it is an affiliate link or not. Regardless, we only recommend products or services we believe will add value to our readers. By using the affiliate links, you are helping support our Website, and we genuinely appreciate your support.
