Jump to content
C4 Forums | Control4

Boolean Variables


Recommended Posts

Here is our set up and this is what we want to create, but have no idea how to do it except I think it has to be a Boolean Variable. If I am incorrect, please tell me a better way to accomplish this.

We have little kids and in our kitchen is a sliding door that leads to a pool. If my wife runs upstairs or is somewhere in the house and one of the kids opens the slider we want an announcement to play continuously throughout the house alerting us that one of the kids has opened the slider. Once the slider is closed the announcement can stop. The slider has a GE recessed micro door sensor tied to a Card Access Sensor Bridge so it can tell if the slider is open or closed. Right next to the slider is a 6 button keypad. We want to be able to arm or disarm this door to play the announcement continuously if the door is armed and is opened. Of course we want the LED on the button designated for arming and disarming to be different colors if armed or disarmed. Can anyone show me how to program this?

Link to comment
Share on other sites


I did a write up on this on c4central. However my announcement only plays once for each door opening. If you want it to continually repeat you will need your dealer to add a loop command. I'm pretty sure a loop is the only way to make the repetition happen.

Link to comment
Share on other sites

I haven't looked at your programming to tell about the LED (I'm posting from my cell phone), but I can tell you that you don't need or want a loop command. Create a short timer (6 or 7 seconds?). When the door opens, if the variable is true, play the announcement. When the announcement plays, reset the timer. When the timer expires, if the door is still open and variable is still true, play the announcement. When the door closes or the variable changes to false, stop your timer. There's your "loop". If the doors open and the variable is true, the announcement will continue to play.

Does that make sense?

Link to comment
Share on other sites

I haven't looked at your programming to tell about the LED (I'm posting from my cell phone), but I can tell you that you don't need or want a loop command. Create a short timer (6 or 7 seconds?). When the door opens, if the variable is true, play the announcement. When the announcement plays, reset the timer. When the timer expires, if the door is still open and variable is still true, play the announcement. When the door closes or the variable changes to false, stop your timer. There's your "loop". If the doors open and the variable is true, the announcement will continue to play.

Does that make sense?

Very nice, that will definately do the trick.

Link to comment
Share on other sites

That worked Pharm!

Dan, I think I know what you mean. Would it look like this:

Door Opens

1. Start Back Door Timer, 2. ? If Variable Back Door is True,

3. Execute Announcement Back Door Open, 4. Reset Timer,

5. ? If Variable Back Door is True, 6. Start Back Door Timer,

7. Execute Announcement Back Door Open, 8. Reset Timer,

9. ? If Variable Back Door is True.

Is that right?

Link to comment
Share on other sites

create a timer called back sliding door. Give it a 7 second interval. Under programming on the left side go to your back sliding door announcement and put in this

When announcement back sliding door executes

->reset timer "back sliding door"

Now under programming on the left side go to your back sliding door timer and select the "when timer back sliding door expires" option.

Now put this in the middle

?If back sliding door is open

? If back door variable is true

->execute announcement back sliding door

Now your announcement should keep playing until either you shut the door or hit the button you use to toggle your announement variable. I tried this out on mine(I have the vista20p for my sensors) and for some reason there is a much longer gap between the first and second announcement but then after that it repeats like a champ.

Link to comment
Share on other sites

Thank you both for all the help! I will add that code tomorrow and try it out!

It will work great. I have it in use in several instances at my house. I don't experience the delay pharmdsmith is, and I'm using the Card Access Sensor Bridge just like you are.

Pharmsdmith explained it a little better than I did...thanks.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.