Hi Home Assistant Community,
Long time lurker, first time poster.
I’ve been using HA for a while now and I’m looking to improve on some of my automations. I have a few automations that turn on living room lights based on time of day/sunrise/sunset and they’re working just fine. I also have an automation that turns off living room lights when I leave home if I forget to turn them off.
However, I’d like the “turn off lights when I leave” automation to not turn off the lights if they should be on because of the aforementioned time/sunrise/sunset-based automations.
I was thinking that one way to do this would be to have the time/sunrise/sunset-based automations set a global variable to true/false to indicate the lights should be on/off Then, in my “turn off lights when I leave” automation, I would only turn off the lights if they shouldn’t be on based on that global variable (i.e., if the lights are on in the evening and I leave home, keep them on; if the lights are normally off during the day and I leave home, turn them off).
Is this something that I can accomplish in HA? If so, what’s the best way to do that? Are there global variables that can be set by an automation and used by other automations? Or am I going about this all wrong?
Thanks in advance for any help you can provide!