For my bathroom fan I set up three programs that provide a simple timer that will run the fan for 10 minutes for each time the ON switch is pressed.
First I created a STATE variable: sMasterBathFan with an initial value of 0.
The first program adds 1 to the state variable each time the on button is pressed:
MBA Fan - On - [ID 002C][Parent 002F]
If
Control 'MBA Exhaust Fan' is switched On
Then
$sMasterBathFan += 1
Else
- No Actions - (To add one, press 'Action')
Then a program to zero the variable if the off button is pressed:
MBA Fan - Off - [ID 002E][Parent 002F]
If
Control 'MBA Exhaust Fan' is switched Off
Then
$sMasterBathFan = 0
Else
- No Actions - (To add one, press 'Action')
And a control program that will decrement the variable by 1 every 10 minutes and turn the fan off when the variable is 0:
MBA Fan - Control - [ID 002D][Parent 002F]
If
$sMasterBathFan > 0
Then
Wait 10 minutes
$sMasterBathFan -= 1
Else
Set 'MBA Exhaust Fan' Off
I do plan on implementing humidity control whenever I get a sensor, but this set of programs work well for now.