stillen_i30 Posted November 28, 2013 Posted November 28, 2013 Hello, I have a bathroom light controlled by one switchlinc and an exhaust fan by another switchlinc. I'm not the best with variables and could not yet get a good footing on how to use them... What I would like to do is: -If someone turns on the bathroom light to use the toilet under 5 mins, only the light will turn on/off manually (by the person) -If someone is going to take a shower and turns on the light, after 5 mins the fan will turn on and run for 30 mins then turn off I know I can do this with programs alone, but can someone show me how I could write a simple program using variables (and whether its state or integer)? Thanks
apostolakisl Posted November 28, 2013 Posted November 28, 2013 You don't need any variables for this. If status bathroom light if not off Then wait 5 minutes set bathroom fan on Else blank The above program will turn the fan on if the bathroom light is on for 5 continuous minutes. The fan will run until manually turned off. If you want the fan to shut off automatically: If status bathroom light is not off Then wait 5 minutes run program 2 "else" clause Else blank Program 2 If control bathroom fan is switched on Then -blank Else set bathroom fan on wait 10 minutes set bathroom fan off The above 2 programs will turn the fan on after 5 minutes and run it for 10 minutes. If you click the "on" paddle of the fan switch it will abort the timer and the fan will keep running until manually turned off. Also if you turn the light off then back on it will reset the whole process.
stillen_i30 Posted November 29, 2013 Author Posted November 29, 2013 Thanks for the suggestion...tried the above and the following problem occurs: -When the lights switch is turned on, the fan remains off, however, once I turn OFF the lights switch the fan turns on??
oberkc Posted November 29, 2013 Posted November 29, 2013 When the lights switch is turned on, the fan remains off, however, once I turn OFF the lights switch the fan turns on?? I am having trouble explaining the described behaviour based on apostolakisl program. I cannot see how turning off the light would trigger the fan. In your version of the second program, are you using "control" or "status"? If you don't mind, please post your programs.
apostolakisl Posted November 29, 2013 Posted November 29, 2013 Thanks for the suggestion...tried the above and the following problem occurs: -When the lights switch is turned on, the fan remains off, however, once I turn OFF the lights switch the fan turns on?? Perhaps you didn't put in the "not" IF status bathroom light is NOT off
stillen_i30 Posted November 30, 2013 Author Posted November 30, 2013 ok I rechecked everything and now it is working fine...don't know why it was different last night. At any rate, if upon entry into the bathroom someone were to manually turn the fan on and then forget to turn it off, would the above programs still turn it off automatically?
apostolakisl Posted November 30, 2013 Posted November 30, 2013 ok I rechecked everything and now it is working fine...don't know why it was different last night. At any rate, if upon entry into the bathroom someone were to manually turn the fan on and then forget to turn it off, would the above programs still turn it off automatically? No. But if you used the "then" section of program 2 and put Then Wait x minutes Set bathroom fan off it would.
Recommended Posts