Hi All,
I’ve been pulling my hair out trying to figure out why my automation keeps getting skipped
I’m on the process of switching all my hue devices over to z2m and want to keep some of the functionality we’ve become use too, while also improve them slightly.
I have a motion sensor I would like to come on and turn off
first condition if the input switch is off then don’t run the automation, as we want the light to remain on.
my choose conditions:
Light on
Wait 100 milliseconds to ensure it’s reading the latest LUX level
If the LUX is below 10
Light off
if the light is on
waiting 2mins and start to dim the light then turn it off
I added a restart to trigger the light to stay on if motion in detected again while it was running the turn off sequence.
This condition will almost certainly never be true, its basically checking if the binary sensor has be turned on for exactly 200ms.
You want to remove the ‘for’ in this condition, maybe then add a delay action, then a further additional condition for the lux level, if that makes sense.
thank you both for your support.
I like the use of the conditions @123 but I need the motion to check against the latest Lux, which doesn’t get updated until motion is detected.
I was however able to get it working with the below
The example I posted checks if illuminance is below 10 just a few microseconds after occupancy is detected. If you need it to check illuminance a specific amount of time after motion is detected, say 150 milliseconds, simply change the first State Trigger to this:
- platform: state
entity _id: binary _sensor.utility_sensor_occupancy
from: 'off'
to: 'on'
for:
milliseconds: 150
Question for you: how did my example behave when you tested it?