Multiple Triggers question

I am very newbie at this programming, so bear with me in my lack of knowledge.

To keep it short and sweet I have 5 hub variables (booleans) that generally register false. If any register true for more than than 2 minutes, that variable needs to be reset back to false.

I created one rule with all the hub variables Booleans as triggers as noted above.

The question is how do I make the actions act on the one that has gone over the 2 minute mark.

I could do this easily with one rules for each hub variables but I want to be efficient

Let me answer your question with a question, if you set a variable that is reading false to false does it matter, i.e. the easist thing to do is reset all of them.

3 Likes

The rule will track the device that triggered it. You just need to put %device% into a local string variable then use that in conditional actions to determine which hub variable to reset back to false.

Local Variables
LastTrigger - Type String

Trigger Events
Variable reports Boolean1 = true and stays that way for: 0:02:00
Variable reports Boolean2 = true and stays that way for: 0:02:00

Actions to Run
Set LastTrigger to %device%
IF (Variable LastTrigger = 'Boolean1') Set Boolean1 to false
IF (Variable LastTrigger = 'Boolean2') Set Boolean2 to false

Note that the IF is a simple condition so THEN and END-IF aren't used.

1 Like

It makes a huge difference and would break my programming in other rules.

Thanks! I get your approach!

Excellent!

Made the adjustment and my initial test was successful for one Boolean value. Now testing it for multiple trigger conditions happening somewhat concurrently.

Thank you so much for your assistance!

1 Like