MCahill Posted December 13, 2009 Posted December 13, 2009 I implemented an "Emergency Button" that I think is worth sharing. I have two school age children that sometimes are home alone, but this idea has several applications. To use it, they simply press the button. To reset, they press it a second time. I wrote two simple programs called "Emergency" and "Emergency Clear" I use a KeyPadLinc-8 near the front door and will get a red button to activate it, both programs use "Status" is "On" to monitor the button in the 'if' area. I have placed both my wife's and my phone text message as recipients for notifications. The "Emergency" program 'then' area sends notification to all. The next line uses "Set Scene My Lighting On", turning on every light in the house. The 'else' area runs certain daily programs I have to restore "normal" settings (optional). The "Emergency Clear" program 'then' area turns an outside front door light fast on, waits a second, turns it fast off, then calls itself as a program. In other words, the last line is 'Run Program Emergency Clear". This causes the program to loop continuously, flashing the front door light, attracting the attention of emergency responders if they are needed. The 'else' area only sends notification to all. The messages received on the cell phone are pretty clear if the button is activated or reset. We can then take appropriate action to see what is going on. Hope you like the idea!
AD8BC Posted August 6, 2010 Posted August 6, 2010 On a similar note, I have a 911 Flash keypad button at the front door that flashes the outside lights if double-tapped (FastOn). It also sends me a text message. The flash program stops when the button is turned off or fastoff. Really, instead of a flash, it uses a "repeat' routine with a large number of repeats. That way it will eventually time out. I did this because one time we had an ambulace come to the house and they couldn't find the place. Now I can tell 911 to look for the flashing lights.
ricksaust Posted August 26, 2010 Posted August 26, 2010 I would also be interested in the code if you are willing to share. Thanks, Mike
Sub-Routine Posted August 26, 2010 Posted August 26, 2010 One example. This one repeats until the KPL button is turned off. If Control 'KPL C' is switched Fast On And Control 'KPL C' is not switched Off And Control 'KPL C' is not switched Fast Off Then Send Notification to 'Sub-Routine' Repeat Every 1 second Set Scene 'All Lights' On Set Scene 'All Lights' Off Else - No Actions - (To add one, press 'Action') If you want to limit the number of flashes you can use a Repeat X times: If Control 'FR KPL Tracks / FR KPL C Fan' is switched Fast On And Control 'FR KPL Tracks / FR KPL C Fan' is not switched Off And Control 'FR KPL Tracks / FR KPL C Fan' is not switched Fast Off Then Send Notification to 'Sub-Routine' Repeat 10 times Set Scene 'All Lights' On Set Scene 'All Lights' Off Else - No Actions - (To add one, press 'Action') Rand
ricksaust Posted September 2, 2010 Posted September 2, 2010 If you don't have the two "And's" in the "If" statement will it just continue without ever turning off even after the button is shut off? I guess I just figured if the switch was turned off it wouldn't run anymore. But with the program I have it does seem to just keep running and running even after the button is shut off. This might be the problem. Thanks, Mike
Sub-Routine Posted September 2, 2010 Posted September 2, 2010 Hi Mike, I think you have already discovered that the program will run forever after it sees the switch turned on. The not switched Off is indeed the condition that will cause the program to be reevaluated and fall through to the Else actions, of which there are none in this example, so it will effectively quit. The Else actions could include changing the lights back on to their normal settings and without a Repeat would just do that and terminate. While my example calls All Lights I would suggest a scene with only the lights you want to flash; driveway, front door, etc. Rand
ricksaust Posted September 2, 2010 Posted September 2, 2010 I knew I was having a looping problem but I didn't realize this is where the problem was coming from and I haven't had much time to play around with it. But it make since when you remember that the isy doesn't poll any information so an event has to happen that it is looking for before it shows a change. Thanks again, Mike
ricksaust Posted September 2, 2010 Posted September 2, 2010 Looking over things and just had a quick question. I have a 4 year old bedroom closet program to keep the light from being left on all day in his closet: If Control 'Closet Light' is switched On Then Wait 5 minutes Set 'Closet Light' Fast Off Else - No Actions - (To add one, press 'Action') Once this program runs the status of the program remains true. Do I need to do something like this? If Control 'Closet Light' is switched On Then Wait 5 minutes Set 'Closet Light' Fast Off Set 'Closet Light' Query Else - No Actions - (To add one, press 'Action') So that it knows the light is off now and the program will show false and look for the light to be turned on again? Just trying to wrap my head around this non-polling idea. Thanks, Mike
Sub-Routine Posted September 3, 2010 Posted September 3, 2010 Hi Mike, Since you are using Control as a condition the program will start whenever the switch is pressed On. Remaining True will not be an issue. A Query will not change the status of that program. You could add an action that Run (Else) the program which would turn it False but it is not necessary. You may rather look at Last Run Time in the Program Summary to see exactly when it was last triggered. Rand
Recommended Posts