Using timers in actions

Ivo Jansch
Ivo Jansch Gebruiker, Specialist
I have an action that triggers a set of lights if I hit a motion detector.

Now I want to turn off the lights 10 minutes after the last time I hit the motion detector. How do I achieve this?

I.e. I walk through the detector, timer gets reset to 10 minutes.
I walk through the detector again, timer gets reset to 10 minutes again.
When timer gets to 0: turn off the lights.

Reacties

  • Freek-Jan Buijsman
    Freek-Jan Buijsman Administrator
    February 2019 aangepast
    Hi Ivo,
    Good question.
    I recommend to create a script for this. See below.
    WAIT 10MIN
    SET BIT(xx/Lamp) to 0
    
    Next change the action you already created to trigger the script instead of the lights. Also set the script to "restart" instead of "start". This way the WAIT period will be reset to 10 minutes when the motion sensor is triggered again.


    * Some extra information on the actions.
    It's possible to add a "WAIT" to an action, but this is only meant for a "WAIT" that will only be triggered once. So in this case this is not suitable because the motion sensor can be triggered multiple times. It will result in the actions being stacked and this can lead to unexpected results.