Jump to content

Help with Creating Simple Bathroom Fan Program


stillen_i30

Recommended Posts

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

Link to comment

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.

Link to comment
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.

Link to comment
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.

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...