Total noob, so I apologize if this is simple. I have a humidity sensor for controlling bathroom fan during/after shower. At this point I'm just doing some diagnostics to evaluate the effectiveness of what I eventually want to write to do the control.
I've been using RM + AutoRemote to Tasker + AutoTools to help graph the changes in humidity (haven't figured out InfluxDB + Grafana...or really best way to run local server – I don't know anything about Raspberry Pi, but do have a Windows 10 PC that's able to stay on).
Anyhow, I digress... I've found a humidity value via the graph where I am confident that is where I'll know the fan is needed (it may already be on, if turned on manually). What I'd like to do at this point is determine how long it would stay on, if it triggers at that humidity (A), and stays on until the humidity drops to a lesser humidity (B) that is still above the typical room humidity (don't want the fan fighting to get back to nominal...just enough to deal with the shower).
So, can anyone provide any help on a rule to measure how much time lapses between A and B?
So basically the humidity is captured when the light in the room goes if the fan is currently off. Then the other rule looks for the humidity to climb by 4% (still fine tuning this) and once it does the fan is turned on. Then it will run until the humidity goes back down to 2% above the start point.
Note that I also have another rule that will turn off the exhaust fan if it's been running for 15 min and the bathroom light is off. Kind of a catch all.
Note too that the "virtual" fan is there because the driver on the fan part of this switch isn't updating for me properly. Hopefully it will get fixed at some point but I can't get any reply from anyone else that has one of these to see if it's just something I'm seeing or if others are as well. But this work around does the trick for now.
I've yet to include humidity in my bath fan control. However I've been thinking of the rule I might use. I live in the northeast and often the warm humid air should be kept inside.
It should be on long enough to keep the moisture from coating the walls.
In the winter when its cold and dry outside the fan should go off as soon as it can.
In the Hot Humid summer the fan should be balances somehow, I don't have a good set of parameters for this yet.
So basically I have to determine if the air in the bathroom is more or less desirable than the air outside.
I have a humidity sensor for controlling bathroom fan during/after shower. At this point I'm just doing some diagnostics to evaluate the effectiveness of what I eventually want to write to do the control. ... What I'd like to do at this point is determine how long it would stay on, if it triggers at that humidity (A), and stays on until the humidity drops to a lesser humidity (B) that is still above the typical room humidity
@es_ferret, this app above does a percentage of humidity change, and not actual humidity numbers, so you have very few false triggers, and it accounts for low vs high relative humidity.
It can run the fan for a predetermined amount of time after a humidity percentage drop too.
Wow! Thank you all. There's definitely a lot of options. I'm going to need to play around with a few to see what I like best (I figure that is part of the fun of this).
Two follow ups - many of the answers are centered on how to actually control the fan, and that is ultimately what I want to do once I get the smart switch that I've been looking at purchasing, but...
how could I also measure the amount of time that the fan stays on and...
how do I keep that rule from repeatedly retriggering every time it receives a humidity value, and sees that it's greater than the start limit (while in the shower - if I use the example above let's say 70°)?
Yup could use time variables to hold the on and off time or you could use the logs to determine run time.
Additionally the rule will process continually but the “wait for conditions” are reset every time the rule runs. This would prevent the switch from short cycling.
I imagine the report time is about once every couple of min or once every few % of change
You can use the Private Boolean of the rule. Set it once the rule first triggers. Check for it at the top of the rule with a conditional to exit the rule if it's not yet "reset" . Once the rule completes, reset it once again.
PBs can be confusing and not easy to manually reset. So you could also use a local variable to the rule to achieve the same thing with a little more transparency.
then after getting what I wanted (adding number variables to calculate time elapsed), I went to change the wait condition, which broke the rule.
I keep getting this error if I go into actions. I have a hunch the humidity option in wait for condition is setup for a string and not a decimal, and that now that I used a decimal (when I changed the value) it's locked up and I have to start over?