Take the Dog out Patio Lights

light
triggers

#1

1) Give a description of the problem
I have my patio lights set to turn on upon opening the patio door during certain hours, then way a few min and turn off. They are not turning off.

2) What is the expected behavior?
Patio lights should turn off after certain time period.

3) What is happening/not happening?
Patio Lights remain on and do not turn off/

**4) Post a Green Snapshot of the piston

5) Attach any logs (From ST IDE and by turning logging level to Full)


#2

On your WITH set Task Cancellation Policy (TCP) to NEVER.


#3

Thank you. I will try that tonight. Can you tell me what that basically says for the logic?


#4

What you have in your IF is fine but the 3rd element will not be true all the time. It is a trigger that changes.
The contact will change to open and the piston becomes true and the tasks start by setting the level and the timer will start to count down.
With the contact sensor, after about 10 seconds I believe, the piston will evaluate it to false as you have used changes to. It will start to look for a new changes to event.
Because you have the WITH set to ‘cancel tasks on piston state change’, the tasks will stop as the piston will evaluate to false after 10 seconds.
If you set TCP to never cancel tasks, then when the piston evaluates to false the tasks will not stop and carry on in executing the tasks.
Hope this makes sense.


#5

Makes compete sense now. Thanks for the explanation.

So with this piston, I open the door, timer starts counting (assuming I also have never cancel tasks on) - if I shut the door, then open again, as long as I’m inside the 200 seconds (or whatever timer is) it’ll continue counting right? It shouldnt reset the timer?


#6

I’m afraid not. If the contact changes to open again, before the 200 second wait has matured, then the tasks start again.
i.e.
Turn on light (except it won’t as it knows the light is on so wont sent the turn on instruction).
Start 200 second timer.