I’m getting confused between triggers and conditions. I’m turning my lights on and off based upon times offset from sunrise and sunset times, using them as triggers. What I’d like to do is have a couple of enhancements but I’m not sure whether I need more triggers or a combination of triggers and conditions, or whether I can add the necessaries in “graphical” mode, or I need to edit the YAML. The trigger thing concerns me because I gather it’s a one-off trigger, I’m not sure how often the inputs which I want to act upon, are “sampled”, for want of a better term.
Firstly I’d like to adjust the turn-on times based upon weather, i.e. sooner if the weather is cloudy and another time if it’s snowing for example.
Secondly, I turn off a set of lights at night at a fixed time but I’d like to leave them on if either my wife or I (or both of course) are out until we are both in and have been home for (say) 15 minutes. We use life_360 on our mobile phones. I’d also like to have a holiday mode that means this functionality is not used (i.e. the standard “off” times are used), but short of just having a global flag that I manually set, I’m struggling to see how to automate it. Could the Google calendar be read and we make sure we use a set heading for holiday periods, or is there something else we could use. I don’t mind if we have to manually set holiday periods since we don’t have that many during any 12 month period.
Many thanks - you wouldn’t think I used to be a software engineer, would you? I could write it in C as a cyclically sampled state machine but I’m struggling to get my head around the YAML model and sampling and trigger vs condition thing.
Firstly I’d like to adjust the turn-on times based upon weather, i.e. sooner if the weather is cloudy and another time if it’s snowing for example.
I use illuminance to accomplish what you are asking for. My weather app is weatherbit so you are not limited to Weather Underground. This post describes it well:
For example, if sunset is at 17:00 and you normally would offset by 30 minutes earlier (so 16:30), would you offset by yet another 30 minutes if it was snowing 1 hour prior to sunset?
If that’s the case then the automation would trigger at 30 and 60 minutes prior to sunset. At 60 minutes it would check weather conditions and only proceed if the weather was cloudy/rainy/snowing/whatever. At 30 minutes it wouldn’t check the weather.
BTW, if this is part of a strategy to guesstimate interior light levels, it’s far more accurate to employ a well positioned, interior light sensor (or two). It’s what I have used for many years; it’s filtered in order to smooth out short-term variations.