Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help with Creating Simple Bathroom Fan Program

Featured Replies

Posted

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

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.

  • Author

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??

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.

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

  • Author

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?

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.

Guest
This topic is now closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.