markgam Posted August 7, 2010 Share 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 Link to comment
markgam Posted August 7, 2010 Author Share Posted August 7, 2010 Ok, activating the switch to the on position restarts the timer. Link to comment
IndyMike Posted August 7, 2010 Share 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 Link to comment
markgam Posted August 7, 2010 Author Share 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') Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.