Hello - still consider myself a newbie with HA as everything I have setup, so far, is all fairly simplistic… This is my first more “robust” automation. I’m not terribly good (yet) with reading the YAML, but if I had a few screen shots of the GUI setup, I could find my way. Anyway, here’s what I could use some advice on:
Trigger: Between 1am and Sunrise
Conditions: If MotionSensor2 detects motion within 90 seconds of MotionSensor1 detecting
Action: turn on a light and wait 30 minutes, then turn it OFF
It’s the conditions part I’m not sure how to do. The “within 90 seconds” and “wait 30 minutes” that are throwing me.
I’m not sure but I think the conditions need to be ‘and’.
the way you have it now says if it’s after 1am (from 1am till midnight) or before sunrise (from midnight till sunrise). So there is a lot of overlap/extra time using the ‘or’.
I think it should be:
condition:
- condition: and
conditions:
- condition: time
after: "01:00:00"
- condition: sun
before: sunrise
or even shorter since ‘and’ is the default:
condition:
- condition: time
after: "01:00:00"
- condition: sun
before: sunrise
I think I confused myself about that gotcha that catches most users out when they use both a sunrise and sunset condition crossing the midnight boundary.
My brain is kind of fried after this week’s work, but does the logic practically change things in this case? I’m really just checking myself here?
Anyway, I’ll update my version with your suggestion, especially since it’s more compact. Thanks!