d529518 Posted April 21, 2012 Posted April 21, 2012 Can anyone explain why the below program fails to wait the 2 minutes as specified in the Repeat clause? It instead cycles the light on/off every 30 seconds - *never* waiting the requested 2 mins for the 'repeat' clause. I cannot understand what the ISY is doing. Shouldn't it immediately execute the Wait 30 Seconds, then turn lamp on(off), then wait another 2 mins to do the repeat? (Note: below program is only for test purposes. I am only trying to figure out how to predict and control when the IF clause fires. So if it looks like it is performing a useless function, then, yes, that is true.) If From 5:28:00PM For 15 minutes And Status 'Living Room / Living Room Torchiere Lamp' is Off Then Repeat Every 2 minutes Wait 30 seconds Set 'Living Room / Living Room Torchiere Lamp' On Else Wait 30 seconds Set 'Living Room / Living Room Torchiere Lamp' Off It would be extremely helpful if someone could explain what is really going on in the ISY behind the 'IF'. For the life of me I cannot get my head around the actual events and conditions that trigger the evaluation of the IF clause. And this is preventing me from making effective programs.
oberkc Posted April 21, 2012 Posted April 21, 2012 I suspect that when the "then" clause runs, it turns the torchier light on, which changes the program condition to false, halting the "then" cluase and forcing execution of the "else" clause.
LeeG Posted April 21, 2012 Posted April 21, 2012 oberkc is exactly right. The Then clause changes the Status of the device in the IF statement. Whenever a Repeat or Wait is encountered the If is reevaluated. Since the Status is now False the Else runs. Two solutions. Change the If Status to If Control which will trigger the Program only when an On command is received from the device. Or move the Then logic into a second Program. Have the Then of the first Program invoke the second Program. That way when the If of the first Program is reevaluated and the Else runs it will not affect the second Program.
LeeG Posted April 21, 2012 Posted April 21, 2012 Suggest you post what the Program should be accomplishing. I don’t think either of my suggestions will give you what you want. Once the requirement is understood a good suggestion can be offered.
Recommended Posts