markgam Posted August 7, 2010 Posted August 7, 2010 I have a timer for our bathroom and I have been receiving complaints from the occupants of the lights suddenly turning off, so I figure to add a 1 minutes warning. Here is my code: Bathroom Light Timer If Status 'Bathroom Light' is On Then Wait 30 minutes Set 'Bathroom Light' Off Set 'Bathroom Light' On Wait 1 minute Set 'Bathroom Light' Off Else - No Actions - (To add one, press 'Action') First, is this an efficient program and second how would I go about "re-activating" the timer to start the 30 minute count down again? Thanks
markgam Posted August 7, 2010 Author Posted August 7, 2010 Ok, activating the switch to the on position restarts the timer.
IndyMike Posted August 7, 2010 Posted August 7, 2010 Hello Mark, In your program below, when you set the bathroom light to off your "if" condition will become false (i.e the bathroom light status is no longer "on"). The remainder of your then statements may not execute. Try using a control condition for your if statement instead (i.e. If bathroom light is switched on). This should prevent the statements in your "then" loop from re-triggering the program. I have a timer for our bathroom and I have been receiving complaints from the occupants of the lights suddenly turning off, so I figure to add a 1 minutes warning. Here is my code: Bathroom Light Timer If Status 'Bathroom Light' is On Then Wait 30 minutes Set 'Bathroom Light' Off Set 'Bathroom Light' On Wait 1 minute Set 'Bathroom Light' Off Else - No Actions - (To add one, press 'Action') First, is this an efficient program and second how would I go about "re-activating" the timer to start the 30 minute count down again? Thanks
markgam Posted August 7, 2010 Author Posted August 7, 2010 Mike, I see what you mean, so I decided to change the criteria in my If statement, this seems, to work: If Control 'Bathroom Light' is switched On Then Wait 15 minutes Set 'Bathroom Light' Off Set 'Bathroom Light' On Wait 2 minutes Set 'Bathroom Light' Off Else - No Actions - (To add one, press 'Action')
Recommended Posts