ben-smith Posted August 20, 2010 Posted August 20, 2010 Hello, ISY newb here, long time lurker, still waiting for my ISY to arrive. I've been reading the archives to get a handle on how some of my programs will work. My system is going to start with 4 SWL's, each with a load that controls an outside light. (N, S, E, and W). I want to set them up so that if I operate a SWL 'fast on', it will turn on the next 'off' light of the group, but not all 4. In this example, this would switch them ALL on on a Fast On command. But in reality, I'd want it to break the routine once it turns on the first Off device. (Does that make sense?) If Control 'NorthLights' is switched Fast On Then Set 'NorthLights' On Set 'SouthLights' On Set 'EastLights' On Set 'WestLights' On Else
Algorithm Posted August 20, 2010 Posted August 20, 2010 Hi Ben, If you simply want to turn on the next light in order unconditionally, use four programs: If Control 'NorthLights' is switched Fast On Then Set 'SouthLights' On Else If Control 'SouthLights' is switched Fast On Then Set 'EastLights' On Else If Control 'EastLights' is switched Fast On Then Set 'WestLights' On Else If Control 'WestLights' is switched Fast On Then Set 'NorthLights' On Else If you want to turn on the next light in the sequence which is off, skipping lights that are already on, then it becomes quite a bit more complicated. Let us know which you need.
ben-smith Posted August 20, 2010 Author Posted August 20, 2010 Yeah, the latter is what I need... (Check for the next OFF light, and switch it on). Probably best to wait until I get the ISY installed and start playing. Can you nest additional if/then statements like so? : If Control 'NorthLights' is switched Fast On Then ( If Status 'SouthLights' is Off and If Status 'EastLights' is Off and If Status 'WestLights' is Off ) Then set 'SouthLights' On Else
Algorithm Posted August 20, 2010 Posted August 20, 2010 Yeah, the latter is what I need... (Check for the next OFF light, and switch it on)... Can you nest additional if/then statements Unfortunately, conditions cannot be nested in that manner. To accomplish what you desire, you could create four groups of programs, one group for each switch. The first program in each group would be enabled, and would be activated by a fast on of the associated switch. It would simply call the second program of the group when activated. The remainder of the programs in each group would not be enabled, so they would only run when called from another program. The second program of each group would test whether the next light in the sequence is off, and if so turn it on. If is not off, the program would call the next program in the group, which would test the next light in the sequence, an so on. Does that make sense?
Goose66 Posted August 21, 2010 Posted August 21, 2010 If you don't want this to be circular, then what you want is program folders with conditions: You need four folders, the first with the condition: If Status 'NorthLights' is On And Status 'SouthLights' is Off the second folder with the condition: If Status 'NorthLights' is On And Status 'SouthLights' is On And Status 'EastLights' is On etc. Inside each folder you would have four programs to respond to the Command Fast On for each light and turn on the correct light based on the folder that it is in. However, this is very complex. I know folks want what they want, but what could be the possible use for such a scheme?
ben-smith Posted August 21, 2010 Author Posted August 21, 2010 Thanks for the replies, I'll probably just have to clam up for now, wait till my ISY arrives, and go from there. Kingwr: Good question, why would I need to do that? I was probably just more curious than anything else. I suppose that a fast on to turn on ALL outside lights from any of the 4 keypads would be convenient, easy, and sufficient. Probably less load on the ISY, less code to chew on.
Recommended Posts