Private Boolean - most difficult to grasp

I can't seem to grasp what exactly the PB does. It has been written in many places that if the PB of a rule is set to false, then the rule will not execute it's actions.
I created a Rule4
trigger: periodic event, every 10 seconds
toggle a dimmer set to 30%
delay 3s
toggle same dimmer set to 30%
Saved it and it was toggling the dimmer as defined

created a rule
trigger: none, manually run
action: set PB of the rule listed above to false
manually trigger it......
dimmer is still toggling
what don't I understand about PB?

In RM 4.0 the private boolean is just a local variable. It does exactly nothing unless you explicitly use it in a rule condition.

In older versions of RM the private boolean did control rule execution, but it no longer does. So anything you read on private boolean only makes sense depending on which version of RM was out when the comment was made.


Thank you sir! I'm done experimenting with PB. :slightly_smiling_face:

You still had to add it as a Restriction, but that was more or less the only thing you used to be able to use it for. With conditionals and now local (and global) variables, its speciality is now not much aside from the fact that is always available, accessible from any rule (so only semi-local), and takes a few fewer clicks than creating your own.

So, in case you ever dabble in Rule 3.0 before (or or after, with a clone master) it's retired, just keep in mind you still had to use it somehow. You can still do exactly that plus a lot more (now that we have conditionals), but you must do it yourself instead of just flipping a toggle option.

Private Boolean is not totally a "local variable". Local variables can only be read or modified by the rule that they belong to. Private Boolean can only be read by the rule that it belongs to but it can be set by any rule. It's kind of a cross-breed between local and global variables.

1 Like

Haha, I guess it should have been called Semi-Private Boolean, or perhaps Corporal Boolean?