Jump to content
C4 Forums | Control4

Home Away + Arm Disarm


forum

Recommended Posts

I need some help programming this. I'm stuck in a loop of things not entirely working.

I'm hoping some experts can chime in and help me out.

Here is the layout of the house:

Front Door and Back Door.

Both doors have Card Access Sensors to show status of the door being physically open or closed.

Both doors have Zigbee Yale Locks.

3 Button Keypads at each door.

Lets say I have three people in the house: Dad, Mom, Kids (I would like the ability to add more easily later)

Top button = Mom, Middle = Dad, Lower = Kids (The natural hierarchy of things in the home :D )

Mom hits Away, status on keypad goes Orange

Dad hits away, status on keypad goes Orange

Kids hit away, status on keypad goes Orange

If all 3 people leave the home, I'd like the Home to go into "Arm Mode"

If in Arm mode, person unlocks Yale lock and presses their Home/Away Key, the system is then "Disarmed"

So the sequence would be:

Mom leaves home and presses her Top Button : LED goes Orange (nothing in the house changes because Dad and Kids are still Home)

Kids Leave : LED goes Orange (nothing in the house changes because Dad is still Home)

Dad Leaves : LED goes Orange, and gives Dad has 20 seconds before the house will Arm itself

System detects all three people are away and Arms the House. The LED's all change to Red

If all of the LED's are RED and one of the doors is kicked in, the system should go into "Alarm Tripped" and a sequence of events will occur.

Once Tripped, the only way to Disarm the system is to enter one of the three codes on either door locks.

Link to comment
Share on other sites


So you don't have an actual alarm system? I would start with 3 variables and one for each button and set them to true when gone. Then check the other 2 to see there state. If all 3 are true set another variable to true. The all of the alarm programming can go into that variable.

Link to comment
Share on other sites

So you don't have an actual alarm system? I would start with 3 variables and one for each button and set them to true when gone. Then check the other 2 to see there state. If all 3 are true set another variable to true. The all of the alarm programming can go into that variable.

I have created 3 Away variables. When they press the button' date=' it toggles the state of the Away variable. Where do I place the logic to check the state of the Away variables?[/quote']

you will have to place the check in all three button presses for one button should look like this

when top button released

set dad gone var to true

If mom gone var true

if child gone var true

set alarm on to true

you will have to have similar programming on all 3 buttons or you could put it in the variable also just depends on how you want to do it.

then program your alarm settings into the alarm var, such as lock doors. For someone opening the doors you would have to check the state of the alarm var to see if it is active and then do what you want from there.

Honestly this sounds like a huge headache planning all the options in my head. I am no expert so don't even know if this is the best way. Hope it somewhat helps.

Link to comment
Share on other sites

I'm making progress using the 3 separate variables with the push of each button. Then adding status lights to the keypads and delays.

When I get everything hammered down I might have time to post screenshots to help others. So far it's very useful!

There's more nesting of variables going on here than a neighbourhood of pregnant women!

Link to comment
Share on other sites

I find it useful to put all the 'processing' code in a 'function'

but because composer doesn't let you write functions - use a variable and put the code in the status change event.

in other words minimise the duplicate coding required by doing something like this:

Top_button_click:

set variable Dad_away = True

set variable Check_Alarm_Status = True

Middle_button_click:

set variable Mum_away = True

set variable Check_Alarm_Status = True

bottom_button_click:

set variable Kids_away = True

set variable Check_Alarm_Status = True

Check_alarm_status changed:

if Check_alarm_status = true

if dad_away=true

if mum_away = true

if kids_away = true

Set variable Alarm_Armed = true

set variable Check_Alarm_Status = False

You can even add your 'alarm triggered' and 'alarm disarmed' coding into this same 'function'.

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.