Hello all. Hope all are doing well during this pandemic.
I have a question about the 'right' way to write rules and logic.
I currently have a rule that turns off the exhaust fan in the washroom. Basically, when the fan goes on, a timer starts. After 10 minutes, the fan turns off. This is cancellable if the fan is turned off manually.
Ok, so now I have another rule that detects humidity in the washroom. When the humidity reaches a certain percentage, the fan turns on. Within that same rule, I also have the 10-minute timer.
So basically, I have the same 10-minute timer in both rules. It works, but it feels messy. I know that no one else but me sees the rules, but I am looking for some thoughts on this.
If the second rule, for humidity, simply turns on the fan...won’t the first rule be triggered by the fan turning on and still automatically turn off the fan after 10 minutes?
I don’t believe the humidity rule needs to turn off the fan at all.
There’s also this app that @napalmcsr wrote that can do what you’re looking for, i.e. turn a switch on when the humidity rises above a set threshold, then off when the humidity goes back down, OR it can turn the switch off after x minutes if it was turned on manually.
I have this rule setup for a few bathrooms. I also have a motion in a few that I also leverage to trigger off for the fan. Here is the rule I just run mine for 30