+7 votes
by (880 points)
Does an automation run according to the order of the "ifs"? I would like the inside lights to turn on when the garage door opens and then the door to the house is opened, in that order. Not the reverse as that would indicate leaving the house.  
Does an automation run according to the order of the "ifs"?

7 Answers

+9 votes
by (5k points)
 
Best answer
If we are talking about the 'Automations' in the SmartThings app, then no. The automation will be fired when the garage door opens and then look at the conditions - the garage door is open and the house door is closed. So that will be false. Then it will fire again when the house door is opened and check the conditions again - the garage door may or may not be open, and the house door is open. That is actually more generally true, something fires an automation app up and it acts on what the current state of devices is. To get time sequencing as you require, you either need a bespoke app written to do the job, or you want something more powerful like webCoRE where you have finer control over what is going on.  
+3 votes
by (21.2k points)
No, it doesn’t consider any order.  
+6 votes
by (830 points)
I'm just starting to code in webCore, but I would use a variable. Set it on the first trigger, test it with an And on the second trigger. Clear the variable when the first door closes or the piston Exits. Should accomplish your goal.  
+12 votes
by (1.2k points)
Using webcore you could just use nested if statements. 1] if garagedoor is open THEN 2] if doortohouse changes to open THEN 3] with insidelight turn on, end if, end if. Something like that anyway.  
+7 votes
by (14.6k points)
How the IFs run depends on the piston settings  
https://community.webcore.co/t/sync.../3584
+10 votes
by (880 points)
Thanks all. What a nice upgrade to the app it would be if it could do all that. Guess I'll be learning some new skills!  
+10 votes
by (1.3k points)
Make two automations. The first turns on the lights based on your original criteria. Then another to open the door if all the criteria is true PLUS the lights are already on.  
The SmartThings Group is where you can always find questions, answers, advice, reviews & recommendations from other community members about home automation with the Samsung SmartThings hub.
...