Cancel Timer - Help needed


#1

This Piston is to automatically turn on and off the lights in the hallway. I use 2 motion detectors and to overrule them i have a button. Everything works fine except for the last IF block.

Once the 10 second timer from the last IF block starts and someone enters the hallway again the 10sec timer keeps running and will turn off the lights. Instead the timer should get cancelled as soon as motion gets detected.

How can i keep the piston as it is but add a rule that when motion gets detected in the first IF block, the last IF block gets cancelled.

Any help will be very much appreciated. Thanks!


#2

Not sure I’m understanding the whole thing… so if you use the button does that mean you want to disable any of the motion sensor logic?


#3

Motion activates light scene 1. The button, when pressed, activates light scene 2.
Both share the same timer and go off after 60 seconds of no motion.

If motion gets detected in the last 10 seconds the ‘turn off’ command still gets executed in the last IF block. Meaning if i walk back into that room after 50-60 seconds the lights will go off and stay off. It’s that part i try to reset or cancel when motion gets detected so the lights stay on.


#4

Try this on lines 38 thru 51:

IF
    Any of Motion 3 & 4 stays inactive for X minutes
Then
    With Switch 89
        Turn On
        Wait 10 seconds  <-- Moved to this block
    END WITH
    IF ALL of Motion 3 or 4 are inactive  <-- This is checked after the Wait
        Then Turn off devices
    END IF
END IF

#5

That works. Thanks for the solution!