Restrictions in Rule Machine

I have a question about how Rule Machine Restrictions work. All of the restrictions in the Wiki say that "Schedules will be ignored". Are setting private boolean for the rule itself the only exception to that? It seems that no matter what the restriction, setting the rule itself to true fires no matter what restrictions are in place.

Setting Private Boolean is not Restricted. However, if you have a rule that fires on Private Boolean being set, that rule itself will not run if it is Restricted. In other words, its Private Boolean gets set, but it doesn't run. If you are seeing some other behavior, I will look into it. I just looked at the code, and that should not cause the rule to run.

If the Restriction is Disable with Private Boolean, and you undo the restriction, then it should run.

Oh no, i'm sorry if I wasn't clear. I'm not seeing anything odd. I'm just trying to understand how the restrictions work without doing a whole bunch of testing on my own. So, setting private Boolean is not restricted. But, what if you have in your rule, a scheduled event for 5 minutes from now. Let's say the action is delayed off for a switch. If a restriction goes into affect before that 5 minutes is up, it will not turn the switch off, correct? Is this true for all restrictions?

And just to understand a little deeper, let's make it a little more complicated. If I have a rule where I set the rule's PB to false and then in 1 min set it to true and the rule has a restriction by switch disabling when the switch is off and within the rule that switch is toggled, the PB will still switch back to true after a minute but if instead of PB that was a switch that I was turning on and then a minute later turning off, that would not turn off the light because it's a device control. Is that correct? If I've totally lost you, I can mock up a fake rule and post it but I figured I'd give it a shot first.

Yes. Every event handler (except setting Private Boolean) checks to see if the rule is restricted or not as the very first thing that happens. If it's restricted, it just exits, and nothing else happens.

This is correct. The only reason that setting PB is not Restricted is that otherwise you'd have no way to ever unrestrict that rule once PB was set to restrict it.

There are a couple of other things that escape restriction also, such as another rule finding out the rule truth of a rule. That happens even if the rule whose rule truth is in question is restricted; likewise for is a rule paused or not. But those don't entail the rule doing anything, just answering a question, as it were.

Thanks so much. That clears up a lot of questions I've been having. A lot of, "huh...I wonder why that did that?" type questions. :slight_smile:

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.