Hi @Alex_Burrows, can you post a screenshot of your rule so I can better understand where it went wrong? And here is an quick example, and please note that I changed the IF_Condition logic from “ALL” (AND) to “ANY” (OR) so it will execute the following activities if it’s after sunset or before sunrise.
I see. You can use “state_stays” in the trigger, instead of the if_condition in the flow in this case. See below for example. So the issue of the original rule is the rule gets triggered whenever the light is turned on, and immediately checks if the light has been on for the past 10 seconds, which will never be satisfied since the light was just turned on. So using the “stays” in the trigger will execute the flow only if the light has been on for 10 seconds. Then it will check the time and decide if it should turn it off in the example below. Let me know if this helps.
Yes, I understand and makes sense!
I ended up just copying your rule and it worked wonderfully!
I originally tried a delay, but I had it after not before, so I just stopped using it.
I hope you don’t mind that I reordered the screenshots so they’re easier to read.
The ‘State Stays’ trigger might be better in this case as it will only turn the light off if the light has stayed on for the desired period of time.
The version that triggers when the light turns on and then runs a delay could have the unintentional side-effect of turning the light off on someone who just turned it on again (eg. the last invocation of the rule happened ~5 minutes before they turned the light on). The ‘state stays’ version would avoid this.