Motion lets piston complete without turning off light


#1

1) Give a description of the problem
Piston fires correctly but if there continues to be motion on either sensor, then the light will never turn off unless the next night there is no motion

2) What is the expected behaviour?
wait 5 minutes after light turns on, check for motion, turn off if no motion, if there is still motion, loop back to the command to wait 5 minutes

3) What is happening/not happening?
If motion is still present after 5 minute wait, the piston stops, leaving the light on

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach logs after turning logging level to Full
Did not catch the log after the minutes


#2

The general way I program for motion sensors is:

IF Sensor's motion changes to active
Then
    Turn on lights
END IF

IF Sensor's motion stays inactive for 5 minutes
Then
    Turn off light
END IF

With this method, you do not need any WAITS, no messing with TCP, and no need for ASYNCs…


#3

WCmore’s solution solves the problem without having to resort to Never Cancel. What’s likely happening is that sometime within those five minutes, one of the other triggers fires, causing the piston to start over at the beginning and skipping past the second If that turns things off.