I’m bending my head of this problem and can’t find the solution.
After sunset I have an automation that turns on my outdoor light at 50% brightness. When my motion sensor detects movement change the brightness to 100%. After 2 minutes I would like te lights to go to: previous state (if time is before 23:30) or go out.
I created an automation with scene.create which work to up a point. the big problem is that is there are multiple movements within the 2 minutes of 100% light the scene.create snapshot messes up. Resulting in the lights staying on.
I’m a bit confused by the mixture of devices and entities. I see from the template that you’re using a hue motion sensor, so presumably you have an entity sensor.hue_outdoor_motion_sensor_1_motion (or something similar)? Why the device triggers?
Also, I have always found scenes a pain. Wouldn’t something like this work? The entities are my own - I also have Hue outside lights operated by a motion sensor.
alias: Dim yard light
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.yard_motion_sensor_motion
to: "on"
- platform: state
entity_id:
- binary_sensor.yard_motion_sensor_motion
to: "off"
for:
hours: 0
minutes: 2
seconds: 0
condition: []
action:
- if:
- condition: state
entity_id: binary_sensor.yard_motion_sensor_motion
state: "on"
then:
- service: light.turn_on
data:
brightness_pct: 100
target:
entity_id: light.yard_1
- if:
- condition: state
entity_id: binary_sensor.yard_motion_sensor_motion
state: "off"
then:
- service: light.turn_on
data:
brightness_pct: 50
target:
entity_id: light.yard_1
mode: single
This doesn’t include the “if time is before 23:30” requirement. I would probably use a schedule helper to define times when lights should dim.
Edit: I like the idea of dimming the light - mine just go on and off. I’m going to steal that - thanks!
Thanks. How is this triggered by the amount of outdoor light?
I dropped the idea of scene.create. Here’s my new automation. trying it out tonight. Problem is the point in the automation where the illuminance is measured. In theory this could mean that the lights are not switched off.
It is triggered every time motion is detected. I have a condition (didn’t include it above - sorry) which prevents any action if light is above a certain level. Same principle as yours, I think, except I use a threshold helper which can be accessed by other automations as well.
condition: state
entity_id: binary_sensor.override_outside
state: "off"
Afraid not. I like threshold helpers because of the hysteresis option, which helps to prevent “bounce” when the light is hovering around the threshold.