Help creating piston


#1

I created the attached piston to turn on some lights at home when either my wife or my presence sensor changes to “present”. I would like the piston to turn on 3 lights if they are not currently on. After turning them on I would like it to wait 15 min then shut them off. If the light was already on the piston should not touch that light.

I can see where it is getting hung up with the “Wait 15 Min” section but I don’t know how to write this piston to work the way I want. If it skipped over the “Wait 15 Min” and processed the rest of the “IF” statements it would be great but it is pausing the entire piston there.

Any help on how to accomplish what I am trying to do?

Here is the piston

Thanks
Jon


#2

Combine all the actions. Unless you are wanting 1 light to turn on wait 15 minutes turn off then turn on the next light wait… etc.

After you do this then you will want to edit that with statement and click the cog. Change TCP to never cancel.


#3

Try setting the Execution method to Asynch for the 2nd and 3rd IF.

Click the IF and then click the cog (wheel) icon. This should evaluate the IFs without waiting for the first Wait 15 minutes to complete.


#4

Thanks @eibyer. I will try that. That makes sense to me. Any reason not to set all 3 as asych?


#5

First one will execute even without setting it asynch.


#6

Great, makes sense…thank you!


#7

Based on how I understand what you want to accomplish you want to turn on the lights then go back to how the lights were before the piston executes, yes? If so then wont this work with less logic:

If presence changes then
with keypad 5, keypad 2, keypad 4
…capture attributes switch to local
…turn on
…wait 15 minutes
…restore attributes switch from local