Weather light auto off


#1

1) Give a description of the problem
I have a light that changes color dependent of weather. When the sensor detects motion, I want it to turn off after 3 minutes, since that means I’ve seen the notification. However, if it goes to inactive and back to active within that 3 minutes, the timer resets.

2) What is the expected behaviour?
Light off after 3 minutes from active motion sensor.

3) What is happening/not happening?
Piston restarts timer if motion sensor detects motion again.


#2

I would ignore the “Timer” on the Dashboard or in the Trace.

You correctly placed TCP=Never on the correct WITH block, so once it begins that timer, it should come back in 3 minutes to turn off the “Info Light”.

You can set your Logs to Full to see what is going on behind the scenes (and confirm).


Note, with your current wording, you will likely have overlapping timers.
(motion sensors can be quite “chatty”)


#3

With your piston, it will trigger everytime new action is detected.
You can’t stop a motion sensor from registerin movement. BUT you can use variables and create a secondary condition to stop piston from executing completely.

ie :

If motion sensor changes to active
and
if infolight switch is ON
and
If @motionsensor variable is = true
    then 
do this do that

With motion sensor variable set to = false

but with this method you need to decide when you will change that variable back to TRUE…
and it depends on, if you want it once a day? once every 2 hours? or everytime weather changes?


#4

That is the Task Scheduling Policy in action. Edit the ‘with’ and change the Task Scheduling Policy to ‘Allow multiple scheduled tasks’ and it’ll create a new scheduled task instead of overriding the existing one. You’ll still need the TCP set to ‘Never Cancel’.

Bear in mind that this change means there may still be a scheduled task running so you might want to cancel that once you’ve turned the light off.


#5

I tried the “Allow multiple tasks” and it seemed to only add minutes to the current timer.