Skip to content
SmartAbodeLab

SmartAbodeLab

Search the lab

Search titles, categories, tags, protocols, devices, and questions.

How to Automate Lights Based on Motion and Ambient Room Brightness

Build smarter lighting that turns on only when a room is occupied and actually dark. This guide combines motion or presence sensing, ambient lux thresholds, timeouts, hysteresis, and Home Assistant automation logic.

Daniel Reed

Smart Home & Urban Living Editor

13 min read
Smart LightingMotion SensorsPresence SensorsHome AssistantIlluminance

Advertisement

Top Banner Slot · 728 × 90

Smart living room with a motion sensor, ambient-light sensor, phone automation interface, and warm smart lamp responding to low room brightness

Quick answer

The most reliable motion-based smart-lighting automation uses occupancy as the trigger, ambient illuminance as a condition, and a no-motion or no-presence delay as the off rule. For example, Home Assistant can turn a room light on when motion is detected only if measured illuminance is below a chosen lux threshold, then turn the light off after the room has been unoccupied for several minutes. For rooms where people sit still, a presence sensor is usually better than PIR motion. Add separate on/off lux thresholds or hysteresis so the lights do not repeatedly toggle when ambient brightness sits near the cutoff.

Table of contents
  1. First: Illuminance Is Not the Same as Light Brightness
  2. Illuminance
  3. Brightness
  4. The Core Automation Logic
  5. Trigger
  6. Condition
  7. Action
  8. Off rule
  9. Home Assistant 2026 Makes Lux Logic Easier
  10. What Lux Threshold Should You Use?
  11. Better calibration method
  12. Useful Starting Ranges
  13. Hallway / stairs
  14. Bathroom
  15. Kitchen
  16. Living room
  17. Office
  18. Sensor Placement Is More Important Than Threshold Precision
  19. The feedback-loop problem
  20. Use Hysteresis Around the Lux Threshold
  21. Turn-on threshold
  22. Bright-again threshold
  23. Why natural light changes slowly
  24. PIR Motion vs. Presence Sensing
  25. PIR Motion Sensor
  26. Failure example
  27. mmWave / Presence Sensor
  28. The advantage
  29. Motion for Arrival, Presence for Continued Occupancy
  30. PIR
  31. Presence sensor
  32. Room-by-Room Timeout Recommendations
  33. Hallway
  34. Stairway
  35. Pantry
  36. Laundry
  37. Bathroom
  38. Kitchen
  39. Office
  40. Living room
  41. Do Not Turn Lights Off Just Because the Room Becomes Bright
  42. Natural daylight exception
  43. The Best Starter Home Assistant Automation
  44. Why mode: restart Can Be Useful
  45. The Important Edge Case: Room Gets Dark While Already Occupied
  46. Solution
  47. Use Persistence for Passing Clouds
  48. Philips Hue Uses the Same General Pattern
  49. Use Different Scenes by Time of Day
  50. Day
  51. Evening
  52. Night
  53. Example Night Hallway Logic
  54. Manual Override Matters
  55. Add an override strategy
  56. Never Remove Physical Light Control
  57. Avoid Automating Lights from a Cloud-Only Path
  58. Sensor Placement for PIR
  59. Sensor Placement for Lux
  60. Sensor Placement for mmWave
  61. Hysteresis Example in Practice
  62. Turn on
  63. Stay on
  64. Optional daylight dim
  65. Turn off
  66. Gradual Dimming Is Better Than Hard Switching
  67. Energy Savings: Keep Expectations Realistic
  68. Best Rooms to Automate First
  69. Hallway
  70. Stairs
  71. Pantry
  72. Garage
  73. Laundry
  74. Bathroom
  75. Office
  76. Living room
  77. Troubleshooting: Light Turns On During Day
  78. Troubleshooting: Light Never Turns On
  79. Troubleshooting: Light Turns Off While I Am Still There
  80. Troubleshooting: Lights Flicker Around Sunset
  81. Recommended Room Profiles
  82. Final Automation Checklist
  83. Conclusion

Key takeaways

  • Motion should normally trigger the automation; illuminance should decide whether artificial light is actually needed.
  • Home Assistant's 2026 Illuminance integration provides native lux triggers and conditions, making threshold-based lighting easier to build without custom templates.
  • PIR sensors are ideal for transitory spaces, while mmWave/presence sensors are better when occupants may remain still.
  • Use separate thresholds or hysteresis around the lux cutoff to prevent rapid toggling caused by passing clouds or the light itself affecting the sensor.
  • Do not automatically turn lights off merely because lux rises while someone is still using the room; occupancy and manual override should normally outrank daylight automation.

Editorial transparency

Who worked on this article and how it was handled.

Editorial policy →
Written by
Creation method
Editorial research

AI assistance: AI assisted with research organization and drafting. Sensor behavior, platform-specific automation syntax, device compatibility, and the final article should be reviewed by a human editor before publication.

Automatic lighting feels genuinely smart only when it gets two questions right:

  1. Is somebody actually using the room?
  2. Is the room dark enough to need artificial light?

A basic motion automation answers only the first question.

That is why many first smart-lighting setups behave badly:

  • lights turn on at noon;
  • a passing person triggers a fully lit room;
  • a hallway light stays on too long;
  • an office light switches off while someone sits still;
  • a cloud lowers the room brightness for ten seconds and the lights suddenly jump on.

The better approach combines occupancy with ambient illuminance.

In Home Assistant terms, that usually means:

Motion or presence = trigger
Lux = condition
Light = action
No occupancy for a defined period = turn-off rule

Once those four pieces are right, you can add refinements such as:

  • day/night brightness;
  • warm nighttime color temperature;
  • hysteresis;
  • manual override;
  • room-specific timeouts;
  • gradual transitions.

First: Illuminance Is Not the Same as Light Brightness

This distinction is easy to miss.

Illuminance

Illuminance is the measured light already present in the room.

It is normally reported in:

lux (lx)

Examples:

  • sunlight from a window;
  • daylight from an overcast sky;
  • existing artificial light reaching the sensor.

Home Assistant’s current Illuminance integration explicitly treats illuminance as an input used for triggers and conditions.

Brightness

Brightness is the output level you command the smart light to produce.

In Home Assistant, light brightness can be controlled as:

  • percentage;
  • or the platform’s underlying brightness value.

So the automation relationship is:

Measured lux says whether light is needed.
Light brightness says how much artificial light to add.

They are different variables.

The Core Automation Logic

The simplest good automation is:

Trigger

Motion detected.

Condition

Ambient light below threshold.

Action

Turn lights on.

Off rule

No motion for a defined delay.

A practical hallway example:

Motion detected
AND room illuminance below 40 lux
→ light on at 70%

Then:

No motion for 2 minutes
→ light off

That already behaves much better than:

Motion detected → light on.

Home Assistant 2026 Makes Lux Logic Easier

Home Assistant introduced a dedicated Illuminance integration in 2026.4.

It provides native automation concepts such as:

  • illuminance changed;
  • illuminance crossed threshold;
  • light level detected;
  • lux-based conditions.

That means you can build brightness-aware lighting in the visual automation editor without creating custom template sensors for normal use cases.

You can still use standard numeric-state conditions where appropriate.

What Lux Threshold Should You Use?

Do not copy a random internet number and assume it is correct.

The measured value depends heavily on:

  • sensor model;
  • mounting direction;
  • proximity to windows;
  • proximity to the controlled light;
  • room surface colors;
  • sensor calibration.

A sensor reading 35 lux in one room may correspond to a very different perceived brightness than another sensor reading 35 lux elsewhere.

Better calibration method

For three to five days:

  1. leave the automation disabled;
  2. watch the lux sensor;
  3. notice the moment you naturally want to turn the light on;
  4. record the lux reading;
  5. repeat at different times and weather conditions.

Then choose a starting threshold near those observations.

Useful Starting Ranges

These are starting points, not standards.

Hallway / stairs

Try:

  • 20-50 lux.

These spaces normally need only enough light for safe movement.

Bathroom

Try:

  • 30-70 lux.

Nighttime should often use a much dimmer scene.

Kitchen

Try:

  • 50-120 lux.

Task lighting needs differ significantly from hallway lighting.

Living room

Try:

  • 40-100 lux.

The right threshold depends heavily on window area and desired mood.

Office

Try:

  • 80-150 lux before supplemental lighting begins.

A desk may require much higher task illuminance than the sensor reports for the room overall.

The goal is not to meet a professional lighting-design standard through one ceiling sensor.

The goal is to detect when your normal room light is insufficient.

Sensor Placement Is More Important Than Threshold Precision

A perfectly tuned threshold cannot fix a badly placed sensor.

Avoid placing the illuminance sensor:

  • directly under the lamp it controls;
  • facing a bright window at close range;
  • inside a dark cabinet;
  • behind furniture;
  • beside an LED indicator.

The feedback-loop problem

Suppose the sensor is under the ceiling light.

Before the light turns on:

  • 25 lux.

Automation turns light on.

Sensor now reports:

  • 160 lux.

If your automation says:

Above 80 lux → light off

the light turns off.

The sensor falls back to:

  • 25 lux.

The light turns on again.

That is classic control oscillation.

You need either:

  • better sensor placement;
  • hysteresis;
  • logic that does not use the controlled light’s lux increase as an immediate off trigger.

Use Hysteresis Around the Lux Threshold

Hysteresis means using different thresholds for entering and leaving a state.

Example:

Turn-on threshold

Below 40 lux

Bright-again threshold

Above 70 lux

The gap between 40 and 70 creates stability.

A reading that moves:

39 → 42 → 38 → 45

does not repeatedly flip the automation.

Why natural light changes slowly

Clouds, blinds, dawn, and changing sun angles can make lux readings hover around the same number for long periods.

A single exact cutoff is unnecessarily fragile.

PIR Motion vs. Presence Sensing

The occupancy sensor changes how you should write the automation.

PIR Motion Sensor

PIR detects changes in infrared energy caused by movement.

Excellent for:

  • hallway;
  • stairs;
  • garage;
  • pantry;
  • laundry room;
  • entry.

Weakness:

  • a seated person can eventually stop generating enough movement.

Failure example

You sit at a desk reading.

Motion sensor changes to:

  • no motion.

After five minutes:

  • office light turns off.

You wave your hand.

Light returns.

That is not smart lighting.

mmWave / Presence Sensor

Presence sensors can detect much smaller movement.

Aqara’s FP2, for example, uses mmWave radar and can expose occupancy zones and illuminance data.

Better for:

  • office;
  • living room;
  • bathroom;
  • bedroom reading area;
  • dining area.

The advantage

The off condition becomes:

no presence

rather than:

no recent large movement.

That is a much closer representation of actual occupancy.

Motion for Arrival, Presence for Continued Occupancy

An advanced room can use both.

PIR

Fast entry trigger.

Presence sensor

Keeps the room considered occupied.

Example:

PIR detects entry while lux < 60 → lights on

Then:

mmWave reports no presence for 8 minutes → lights off

This combines fast triggering with reliable continued occupancy.

Room-by-Room Timeout Recommendations

Timeout should match room behavior.

Hallway

1-2 minutes

People pass through.

Stairway

1-3 minutes

Long enough to avoid darkness mid-trip.

Pantry

1-3 minutes

Short occupancy.

Laundry

3-8 minutes

You may stand relatively still while sorting clothing.

Bathroom

5-15 minutes with PIR

Shorter is risky if motion detection cannot see through a shower enclosure.

Presence sensing improves this significantly.

Kitchen

5-15 minutes

Activity comes in bursts.

Office

10-30 minutes with PIR

Or use presence sensing instead.

Living room

Use presence.

A simple PIR timeout is usually the wrong tool for long seated occupancy.

Do Not Turn Lights Off Just Because the Room Becomes Bright

Consider:

  1. person enters;
  2. room is 30 lux;
  3. lights turn on;
  4. sensor now measures 120 lux.

If the automation turns lights off because lux is now high, the system will fight itself.

A better design uses illuminance mainly to decide whether lights should turn on.

Then the off logic is primarily based on:

  • occupancy;
  • manual action;
  • scene change;
  • explicit daylight-transition automation.

Natural daylight exception

You can add a separate daylight-saving automation:

Room occupied
AND natural illuminance stays above 250 lux for 10 minutes
→ gradually dim artificial lighting.

This is more sophisticated than immediately switching off at a threshold.

The Best Starter Home Assistant Automation

Entity examples:

  • binary_sensor.hall_motion
  • sensor.hall_illuminance
  • light.hall

Conceptual YAML:

alias: Hall - Motion + Lux Lighting
mode: restart

triggers:
  - trigger: state
    entity_id: binary_sensor.hall_motion
    to: "on"

conditions:
  - condition: numeric_state
    entity_id: sensor.hall_illuminance
    below: 40

actions:
  - action: light.turn_on
    target:
      entity_id: light.hall
    data:
      brightness_pct: 70

  - wait_for_trigger:
      - trigger: state
        entity_id: binary_sensor.hall_motion
        to: "off"

  - delay: "00:02:00"

  - action: light.turn_off
    target:
      entity_id: light.hall
    data:
      transition: 2

The idea is more important than the entity names.

Why mode: restart Can Be Useful

Home Assistant supports several automation modes.

restart means that if the automation runs again, the current run is stopped and restarted.

For occupancy lighting, that can be useful when a new motion event should effectively refresh the automation sequence.

The exact best structure depends on how your sensor reports:

  • repeated motion;
  • occupied/unoccupied;
  • clear delays.

Do not copy one YAML pattern blindly across every sensor type.

The Important Edge Case: Room Gets Dark While Already Occupied

This catches many otherwise good automations.

Imagine:

  1. you enter at 4 p.m.;
  2. room is bright;
  3. motion trigger fires;
  4. lux condition fails;
  5. no lights turn on;
  6. you remain in the room;
  7. a storm arrives;
  8. lux drops below threshold.

If your only trigger is:

motion changed off → on

nothing happens because occupancy never changed.

Solution

Add a second trigger:

  • occupancy becomes active;
  • OR lux crosses below the dark threshold.

Then conditions verify:

  • room is occupied;
  • lux is low.

Conceptually:

triggers:
  - trigger: state
    entity_id: binary_sensor.office_presence
    to: "on"

  - trigger: numeric_state
    entity_id: sensor.office_illuminance
    below: 60

conditions:
  - condition: state
    entity_id: binary_sensor.office_presence
    state: "on"

  - condition: numeric_state
    entity_id: sensor.office_illuminance
    below: 60

actions:
  - action: light.turn_on
    target:
      entity_id: light.office

This is one of the biggest improvements you can make in a daylight-aware occupied room.

Use Persistence for Passing Clouds

Home Assistant’s numeric-state triggers support a for duration.

Instead of:

Lux < 60 → immediately turn on

use:

Lux < 60 for 1 minute → consider the room dark.

That avoids reacting to:

  • someone blocking the sensor;
  • one dark cloud;
  • a curtain moving briefly.

Example:

trigger: numeric_state
entity_id: sensor.office_illuminance
below: 60
for: "00:01:00"

For some rooms:

  • 30 seconds is enough.

For daylight dimming:

  • 5-10 minutes may feel smoother.

Philips Hue Uses the Same General Pattern

Philips Hue’s official motion-sensor controls expose:

  • motion sensitivity;
  • daylight sensitivity;
  • different day/night behavior;
  • after-motion timer.

That is essentially the same control model:

Detect occupancy
Check daylight
Choose lighting scene
Wait after occupancy ends
Turn off

You do not need Home Assistant to benefit from this design.

Home Assistant simply gives you more control over how the inputs interact.

Use Different Scenes by Time of Day

Ambient lux answers:

Do I need artificial light?

Time answers:

What kind of artificial light do I want?

Day

If room is dark because of weather:

  • 70-100% brightness;
  • neutral or cooler white where appropriate.

Evening

  • 40-70%;
  • warmer color temperature.

Night

  • 5-20%;
  • very warm light;
  • only necessary fixtures.

A 2 a.m. bathroom trip should not trigger the same scene as a dark 3 p.m. thunderstorm.

Example Night Hallway Logic

Conditions:

  • motion detected;
  • lux < 10;
  • time between midnight and 6 a.m.

Action:

  • light at 10%;
  • warmest comfortable color;
  • 60-second timeout.

This improves:

  • comfort;
  • night vision;
  • household disturbance.

Manual Override Matters

Bad automation fights the person.

Good automation respects them.

Scenario:

You manually turn the living-room light off while watching a movie.

Five seconds later:

  • motion sensor detects movement;
  • automation turns the light back on.

Annoying.

Add an override strategy

Possible approaches:

  • manual override helper;
  • automation pause timer;
  • scene/mode such as Movie;
  • detect manual switch behavior;
  • disable occupancy automation while a special scene is active.

Example:

Movie mode active → motion lighting disabled.

This is often more valuable than adding another sensor.

Never Remove Physical Light Control

Smart bulbs are vulnerable to one classic mistake:

Someone uses the wall switch.

Power disappears.

The bulb:

  • goes offline;
  • cannot respond to automation.

For frequently automated ceiling fixtures, consider:

  • smart switch;
  • smart relay;
  • smart dimmer;

rather than relying exclusively on smart bulbs behind a normal wall switch.

The right hardware depends on:

  • neutral wire;
  • bulb type;
  • dimming requirements;
  • electrical code.

Use a qualified electrician where required.

Avoid Automating Lights from a Cloud-Only Path

Lighting is one of the smart-home systems that benefits most from local execution.

You notice latency immediately.

A useful path is:

sensor → local controller/hub → light

rather than:

sensor → internet → vendor cloud → another cloud → light

Local automation improves:

  • response time;
  • outage resilience;
  • consistency.

Philips Hue, Aqara’s supported local ecosystem, Zigbee, Matter, and Home Assistant can all participate in local architectures depending on the exact setup.

Sensor Placement for PIR

Mount where people cross the sensor’s field of view.

PIR generally detects lateral movement better than someone moving directly toward the sensor.

Good positions:

  • corner facing doorway;
  • wall angled across walking path;
  • hallway entry.

Avoid:

  • HVAC vents;
  • heating sources;
  • direct sunlight;
  • moving curtains;
  • pets if sensor placement creates false triggers.

Use the manufacturer’s recommended height and orientation.

Sensor Placement for Lux

The light sensor should represent useful room brightness.

Good:

  • room-facing;
  • indirectly exposed to window light;
  • away from lamp beam.

Bad:

  • directly beside the smart bulb;
  • pointed at outdoor sun;
  • under furniture;
  • behind a monitor.

If a combined motion/lux sensor is in an unavoidable bad position, use:

  • a separate illuminance sensor;
  • another room sensor;
  • sun/time conditions as secondary logic.

Sensor Placement for mmWave

Presence sensors are powerful but require more tuning.

They may detect:

  • movement through thin walls;
  • ceiling fans;
  • curtains;
  • adjacent zones;
  • pets;
  • robots.

Aqara FP2 supports configurable zones, making it possible to distinguish areas such as:

  • sofa;
  • desk;
  • bed.

That can create much richer lighting.

Example:

Desk occupied + lux < 120 → desk lamp on.

while:

Sofa occupied + TV playing → ambient lights at 20%.

One room can have multiple occupancy behaviors.

Hysteresis Example in Practice

Suppose the living room feels dark below 50 lux.

Use:

Turn on

Occupied AND:

  • lux below 50 for 30 seconds.

Stay on

While occupied:

  • ignore lux changes from the controlled lights.

Optional daylight dim

If:

  • natural lux above 180 for 5 minutes;
  • room still occupied;

then:

  • dim lighting gradually.

Turn off

No presence for:

  • 8 minutes.

This creates much more natural behavior than continuously chasing one sensor number.

Gradual Dimming Is Better Than Hard Switching

Home Assistant light actions support transitions.

Instead of:

100% → off instantly

try:

100% → 30% over 2 seconds
then off after a brief delay.

Why?

The dim step gives occupants feedback:

The system thinks the room is empty.

If someone is still there, new motion/presence can cancel or restart the automation.

This feels much less abrupt.

Energy Savings: Keep Expectations Realistic

Motion and daylight-aware control can reduce unnecessary lighting runtime.

But savings depend on:

  • bulb wattage;
  • occupancy habits;
  • daylight availability;
  • how often people currently forget lights.

If your entire home already uses 5-10W LEDs and everyone reliably turns them off, the financial savings may be modest.

The biggest benefit can be:

  • convenience;
  • consistency;
  • fewer unnecessary hours.

Do not promise a fixed percentage reduction without measured baseline data.

Best Rooms to Automate First

Hallway

Excellent first project.

Why:

  • obvious occupancy pattern;
  • short timeout;
  • low false-off risk.

Stairs

Strong safety/convenience value.

Use sensors covering both approaches if needed.

Pantry

High success rate.

Garage

Useful if sensor coverage is reliable.

Laundry

Good.

Bathroom

Better with presence than basic PIR.

Office

Use mmWave/presence.

Living room

Only after you have:

  • presence sensing;
  • manual overrides;
  • scene logic.

Start where behavior is simple.

Troubleshooting: Light Turns On During Day

Check:

  1. lux threshold too high;
  2. sensor facing dark corner;
  3. light sensor covered;
  4. automation does not actually include lux condition;
  5. stale/unavailable illuminance entity.

Lower threshold only after verifying sensor placement.

Troubleshooting: Light Never Turns On

Check:

  1. motion entity actually changes;
  2. lux is numeric and available;
  3. threshold direction is correct;
  4. automation conditions pass;
  5. controlled entity is the light, not an unrelated device;
  6. smart bulb still has power.

Home Assistant traces are especially useful here.

Troubleshooting: Light Turns Off While I Am Still There

Likely causes:

  • PIR cannot detect still occupancy;
  • timeout too short;
  • sensor blocked;
  • room too large.

Fix order:

  1. improve sensor placement;
  2. increase timeout;
  3. add second motion sensor;
  4. upgrade to presence detection if room behavior requires it.

Do not use a 60-minute timeout to hide an occupancy-sensing problem.

Troubleshooting: Lights Flicker Around Sunset

Likely:

  • lux threshold too tight;
  • no hysteresis;
  • sensor sees controlled lamp;
  • cloud brightness changes.

Fix:

  • separate on/off thresholds;
  • add persistence;
  • relocate sensor;
  • do not use instant high-lux off logic.
Room Sensor Start threshold Off delay
Hallway PIR + lux 30-50 lx 1-2 min
Stairs PIR + lux 20-50 lx 1-3 min
Pantry PIR 20-50 lx 1-2 min
Bathroom Presence + lux 30-70 lx 5-10 min
Kitchen PIR/presence + lux 50-120 lx 5-15 min
Office Presence + lux 80-150 lx 10-20 min
Living room Presence + lux 40-100 lx 8-20 min
Garage PIR + lux 20-60 lx 3-10 min

Treat these as calibration starting points only.

Final Automation Checklist

  • Occupancy sensor reliably covers the room.
  • Illuminance sensor represents actual room daylight.
  • Motion/presence triggers the lighting decision.
  • Lux determines whether artificial light is needed.
  • Lux threshold was calibrated from real room observations.
  • A second lux trigger handles rooms that become dark while already occupied.
  • Persistence prevents reactions to brief brightness changes.
  • Hysteresis prevents threshold oscillation.
  • Timeout matches actual room behavior.
  • Seated rooms use presence sensing or sufficiently robust occupancy logic.
  • Manual override or special scenes can suppress automation.
  • Nighttime brightness is lower than daytime brightness.
  • Physical switches still provide normal control.
  • Critical automation works locally where practical.
  • Light transitions are smooth rather than abrupt.

Conclusion

The best automatic lighting rule is not:

motion means light.

It is:

occupancy means evaluate whether light is needed.

Use motion or presence to establish that someone is using the space.

Use ambient illuminance to decide whether natural light is sufficient.

Then use room-specific timeout, brightness, color temperature, and manual override rules to make the lighting feel intentional.

For simple spaces such as hallways and pantries, a PIR sensor plus lux threshold may be all you need.

For offices, bathrooms, and living rooms, presence sensing produces a much better result because people often remain still.

Home Assistant’s newer illuminance triggers and conditions make the logic easier to implement, but the fundamentals remain platform-independent:

occupancy → measure daylight → light only when needed → stay on while occupied → turn off gracefully.

When those rules are tuned correctly, you stop noticing the automation.

The room is simply bright when you need it—and dark when you do not.

Common questions

Questions this guide answers

What lux level should trigger smart lights?

There is no universal threshold because sensor placement and room use matter. A practical starting point is roughly 30-80 lux for hallways and utility spaces, then tune the number by observing the actual sensor value at the moment you naturally reach for the light switch. Use the measured room value rather than copying another person's threshold.

Should I use motion or presence detection for automatic lights?

PIR motion sensors work well in hallways, stairs, closets, garages, and other spaces where people keep moving. Presence or mmWave sensors are better in offices, living rooms, bathrooms, and reading areas because they can detect small movements or continued occupancy when a person is sitting still.

Why do my motion lights turn on during the day?

The automation is probably using motion as the only condition, or the light sensor is poorly placed. Add an illuminance condition so motion turns lights on only below a lux threshold, and position the sensor where it measures useful room daylight rather than directly facing a lamp or bright window.

How do I stop lux-based lights from flickering on and off near the threshold?

Use hysteresis: one lower threshold for turning lights on and a higher threshold for suppressing or turning them off. For example, allow lights to turn on below 40 lux but do not consider the room bright again until it rises above 70 lux. Also use short persistence timers so a passing cloud does not immediately change the lighting state.

Evidence & further reading

Sources & references

Primary and authoritative references used to support or contextualize this article. Links open the original source.

  1. 1
    Illuminance

    Home Assistant · Accessed Aug 12, 2026

    Supports Home Assistant's 2026 Illuminance integration, lux-based triggers and conditions, and the distinction between measured illuminance and controllable light brightness.

  2. 2
    Automation triggers

    Home Assistant · Accessed Aug 12, 2026

    Supports using motion/state events and multiple triggers to start an automation.

  3. 3
    Numeric state

    Home Assistant · Accessed Aug 12, 2026

    Supports threshold-crossing behavior, above/below values, and persistence timers for numeric lux thresholds.

  4. 4
    Conditions

    Home Assistant · Accessed Aug 12, 2026

    Supports numeric-state and state conditions that gate an automation based on current lux and occupancy state.

  5. 5
    Automation modes

    Home Assistant · Accessed Aug 12, 2026

    Supports restart mode for automations that should restart timing when motion or occupancy changes.

  6. 6
    Light

    Home Assistant · Accessed Aug 12, 2026

    Supports light turn-on/off actions, controllable brightness, transitions, color, and color temperature.

  7. 7
    What can you do with a Philips Hue motion sensor?

    Philips Hue · Accessed Aug 12, 2026

    Supports daylight sensitivity, motion sensitivity, and configurable after-motion timers as practical lighting-automation patterns.

  8. 8
    Motion sensor lighting guide

    Philips Hue · Accessed Aug 12, 2026

    Supports day/night light levels, occupancy duration, and different lighting behavior by time of day.

  9. 9
    Aqara Presence Sensor FP2

    Aqara · Accessed Aug 12, 2026

    Supports mmWave presence detection, built-in light sensing, room zones, and the distinction between continued presence detection and basic PIR motion.

Daniel Reed

About the author

Daniel Reed

Daniel writes about connected-home standards, small-space technology, device interoperability, and privacy-conscious urban living.

THE 5-MINUTE SMART HOME BRIEF

Make your home smarter without buying every gadget.

One useful idea, one product worth knowing, and one energy-saving action—delivered weekly.

No spam. Unsubscribe anytime.

Semantic recommendations

Selected from topic cluster, entities, tags, search intent, and editorial relationships.

Privacy controls

Essential

Required for privacy preferences and core site behavior.

Always on

You can change these settings any time from the footer.