Hi,
I need a help with programming and logic. Running 4.2.10(RC4) I have some people in my household that refuse to turn out lights. I want to have a countdown timer to turn out the lights in certain rooms like the bathroom after a set period of time. In some cases a motion sensor works great, however in the bathroom the motions do not work well and things like shower curtains and heat from the shower block the sensors. The logic is this: if a the SwitchLink is not turned off then stay on for a period of time, after the period of time then dim the light to 40% as a notice that is to going to go off, and then turn the light off in thirty seconds. This program works great except that if *gasp* someone actually turns off the light then after the initial timer completes, then the code turns the light back on at 40% for 30 seconds, which I'd rather not do.
If
Control 'Upstairs Bathroom Light' is switched On
Or Control 'Upstairs Bathroom Light' is switched Fast On
Or Control 'Upstairs Bathroom Light' is switched Fade Up
Or Control 'Upstairs Bathroom Light' is switched Fade Down
Or Control 'Upstairs Bathroom Light' is switched Bright
Or Control 'Upstairs Bathroom Light' is switched Dim
Then
Wait 20 minutes and 10 seconds
Set 'Upstairs Bathroom Light' 40%
Wait 30 seconds
Set 'Upstairs Bathroom Light' Fast Off
Else
- No Actions - (To add one, press 'Action')
Using Control 'Upstairs Bathroom Light' is not off failed. I suppose I could call a second program to reevaluate if the light is still on in the then clause, however, there seems like there should be a cleaner way and I'm already upwards of 40 programs and I'd like to keep things simpler.
Another method I tried was with status (different switch in the house)
If
Status 'Master Bathroom Light' is not Off
Then
Wait 10 seconds
Set 'Master Bathroom Light' 40%
Wait 15 seconds
Set 'Master Bathroom Light' Fast Off
Else
- No Actions - (To add one, press 'Action')
I have the timers set much lower for testing. As I would expect on a status program, this program waits the 10 seconds then sets the switch then reruns the 10 seconds then runs the 15 seconds as the status changed. This is a problem because I would like that time to be 20 minutes. I don't think status is the way to go for this one.
Any suggestions beyond a second program for the program with 'control' and any reason why control logic 'is not off' fails to activate the program?
Thanks,
Dan