Jump to content

Motion sensor triggering a bell with a Wait - how to prevent multiple executions


ctownj30

Recommended Posts

This seems like such a simple problem but I'm stumped.  I've got an Insteon motion sensor that watches my driveway.  It is set to only send On commands.  When it senses motion I want it to ring a bell once (the bell part is all working fine), which I do so like this:

 

        Set 'Kitchen.Den / Bell Relay' On
        Wait  4 seconds
        Set 'Kitchen.Den / Bell Relay' On
 
When motion is detected, I want it to run that sequence only once for any 30 second period.  I'm having trouble creating a program that suppresses any addition motion senses from ringing the bell within 30 sec of the first bell ring.
 
I won't confuse this by posting code for the various things I've tried; but needing to use the WAIT causes my If to be re-evaluated which messes up my attempts to set variables and such to stop subsequent bell rings - this seems like a simple problem so hopefully someone has a simple solution.
 
Thanks - djm
Link to comment

Hi djm - I would suggest 2 programs, no variables. The second program disables the first for the amount of time you specify to stop the motion sensor detection from starting the program over again.

 

MotionSensed

     If Motion sensor is switched on

     Then

         Run Program 'BellRelay' (then path)

     else

 

BellRelay

    if

    then

        Disable Program 'MotionSensed'

        Set 'Kitchen.Den / Bell Relay' On
        Wait  4 seconds
        Set 'Kitchen.Den / Bell Relay' On
        Wait ??? minutes or seconds (to stop it from happening for a while)  
        Enable Program 'MotionSensed
     else
 
The second program has no if clause and does not need it. You probably don't have to, but I would disable BellRelay so it doesn't run on its own, just when called by MotionSensed 
 

Paul

Link to comment

NP, please let us know how that worked.

 

Its true that the ISY thinks much more like an industrial event driven controller, and can not afford the luxuries of a full development language.

 

The general 2 program approach outlined above is a common way to do things for me. I had to learn from others here on the forums to look at things this way. It does build up the number of programs, so program naming and folders become important to keep your sanity

 

Paul

Link to comment

Archived

This topic is now archived and is closed to further replies.


  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

    • There are no registered users currently online
  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.2k
×
×
  • Create New...