forum Posted June 9, 2013 Share Posted June 9, 2013 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 )Mom hits Away, status on keypad goes OrangeDad hits away, status on keypad goes OrangeKids hit away, status on keypad goes OrangeIf 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 RedIf 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 More sharing options...
alf1096 Posted June 9, 2013 Share Posted June 9, 2013 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 More sharing options...
forum Posted June 9, 2013 Author Share Posted June 9, 2013 No alarm system. I will be utilizing the door sensors, some IP cameras and Push notifications to my phones for alerts. Link to comment Share on other sites More sharing options...
alf1096 Posted June 10, 2013 Share Posted June 10, 2013 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 thiswhen top button releasedset dad gone var to trueIf mom gone var true if child gone var true set alarm on to trueyou 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 More sharing options...
forum Posted June 10, 2013 Author Share Posted June 10, 2013 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 More sharing options...
brucecampbell Posted June 10, 2013 Share Posted June 10, 2013 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 = Trueset variable Check_Alarm_Status = TrueMiddle_button_click:set variable Mum_away = Trueset variable Check_Alarm_Status = Truebottom_button_click:set variable Kids_away = Trueset variable Check_Alarm_Status = TrueCheck_alarm_status changed:if Check_alarm_status = true if dad_away=true if mum_away = true if kids_away = true Set variable Alarm_Armed = trueset variable Check_Alarm_Status = FalseYou can even add your 'alarm triggered' and 'alarm disarmed' coding into this same 'function'. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.