Using another rules Private Boolean as a condition not available?


#1

I am trying to set up a rule where one of the conditions is the Private Boolean state of another rule. But it seems that the only Private Boolean you can access in conditions is the one for rule you are currently in. Is this correct or am I missing a way to do it?

I can use a virtual switch instead, but I would be cleaner not to have to.


#2

I've never seen access to another rule's PB as a trigger or condition. Whatever you're using to set the other rule's PB, can you use that to set this rule's PB as well? What are you trying to do?


#3

It's a motion lighting set of rules where I set the PB of the "motion ended" rule so that it only runs if the lights were switched on by motion in the first place rather that manually. I trigger It by motion or light level and I need to check that the lights haven't already been turned on by motion/ Light level. As the PB of the second rule is only true if that's the case I could have used that. I've used a virtual switch instead and it works fine, but if I could have accessed the other rules PB I wouldn't have needed to to.


#4

Have you considered using the other rule's rule-truth? That's available as a condition in a rule, and as a trigger event.


#5

It's not the other rule's truth I need to know, it's whether it's already been set "active" or not by other rules that I want to know.


#6

It seems to me that the name ā€œPrivate Booleanā€ implies that the PB is supposed to be ā€œprivateā€...

Could you use a virtual switch as a surrogate?


#7

How is it's PB being set? By other rules? If so, those could also set PB of a rule that has a single condition -- PB is true. Then it's rule-truth would tell you what you want to know.

Meanwhile, I will look at whether allow Private B to drop the Private part and be directly looked at is reasonably doable.


#8

That's what I am doing and it works fine.

It just seemed a bit odd that you can set another rules PB in a different rule (so its not really "private"), but can't use it as a condition. It's not a big problem but would have saved a virtual switch.


#9

Would this suggestion work for you?


#10

The PB is being set by other rules but also by the rule it applies to.

As it turned out using a virtual switch instead of using PB did make it a bit easier for me to check that the rules were doing what I intended during testing.

But it's always nice to have the maximum number of tools in the toolkit though if it is possible to add.


#12

@bravenel you know the support of global variables would eliminate this issue and many WebCORE rules. Just saying. :wink:


#13

Yes, I know. Worth thinking about...