Not sure how to do this - tinkering with virtual devices, variables, and realizing might be better just to ask!
I have an outdoor light that is scheduled to be off after 11pm
I want to add a door sensor such that when the door is opened, the outdoor light is turned on and then after 10 minutes it is turned off.
This works ok except I want to add the smarts so that when he door is opened, the outdoor light is always turned on, but it is only turned off if the light was already off before the door opened. In other words, if the door is opened after 11pm, it will turn the light on, wait 10 minutes, then turn the light off.
If the door is opened before 11pm, it will turn the light on (just to be sure) and then do nothing.
I don't want this to be driven by the clock time, I want it to be triggered by whether the outdoor light was already on or off. That way, if I change the schedule of when the outdoor light is automatically turned on or off, the door sensor action will not be affected.
I was trying to use a variable "WasLightAlreadyOn" to keep track of the light status and then using action groups for turning the light on and off that does two things - turns the light on or off and also sets the variable true or false so if the light is operated manually the status variable will still get updated.
I'm getting stuck on how to setup the door sensor to wait 10 minutes then check the status variable and turn off the light is the status variable is true.
Wondering if I am on the right track or over-complicating this and there is an easier way?