I’ve been diving into the world of smart lighting automation, and I wanted to share my journey and some tips for anyone looking to set up something similar. My goal was to create a system where the lights turn on automatically when motion is detected, but only if it’s dark enough. This sounds simple, but getting it just right took some tweaking!
Initially, I relied on the Hue app’s built-in automation, but I found it too rigid. For example, at 9 AM, it would still turn the lights on even if it was bright outside. I decided to switch to Home Assistant for more control.
Here’s what I came up with:
-
Motion Detection: I use a Hue motion sensor to detect movement. It’s crucial to ensure the sensor is placed correctly so it doesn’t pick up false positives, like a flickering light or a passing pet.
-
Light Level Check: I added a condition to check the light level using the sensor’s built-in luminosity detection. If the room is already well-lit, the lights won’t turn on. This has saved me from some awkward moments!
-
Time-Based Adjustments: While I don’t rely solely on the time of day, I did set up a fallback for dawn and dusk when natural light is inconsistent. This ensures the lights come on when needed without being overly intrusive.
-
Integration with Home Assistant: Using Home Assistant’s automation editor, I combined the motion sensor and light level conditions. The automation also includes a 30-second delay before turning the lights off again after motion stops. This prevents the lights from flickering on and off in low-traffic areas.
Here’s a simplified version of the automation I used:
yaml
- id: Bathroom_Lights_Automation
alias: Bathroom Lights Automation
trigger:
platform: state
entity_id: binary_sensor.hue_motion_sensor
to: ‘on’
condition:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.hue_motion_sensor
state: ‘on’
- condition: numeric_state
entity_id: sensor.hue_motion_sensor_light_level
below: 3
action:- service: light.turn_on
data:
entity_id: group.bathroom_lights
- service: light.turn_on
One thing I struggled with initially was ensuring the automation didn’t conflict with manual controls. I found that using groups for lights and setting up exclusions helped maintain control. For example, if I turn the lights off manually, the automation won’t override that setting until motion is detected again.
I’d love to hear how others have set up their lighting automations—especially if you’ve tackled similar challenges or have tips for improving this setup! ![]()