Wait time triggering but taking action


#1

1) Give a description of the problem
I have a piston that turns on a light when the doorbell goes and is meant to turn off after 15min. It timer triggers but doesn’t take the turn off action. I wonder if it’s linked to an inactive state change that looks like it’s cancelling some things.

2) What is the expected behavior?
The turn off doesn’t fire even though the timer fires

3) What is happening/not happening?
Light turns on but not off

4) Post a Green Snapshot of

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS THEN HIGHLIGHT ALL OF THE LOGS SND CLICK ON THE </> ICON TO FORMAT THEM)


#2

Try setting the task cancellation policy for your ‘with’ statement on line 40 to ‘never cancel tasks’. The state of the contact sensor is switching from ‘active’ back to ‘inactive’ before the 15 minute timer completes, and is cancelling the timer since the triggered ‘if statement’ is no longer true at that point. I’ve run into this same scenario myself, very frustrating!


#4

Super thanks. I’ll gice that a try. I don’t know that was a thing. Explains why other wait type things like this sort as the state change doesn’t happen.