Jump to content

Doorbell trigger


tdmarra

Recommended Posts

I'm using an I/O Linc and an ELK-930 to detect when someone presses the doorbell. I have a program that runs when the button is pressed. I would like to only run the program once if someone presses the button 3 or 4 times in a row. Then after 5 minutes or so it would reset and recognize the next time someone presses the button. The simple program that I have now runs every time the button is pushed, even if the button is pushed several times back-to-back. I couldn't think of a way to use variables to solve this issue. Any ideas? Thanks.

Link to comment

Hello,

 

Try this

 

If

Door Bell Switch is Switched On

and Integer Var1 is 0

 

Then

Ring Bell

Set Integer Var1 = 1

Wait 5 minutes

Set Integer Var1 = 0

Else

 

Tim

 

edit: The first time the door bell switch is pushed and the var1 is 0 the program will run and ring the bell once. But the second time within the waiting period the button is pushed the program will evaluate as Fasle. So try adding a Wait 5 minutes followed by Set Integer Var1 = 0 to the Else section. Then once the switch is pushed a second time and the program evaluates to False the timer will start again. 5 minutes after they stop pushing the button the var1 will be reset to 0 which will allow the program to run and ring the bell when the switch is pushed.

Link to comment

Hi Tom,

 

Glad it worked out for you.

Actually its not multiple instances. Anytime there is a Wait in the action, either in the Then or the Else and something changes in the If the program will re-evaluate. In this case the only trigger is the bell button being pushed. The Integer variable will not cause a re-evaluation.

 

Anyway, glad it worked and thanks for posting back.

Tim

Link to comment

Archived

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


×
×
  • Create New...