ricksaust Posted August 26, 2010 Posted August 26, 2010 I would like to program an "Away Mode" program. What I have in mind is to have my letter "D" on my 6 button switch be the on switch for "Away Mode". I would like to push it when walking out the door on vacation. When this button was on if any light switch is turned on in the home that it would send an email alert plus flash the lights in the home to scare off any potential threat. There are a couple problems that I am having. 1. It doesn't seem like the ISY picks up all of the events that happen. (For example I can turn on a light and leave it on for while and nothing will happen. Sometimes it catches that a light is on other times it doesn't) 2. It kind of seems like it starts multiply programs at the same time since it is flashing lights that are found in the IF statement. 3. When it runs through my Then it is not consistent. I never did get an email and it usually only blinks the living room light and randomly flashes the others. There is probably a better way to do this just looking for some advice on what my problem might be or a better way to do it. Current code listed below: If Status 'Utility Light.D' is not Off And-( Status 'Utility Light.1' is not Off Or-( Status 'Kitchen Lights' is not Off Or Status 'Living Lights' is not Off Or Status 'Master Bath Light' is not Off Or Status 'Master Closet Light.1' is not Off Or Status 'Master Lights' is not Off Or Status 'Dining Lights' is not Off -) -) Then Send Notification to 'Email' Repeat 10 times Set 'Living Lights' Fast On Wait 1 second Set 'Kitchen Lights' Fast On Wait 1 second Set 'Master Bath Lights' Fast On Wait 1 second Set 'Master Closet Light.1' Fast On Wait 1 second Set 'Master Lights' Fast On Wait 1 second Set 'Dining Lights' Fast On Wait 1 second Set 'Living Lights' Fast Off Wait 1 second Set 'Kitchen Lights' Fast Off Wait 1 second Set 'Master Bath Lights' Fast Off Wait 1 second Set 'Master Closet Light.1' Fast Off Wait 1 second Set 'Master Lights' Fast Off Wait 1 second Set 'Dining Lights' Fast Off Wait 1 second Thanks in advance for any suggestions, Mike
Sub-Routine Posted August 26, 2010 Posted August 26, 2010 Hi Mike, What is happening is due to the fact that your program is turning on lights that are being checked in the conditions as being off. It will probably be better to create a folder that has a condition of the KPL button and then create programs within that folder to watch for Control events rather that Status. Control will only activate when a switch is pressed while Status reacts whenever a light is turned on even if from another controller. I also have to suggest that you create a scene containing all the lights and switch the scene On/Off rather than individual devices. Rand
ricksaust Posted August 26, 2010 Author Posted August 26, 2010 Sub-Routine(Rand), Thanks for the advice. When I create a scene with all of the lights I want controlled do I just have all of the lights as responders in that scene with no controllers? Also if I have the ISY looking for Status do you have any idea how often it pull this information? I do like your idea to use a control instead but just curious how often it gathers this info since it didn't seem to work in my last program looking for that status. Thanks again, Mike
oberkc Posted August 26, 2010 Posted August 26, 2010 When I create a scene with all of the lights I want controlled do I just have all of the lights as responders in that scene with no controllers? Yes, unless you want one of the included devices to control the scene. For use only within the program, no controller is necessary. Also if I have the ISY looking for Status do you have any idea how often it pull this information? I am not sure that it "pull"s the information. Program conditions are evaluated each time one or more of the included device's status changes or a control is recieved. If nothing changes, a program will not execute.
ricksaust Posted August 26, 2010 Author Posted August 26, 2010 Oberkc, Thanks for you answers. Alright here is what I have. Haven't tested yet but wanted to see if things looked like they would work. Have an Away Mode scene with all the lights I would like to be part. Then I have a folder with the following conditions: Folder Conditions for 'Away Mode Status' Add conditions to limit when programs in this folder are allowed to run. If Control 'Utility Light.C' is switched On Or Status 'Utility Light.C' is On Then Allow the programs in this folder to run. Code to check to see if a light switch was turned on while we were gone: If Control 'Utility Light.1' is switched On Or Control 'Living Lights' is switched On Or Control 'Kitchen Lights' is switched On Or Control 'Dining Lights' is switched On Or Control 'Abby's Room' is switched On Or Control 'Austins Light' is switched On Or Control 'Master Bath Light' is switched On Or Control 'Master Light' is switched On Or Control 'Hall Main' is switched On Then Run Program 'Away ModeProgram' (If) Else - No Actions - (To add one, press 'Action') Code to flash lights and send notification of intruder: If - No Conditions - (To add one, press 'Schedule' or 'Condition') Then Send Notification to 'Email' Repeat 10 times Set Scene 'Additional Scenes / Away Mode' On Wait 2 seconds Set Scene 'Additional Scenes / Away Mode' Off Wait 2 seconds Else - No Actions - (To add one, press 'Action') Guess I am still a little confused what the difference is between status and control so I put both for now. I would think that in this case I would want status to see if the away mode button was still pushed. Thanks, Mike
oberkc Posted August 27, 2010 Posted August 27, 2010 Guess I am still a little confused what the difference is between status and control I think you are part of a large club. It comes, with time. There are MANY posts on this topic. I suggest checking them out. The related question, the one that helps understand the difference between status and control, is "when are program and folder conditions evaluated?". I think of the difference between control and status as being a control is generally true at a point in time...status can be true over a period of time. However, conditions are only evaluated when a control is recieved, or when there is a change of state in status. For example, the following condition: control KPLA is switched on and status KPLB is on is evaluated any time a command related to KPLA is recieved, or the status of KPLB changes. If the status of KPLA changes to "on", the condition is evaluated. If the status of KPLB is already on, then the condition is true. I believe this is the only time this condition can be true. If KPLA is switched off, the condition is evaluated. Obviously, the condition would be false. The harder one is when the status changes, forcing an evaluation. If the status changes to on, the condition will be evaluated and be so as false. Why? Because at that point in time of evluation there was no simultaneous reciept of KPLA control, which is also required for the condition to be true. Anyhow, I hope I got it right and that I did not further confuse things. In your case, I think I would tend to use status of utility light C as the folder condition. In reality, I assume you could use either (status remains unchanged until the condition is reevaluated). The way you have it would work, I expect, but seems inelegant. Code to flash lights and send notification of intruder: Is this the program called 'Away ModeProgram'? Is this program in the foler or outside of the folder? One thing unclear to me at this point is whether your 'additional Scenes / Away Mode' includes the utility light.C. If so, then your folder will turn false as soon as the scene starts flashing and could halt your program if they are both in the folder. Based upon the input of Subroutine, I assume that a scene and command is different than a control of an individual device, so I trust that turning off a scene that includes a device is not the same as sending a control for that device. If so, then this looks good to me. If, however, a device responding to a scene command reacts by transmitting a control command, then you may still have your infinite loop thing going on here. No harm in trying it out. We can learn together.
Mark Sanctuary Posted August 27, 2010 Posted August 27, 2010 Not sure if this helps more but here is the Wiki section about Control vs Status. Thanks,
ricksaust Posted August 27, 2010 Author Posted August 27, 2010 I did have both programs in the away mode status folder. But I didn't have the utility.c in the scene. But you are right there is no need for both of them to be in there. I tried the away mode last night and didn't get any results. Do I have to have an "IF" condition for the "THEN" to run? I didn't have much time last night to troubleshoot much with it so I will take the one program out of the folder and try it again tonight. Thanks for the link on the Control vs Status. Mike
oberkc Posted August 27, 2010 Posted August 27, 2010 I did have both programs in the away mode status folder. Yes, I would be tempted to take the second program out. Do I have to have an "IF" condition for the "THEN" to run? Not necessarily, but this question revealed a potential deficiency that we both missed in you first program. It should call up the "then" path, rather than the "if" path. Try: Then Run Program 'Away ModeProgram' (then) See if this helps.
ricksaust Posted August 27, 2010 Author Posted August 27, 2010 I have changed this to "Then" and will try it when i get back. This does bring up another questions. I see there are the following options: Run (If) Run Then Run Else Stop Enable Disable Enable Run at Start up Disable Run at Start up Most of these make since but just curious the difference between: Run (If) Run Then Run Else Enable I would think that the Run (If) would go with an if statement but you can't do a Run (If) program in the If statement just the Then or Else. I looked on the wiki and was unable to find the difference on these. Not that they are not on there but I wasn't able to find them. Thanks, Mike
Sub-Routine Posted August 27, 2010 Posted August 27, 2010 Hi Mike, Run (If) evaluates the conditions and then proceeds to run the Then or Else actions. Run (Then) and Run (Else) skips all conditions and runs the actions in the Then or Else section of the program. Enable/Disable will allow the program to run based on Conditions or not run, no matter what the Conditions are. Run At Startup will examine the Conditions whenever the ISY is restarted. Rand
ricksaust Posted August 27, 2010 Author Posted August 27, 2010 It sounds like by what you are saying then I will need the Run (If). Thanks so much for taking the time to explain this. Mike
oberkc Posted August 28, 2010 Posted August 28, 2010 But, as indicated, Homelink learns the signal from your existing RF remote I am assuming that your "away mode program" is the third code listed, which is the one which flashes the lights. Correct? If correct, when your second code listing call to run program 'away ModeProgram" (If), there are no conditions to evaluate. I am assuming that this will never evaluate as true, and thus, never run the "then" commands. If so, I still think you want to run (then).
Recommended Posts