Just verifying something

again, just startinng out with RM 4-0. just want to double check that i understand the way to read conditionals

Lets assume this conditional
IF ( motion sensor active(F) [FALSE] THEN

In the UI it looks like this means if the state of the motion sensor is inactive then do XYZ.

Is this the moral equivalency to a Boolean in pseudo-C:
if ( motion sensor active == FALSE )
or
if ( !motion sensor active)

Am i reading the RM conditional syntax right in my examples above? i fhink the (F) [FALSE] is throwing me off, it reads as double negations to me.

Second thing, are pending delays global in scope or local to the rule that set the delay?
eg if i have a rule that has a pending delay can another rule cancel that pending delay?

Thanks!

Those are indicating condition truth, and statement truth. In your example, they will always be the same because you only have one set of conditions.

In this example there are multiple conditions, and then that (adds up) to the statement being true or false.

ruletruth

Got it, i haven't done any more complex than a single comparator in an if statement.

so in the UI the [FALSE] or [TRUE] shows how the whole expression would be evaluated at current conditions and the (T) or (F) shows how the current evaluation of each condition?

Yeah what @neonturbo said. Basically, the (T) or (F) indicates the value right now of what ever condition you are measuring (condition truth) and the [TRUE] or [FALSE] is the value the rule is testing against (Statement truth).

So, (F)[FALSE] means that whatever condition you are measuring is false, and you were testing to see if it is false in your rule.

I think delays as you describe are local to the instance of the rule it is used in. But I think @bravenel could best answer.

S.

1 Like

Yes, exactly.

Delays are local to a rule, but another rule can kill them using Cancel Rule Timers. That's pretty much a sledge hammer thing to do.

Thanks. Not that complicated then, you've embedded a bit of a debugger in the GUI. neat!

What about private booleans? Can they be read across rules are they scoped local to the rule?
I've seen the doc about global variables but wanted to see if i could use a local boolean as as lock to lock rules out from execution. EG. if switch is turned on manually then cancel all delay timers and disable the motion sensors automation.

I guess i can express that a single rule with a couple of conditions and multiple triggers, but i could also do that as two rules and coordinate via a logical lock (test and set type of lock).

Private Boolean can be set by other rules, but not read by them. They can be used as locks to some extent. I had a rule that I only wanted to run in a very limited circumstance, but that was triggered by something that happened in other circumstances also. One rule, that knew when that circumstance existed, would set the PB of the other rule, thus enabling it to run when triggered. When it ran it would set its PB to false, having done its thing for that one time.