How does the logic work?

Babazorka shared this question 9 years ago
Answered

Hi i have a simple rule with some test virtual switches.


When Test1 = Any


IF Test1 = On AND Test2 = On


JOIN


Test3 =On


ELSE


WAIT 10 sec


Test3 = Off


Im a bit confused about the way logic works here.

Case 1: i turn on Test1 fisrt followed by Test2 with few seconds interval. Nothing happens.

Case 2: i turn on Test2 fisrt followed by Test1 with few seconds interval. The rule executes.


When Test3 is on and i turn off whether Test1 or Test2 - Test3 goes off.


Generally how the things works here - do we use positive edge, how the box is executing rules - is it cyclic?

If it is cyclic in how did the cycle time affect rule execution etc.

Where can i find some more information about this?


Thanks.

Replies (4)

photo
1

Case 1 >> it not triggert because you don't check it. You only have Test1 = Any

photo
1

Heros im running same rule and its the IF conditin that confuses me.

Rule works only in Case2, and in Case2 the WHEN condition is the same.

I have "WHEN Test1 = any" just to trigg the rule, then i wait for both Test1 and Test2 to go high.

So i think that the rule should be allways trigged and when test1 and test2 comes (doesnt matter which one comes first) the execution of the rule should continue. BUT in my case it happens only if test 2 comes first. So i did some tests and the result is that the device which is used with WHEN condition have to be activated on second place. And this is confusing for me. As i said i think that the rule is allways trigged because of ANY , after that i (personally) do not care which one will come first test1 or test2. But zipabox obviously do care. Thats why im asking about some info how the logic is working.

photo
1

Hello Babazorka,


There is a confusion in the usage of "When" statement:

"When Test1 = Any" means "When Test1 state is modified"

Your rule will start, only if you switch Test1 (from ON to OFF, or from OFF to ON)

photo
1

Thank you Christophe i figured it out after some tests.

Leave a Comment
 
Attach a file