JimV Posted January 22, 2010 Posted January 22, 2010 I am trying to adapt the drapes programs that 'tcster' reported on Mar 23, 2008 to a single KPL. His programs allowed the user to open and close the drapes with KPL switches while maintaining the integrity of his timed based programs to open and close the drapes. I have tried to adapt his code to a single KPL button with limited success. The first two programs open and close the drapes based on time of day and work well. Drapes Morning If Time is 9:30:00AM Then Set 'Drape plug' On Wait 20 seconds Set 'Drape plug' Off Else -No Actions Drapes Evening If Time is Sunset Then Set 'Drape plug' On Wait 20 seconds Set 'Drape plug' Off Else -No Actions I also have two programs adapted from 'tcster' that open and close the drapes using a KPL button and again they work well by themselves. Drapes Button Open If Status 'Kitch KPL-D' is On Then Set 'Drape plug' On Wait 20 seconds Set 'Drape plug' Off Else -No Actions Drapes Button Close If Status 'Kitch KPL-D' is Off Then Set 'Drape plug' On Wait 20 seconds Set 'Drape plug' Off Else -No Actions What 'tcster' was able to do and I am not is to set the condition of the KPL-D button depending if the drapes are open (On) or closed (Off). Setting this condition allowed him to add code that determined if the drapes were, for example, opened before 9:30AM by using the KPL-D button and preventing the "timed" program from incorrectly shutting the drapes. I cannot find a way to change the On/Off status of the KPL-D button other than when the button is pressed manually, but not when the timed programs run. I hope I am clear in what I am asking and would like to thank you in advance for any assistance you can provide. Quote
Sub-Routine Posted January 22, 2010 Posted January 22, 2010 Hi JimV, To set the state of a KPL button the button must be in a scene and then you control the scene. Drapes Morning If Time is 9:30:00AM And Status 'Kitch KPL-D' is On Then Set 'Drape plug' On Wait 20 seconds Set 'Drape plug' Off Set Scene 'Kitch KPL-D Button' Off Else -No Actions Rand 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.