Measure Duration

Good point. Still learning. Thanks @Hasty1

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.

  1. It should be on long enough to keep the moisture from coating the walls.

  2. In the winter when its cold and dry outside the fan should go off as soon as it can.

  3. 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.

Setup seasonal virtual switches and apply your humidity settings based on which switch is on.

I've an app i use, tuns on at humidity level and off at a lower level, override and time out option

Edit
I see your looking at a humidity offset, maybe another humidity device?
You might want to look at hubigraphs

1 Like

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

I wasted many evenings trying to do something similar, and then found this app on the Hubitat community pages that triggers based on humidity changes: SmartThingsStuff/smartapps/craig-romei/smart-humidity-fan.src at master · napalmcsr/SmartThingsStuff · GitHub. Works well and we have not needed to tweak any settings since commissioning it.

2 Likes

Was going to suggest the same thing.

@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.

3 Likes

Smart humidity fan is also found on Hubitat package manager

4 Likes

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

  1. how could I also measure the amount of time that the fan stays on and...
  2. 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°)?

Easiest would be use the Smart Humidity Fan app that they linked.

3 Likes

The rule Hasty1 gave will let you set a variance for both sides of the test mine looks like this now:

It's pretty short and sweet I just added the test for the light being on as I only want it happening if someone is really in the bathroom.

Note that the Master_Bath_Humidity is a variable that I am setting in another rule if the fan is not already on and the light is turned on.

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

1 Like

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.

1 Like

Ok. I tried something like this in Rule Machine

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?

That is out of my area of knowledge. @bravenel might be of some help.

Oops. I meant to quote your message, but not direct the reply to just you.

No humidity is a number. But that error sounds like you used the back arrow in your browser somewhere along the way. Delete the rule and start fresh.

I had already rebuilt it before your response. This time I cloned it, and then went into the action and changed the wait for condition on the humidity from 57 to 56.77, and as soon as I click done I get the same error.

Now perhaps it persists because there's no other option but to go back or to the app list, but it first comes up when I use a decimal. Although not in these screenshots the initial trigger does take a decimal (it did during my first attempt I didn't want to risk it this time), so are you saying that that's decimal but the wait for action is number?

Not sure what all the sets are for. My rule for this looks like:

I have another rule that will capture into the Master_Bath_Humidity global variable the humidity when the bathroom light turns on if the fan is not already running. Then this rule will turn the fan on if the humidity is 2% over that reading and the light is on. It will turn off once the light is off and the humidity falls back to 5% above the initial reading. Plus there is a 3rd catch all rule for my bathroom fans that will turn any of them off after they have been running for 20 minutes if the light is off in the bathroom. That way if they are turned on via any rule or by hand they will go off eventually.

If you are going to all that effort, I think that is exactly the math that the Smart Humidity app does.

2 Likes

Just didn't want another app. :smiley: And it helps me learn.