I have something happening that I need to check on more thoroughly, but here’s what I think I’m experiencing.
I have a Simple Lighting set to turn on a few lights triggered by motion between sunset/sunrise then turn them off 1 minute after motion stops. It works perfectly, but a few times now, I’ve gone back into the room a few hours after sunrise and the lights are still on. What I THINK is happening is, the on is triggered and then , while the lights are on, sunrise occurs and the setup halts due to the sunrise restriction and doesn’t turn the light off. Not a big deal at all. I’m going to make a RM rule to mimic this and just force lol off at sunrise, but just mentioning this.
I’m just mention it. This I think was the first thing I built on HE. I don’t plan to use Simple Lighting anymore. After about 10 days....I’m an expert now! (hardly) Does Simple Lighting even have Conditions? IDK
Restrictions are just that, they stop anything from happening. There is always this edge case about things that happen before a restriction kicks in, that have some other part that happens later. Ultimately, a Restriction has to mean what it says, otherwise what would happen is that some other use case would be blown that counted on the Restriction. So your use case gets bit by it. We thought long and hard about this problem, and came down on the side that a Restriction has to be taken quite literally.
But, there is a way around your case using Rule Machine. Instead of a Restriction you would use a Condition. You would use a Rule and it would look like this:
Conditions: Motion Active, Time between Sunset and Sunrise
Rule: Motion Active AND Time between Sunset and Sunrise
Action for true: Turn on lights
Action for false: Turn off lights after 1 minute pending cancellation
The pending cancellation part is there to keep the lights on as long as there is motion. Simple Lighting does this part automatically, but in Rule Machine you make it explicit (so as to have the other option also). The lights will stay on until 1 minute after motion becomes inactive and stays inactive for the full minute. Since sunset to sunrise is a condition, the rule will turn off the lights 1 minute after sunrise (even if there is still motion).
Oh, and if you really wanted them to stay on until no motion in that edge case, that's doable also, but would take an extra rule just to cover the edge case. Otherwise, they would turn off at 1 minute after sunrise.
I understand. I wasn’t sure what I was seeing was caused by the restriction ending or not, and was just mentioning it as a point to note when using Simple Lighting. I can imagine someone going off to work or out of town and lights staying on the whole time they’re away. Like I said, I was just getting my feet wet with HE when I built that. Your approach is absolutely the correct one IMO. I’m starting to get used to Rule Machine and that’s the way to go for me. Thanks for the clarification/confirmation.