Jump to content

Motion timer


stre1026

Recommended Posts

Posted

So I have a situation that I'm sure many of you have... I have kids that like to leave lights on all around the house. What I would like to do is start a timer based on the motion sensor tied to my ELK security system in the kids playroom. So when the turn the lights on, it will start a timer for say 5 minutes and if there is motion detected, it will extend that another 5 minutes. I'm trying to wrap my head around the best way to do this. I have state variables setup and a program that updates the motion state variable to 1 if it detects motion and 0 when the motion stops. However, I'm not sure of the best way to implement the timer. I'm stuck on how to best implement the rest.

Any thoughts would be greatly appreciated!

Posted (edited)
6 minutes ago, stre1026 said:

So I have a situation that I'm sure many of you have... I have kids that like to leave lights on all around the house. What I would like to do is start a timer based on the motion sensor tied to my ELK security system in the kids playroom. So when the turn the lights on, it will start a timer for say 5 minutes and if there is motion detected, it will extend that another 5 minutes. I'm trying to wrap my head around the best way to do this. I have state variables setup and a program that updates the motion state variable to 1 if it detects motion and 0 when the motion stops. However, I'm not sure of the best way to implement the timer. I'm stuck on how to best implement the rest.

Any thoughts would be greatly appreciated!

That all depends on whether the ELK sends every motion sensed On signal to ISY or just the first change of state.

You would need a much longer timer to avoid the lights going off randomly while they play in the room, unless your MS will detect the floor play in every corner of the room.

Edited by larryllix
Posted

There may be a simpler solution.  I use the program below to power my under bed lights.  If there is just a single event turning on the motion sensor the lights will extinguish after 5 minutes.  The else statement triggers only after no motion has been detected for five minutes.  The motion sensor is set for "On Only" commands.  Hope this helps.

 

Bedroom Motion Right - [ID 000A][Parent 0001][Run At Startup]

If

        (

             'Bedroom / Bedroom Motion-Sensor' Status is On

         And From    10:30:00PM

             To      Sunrise (next day)

        )

Then

        Set 'Bedroom / Under Bed Lites' Fast On

        Wait  5 minutes

        Set 'Bedroom / Under Bed Lites' Off

Else

        Wait  5 minutes

        Set 'Bedroom / Under Bed Lites' Off

 

Posted

I typically separate my off program from my on. This allows me to easily override my off programs or have multiple programs without causing issues with one another.

If motion is switched off

And motion is not switched on

Then wait 5 minutes turn off

Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

    • Total Topics
      37.2k
    • Total Posts
      372.4k
×
×
  • Create New...