Dinboise Posted April 1, 2010 Posted April 1, 2010 I was pumped to have the ability to blink the garage lights before they turned off on me. So I wrote this nice set of programs with a flag to be true for the 2 minutes that I had to manually switch the lights on, to interumpt the automatic shut down... If On Mon, Tue, Wed, Thu, Fri Time is 8:00:00AM Or Time is 1:00:00AM Then Disable Program 'G light scene' Repeat 2 times Set 'Garage Light' Off Wait 1 second Set 'Garage Light' On Repeat 1 times Enable Program 'G light scene' Wait 1 second Run Program 'G light flag' (Else Path) Wait 1 minute and 15 seconds Run Program 'G light turn off' (If) Else - No Actions - (To add one, press 'Action') See, beautiful, blinks light, makes flag false and sends ISY to G light turn off (if) If Program 'G light flag' is False Then Set 'Garage Light' Off Else - No Actions - (To add one, press 'Action') tada light goes off. Problem? how do I get this program to only run when the light is at first ON! When I stick it in a folder the folder shuts it off when the light goes out. Same thing with an IF statement about the status/control of the light. I know I am missing something very basic; What do you do? David
Dinboise Posted April 1, 2010 Author Posted April 1, 2010 I think I will make another flag and have a pre-program check the status of the light a minute before the blinking will occur and if the light is already off it will turn the flag to false. Then in the program that blinks the light, I will put an IF clause to run only if that flag is "false". Pre Program If ( On Mon, Tue, Wed, Thu, Fri From 8:19:00AM To 8:30:00AM (same day) Or From 12:59:00AM To 1:15:00AM (same day) ) And Status 'Garage Light' is On Then Run Program 'G light flag 2' (Then Path) Else Run Program 'G light flag 2' (Else Path) We shall see. Seems too complicated though for what it is. David
oberkc Posted April 1, 2010 Posted April 1, 2010 First, confessions. You already appear to me to be a more advanced programmer of the ISY than I. Still, I wonder if.... I like the idea of putting your program in a folder that is true only if your light is on. The missing part of that equation, however, may be to remove the blinking program steps from your "then" path and putting them into a separate program without "if" conditions. This new program should not be in the folder, so that once it starts running, it is not affected by the condition of the garage light. Something like: Folder condition If garage light status is on Edited program, in the folder If On Mon, Tue, Wed, Thu, Fri Time is 8:00:00AM Or Time is 1:00:00AM Then Run New Blink Program (then path) Else - No Actions - (To add one, press 'Action') New Blink Program, not in the folder: If Then Disable Program 'G light scene' Repeat 2 times Set 'Garage Light' Off Wait 1 second Set 'Garage Light' On Repeat 1 times Enable Program 'G light scene' Wait 1 second Run Program 'G light flag' (Else Path) Wait 1 minute and 15 seconds Run Program 'G light turn off' (If) Else - No Actions - (To add one, press 'Action')
Dinboise Posted April 1, 2010 Author Posted April 1, 2010 Sometimes, to figure things out you need a fresh perspective. I didn't think about sending the ISY to a different program. Much more elegant than contriving more flags. You are much more wise than I. Much better to simplify than increase complexity. Works fine now. Thanks for the help. David
Recommended Posts