Trigger condition based on variable does not work as expecte

Posted on
Sat Sep 29, 2018 3:33 pm
superholz offline
Posts: 52
Joined: Jun 10, 2015
Location: The Netherlands

Trigger condition based on variable does not work as expecte

I have two triggers that react on the same action (clicking a wall switch).
Based on the condition one of the action sets should trigger. The condition evaluates if a certain variable is true ore false.

if the variable is true, the actions of trigger 1 should fire
if the variable is false, the actions of trigger 2 should fire

the actions of the triggers invert the variable (in trigger 1 from true to false, in trigger 2 from false to true).

In practise this should result in switching of the variable by clicking the switch, click - variable set to true, click- variable set to false, click - variable set to true ....

BUT what actually happens is that both trigger actions are executed. So trigger 1 evaluates the conditions to true and switches the variable.
then indeed the conditions for the second trigger is also evaluated to true and the variable is inverted again.

I would expect that both trigger conditions are evaluated at the same time and consequently only one of the two conditions is evaluated as true and only one action set is executed.

Assuming that this has to do with when the variable is checked exactly, I played around with delaying the switching of the variable a few seconds (in the hope that than the system eventually finished in evaluating both triggers and will not fire actions on trigger 2 when the conditions evaluates to true)

Any explanation on the behavior and how to fix it is appreciated!
Attachments
Bildschirmfoto 2018-09-29 um 23.31.31.png
Bildschirmfoto 2018-09-29 um 23.31.31.png (104.88 KiB) Viewed 1735 times
Bildschirmfoto 2018-09-29 um 23.31.12.png
Bildschirmfoto 2018-09-29 um 23.31.12.png (95.22 KiB) Viewed 1735 times

Posted on
Sat Sep 29, 2018 3:40 pm
superholz offline
Posts: 52
Joined: Jun 10, 2015
Location: The Netherlands

Re: Trigger condition based on variable does not work as exp

:? hmm I checked again to use a delay of 5 seconds for the switching of the variable in one of the trigger action sets. That seems to work now.
I'm still not sure how long these delay has to be (or how short it can be) not to get in troubles with the second trigger evaluation.

Posted on
Mon Oct 01, 2018 9:44 am
jay (support) offline
Site Admin
User avatar
Posts: 16306
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Trigger condition based on variable does not work as exp

You shouldn't have to introduce the delay really, though if you're switching the switch on/off rapidly it might get confused (we parallelize triggers and action executions as much as possible because that's normally what you want). I don't know what the triggering event is since you didn't post that pict, but if a 5 second delay works then you're good.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests