mitch236 Posted February 23, 2010 Posted February 23, 2010 I tried to program my daughter's nightstand lamp in the following manner: If status 'light' is not Off Then wait 10 minutes set 'light' 75% wait 10 minutes set 'light' 50% wait 10 minutes set 'light' 25% wait 10 minutes set 'light' Off The reason I ask is I tried it but it stops at 75%. Is there a way to do what I'm trying to do? Thanks! Quote
MarkJames Posted February 23, 2010 Posted February 23, 2010 That looks like it should fade the light off - 25% every 10 minutes. However you really should put the light into a scene. Simply create a scene called 'my daughters light' with whatever the light as a responder. You can then use the insteon - adjust scene command to dim the light. Even simpler still, though, why don't you just put it in a scene with a ramp rate of 40 minutes and turn it off? That's much more straight forwards and doesn't depend on a program. The lamp will simply dim down over 40 minutes to off. It doesn't have to have this ramp rate for everyday use - just as part of that one scene. mark Quote
mitch236 Posted February 23, 2010 Author Posted February 23, 2010 I actually tried something else and it seems to work. I created a folder and just wrote four programs. If status 'light' is on Then wait 10 minutes set 'light' 75% The next program: If status 'light' is 75% Then wait 10 minutes set 'light' 50% and so on. It's working. I didn't want to ramp down the light because it is one of those low consumption florescent bulbs and I didn't want it to flicker. Thanks!!! Quote
markens Posted February 23, 2010 Posted February 23, 2010 MarkJames made some excellent suggestions. But it's useful to understand why your original program doesn't work as you expected: When the "set 'light' 75%" executes in your program, it causes the status of 'light' to change (assuming the original level was not 75% when turned on). And since this program looks at that status in its conditions, the wait terminates and the program restarts, evaluating its conditions again. The first "wait 10" executes, along with "set 'light' 75%" again. But the light is already at 75% this time, so this command doesn't change the light's status in the ISY and the program continues. Now the change to 50% triggers this sequence over again. And next time the 75% changes status, resulting in cycling between 75% and 50% indefinitely. So, here's what I believe your original program will do if allowed to continue: (light on) : wait 10 : light 75% : wait 20 : light 50% : wait 10 : light 75% : ... --Mark Quote
markens Posted February 23, 2010 Posted February 23, 2010 I actually tried something else and it seems to work. I created a folder and just wrote four programs. Yup, your series of four programs removed the wait/reevaluate problem of the original program. Note that changing the light's status manually will cause any of these executing program to terminate, and evaluate conditions again (which is probably what you want anyway). For example, the light is at 50% and someone turns it full on again. Your step-down sequence will start over. --Mark Quote
MarkJames Posted February 23, 2010 Posted February 23, 2010 When the "set 'light' 75%" executes in your program, it causes the status of 'light' to change (assuming the original level was not 75% when turned on). And since this program looks at that status in its conditions, the wait terminates and the program restarts, That was it... I knew that's what it was - I just couldn't see it. I get bit by the 'change the condition, restart the program' mistake ALL the time. mark Quote
mitch236 Posted February 24, 2010 Author Posted February 24, 2010 Thanks guys!! I'm learning alot hanging around here!!! Quote
MarkJames Posted February 24, 2010 Posted February 24, 2010 The thing to remember - that markens pointed out - is the way ISY handles programs. The IF condition part of the program is continuously monitored. An IF (status) is ON will be evaluated every time the status changes - so if it's ON and it goes OFF the condition will be reevaluated and the ELSE will happen. An IF (condition) like ON pressed will be evaluated whether it's an ON or and OFF. If at any time the IF changes the program will STOP if it's running and the whole IF is reevaluated and the THEN or the ELSE happens. So if you have a series of steps separated by a WAIT and the program is in the middle of the wait all is well until the IF changes again - that will cancel your program and start the whole thing over again with the appropriate then or else. It's an interesting way to do it - and it confused the crap out of me for a bit. I think markens is the one who explained it to me the first time, too. It makes you think more 'dynamically' and though it creates a few problems it also solves a few. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.