Motion turn on lights and start timer


#1

Need advise/example for a piston.
What I want to happen:
If a motion sensor is tripped, then turn on the lights and start a timer. If there is no motion during this timer = turn of the lights.


#2

Hi Paros.

The simplest way of doing this is,

IF motion sensor x CHANGES TO ACTIVE 
Then
With Lights 
Do turn ON

(You don’t need a timer for the time lights turn ON. The second IF block will be monitoring the INACTIVE - no motion time)

IF Motion sensor x STAYS INACTIVE for 3 minutes.
Then
With lights
Do turn OFF

The advantage of this piston is, if you enter the room back, the lights won’t go off after 3 minutes but the counter will reset. Other wise if you walk into the room at 2 minutes 58th second, the lights will go OFF no matter what - if you used the timer differently.

Try this, it will work…


#3

I have been using this piston for a year, but it feels like it doesn’t turn of the light consistant when there is no motion…
Any ideas, do I need to set something for the “IF” to run when it’s needed?


#4

That second IF should be moved outside the first IF.

IF Contact changes to open
    Then turn on
END IF

IF IR's motion stays inactive for 2 min
    Then Turn off
END IF

Just keep in mind, if you open the door, but somehow avoid the motion sensor, the lamps will not turn off.