[RELEASE] Smarter Humidity Fan

@Shaneb Could you attach your settings and paste any logs you saw? Generally if you have all logging enabled you should be able to see why it’s turning on, and why it turns off (or doesn’t).

I don't think it's an issue with the app just my settings keeping it on

Yeah, I tend to agree -- that's a very wide smart range, and keep in mind that sometimes there's a bit of a humidity rebound right after a fan goes off. I could see a rise of 2% happening after the fan shuts off, or also tripping the .33% sensitivity setting again.

Of course, if it just flat out doesn't go off at all, for hours, then that's a different story. So long as the humidity is within the range you defined and the fan has been running for at least the auto-off time, it should shut off.

Check the logs the next time, and see what they say.

@Shaneb Oh, and FWIW, the settings in the screenshot on the initial post are of the current version, and reflect what I am currently using "in production" :smiley:

1 Like

@erniemiller I changed them to that today to see how it went but not had chance to try yet. I'll try same as your screenshot

This morning I released v1.3.0.

  • Added a child virtual switch to signal to other apps that smart mode is active
  • Added additional switches to turn on/off when smart mode goes active/inactive
  • Improved readability of settings page via disclosure triangles for instructions

Long story short, I've added motion sensors to my bathrooms, but when I'm in the shower, behind a thick pane of glass, they can't see me. I've added a virtual switch child of the app which can signal to apps like Motion Lighting to disable auto-off while I'm in the shower. Additionally, these auto-created switches can trigger more complex rules from things like Rule Machine, if desired.

Lastly, I've added a secondary optional input for additional switches to turn on/off with Smart Mode. This way, I can have my motion sensors trigger the bathroom lights, and when smart mode kicks in and turns on the fan, it also turns on the shower lights, for instance.

3 Likes

Great work on the app @erniemiller, I plan to give this a go in the next day or two for the dehumidifier in my garage.

One question I have is, I would like to introduce a condition where if any of the doors to my garage have been open for X minutes (say 20 minutes), I would like to turn my dehumidifier off, as it is somewhat wasted trying to run when open to the outside air. Can the app do this for me already or would you consider introducing something like this? Essentially a switch or set of switches that can disable the app? I'd be happy to set up a virtual switch to reference in the app and then define my own rules to manage the toggling of that switch.

Thanks,
Simon

Hey Simon. Right now the app is very much designed to control exhaust fans in a bathroom to reduce humidity. That being said, I think looking at a specific switch to disable wouldn’t be a terrible idea and is something I’d be open to adding.

2 Likes

Thanks Ernie.

I've installed the app and it was very easy to setup, even with my slightly different use case. I just selected my temperature / humidity sensor, referenced my smart plug in place of a fan and most of the other settings were left as defaults except I chose to turn off the Excessive Change Threshold and to not activate the app during Night Mode, mostly to conserve power.

Thanks again for your work on this.

Simon

2 Likes

@sburke781 just a heads up -- I just released v1.4.0 with this feature. Hope it helps.

2 Likes

Thanks, I'll give it a go and let you know, will probably be another 8-12 hours before I can test.

Thanks for such a quick turnaround,
Simon

2 Likes

G'day @erniemiller,

Unfortunately today wasn't a good day to test the your humidity app, maxing out ~40°C and staying easily under my lower bound of 58% for most of the day.

I'll take a closer look tomorrow.

Simon

All good! Enjoy the low humidity. :smile:

@erniemiller, Love the app and it's exactly what I've been looking for. I tried a while back to create my own version that balanced a maximum humidity value, a rapid change, and a change above a baseline, but I could never get it to work the way that I wanted. You've put a lot of thought into this and come up with something that I think will work really well for me.

I did have a suggestion that I wanted to get your thoughts on. What do you think about changing this condition:

else if (
    excessiveChange > 0 &&
    state.humidityChange >= excessiveChange
)

to this:

else if (
    excessiveChange > 0 &&
    state.humidityChange >= excessiveChange &&
    currentHumidity > minHumidity
)

My smart range is 65% to 75%, with an excessive change of 5%, but I had the situation this morning where the humidity went from 43% to 48% between readings. This caused the fan to turn on due to the excessive change, which isn't really what I wanted, since it's already way below the smart range minimum.

Hmm, maybe that's not necessary. Maybe I can get around it with a change to the settings.

My humidity sensor reports according to the following:
Whenever the change in humidity is greater than 5%
OR
Every 30 minutes if the change in humidity is less than 5%

So I very rarely get changes in humidity greater than 7% between reports. That gives me a pretty narrow window to work with for the excessive change threshold. Also, the 30 minute interval means that the excessive change is almost always detected before the sensitivity is exceeded.

The baseline humidity this morning was pretty chaotic, but ultimately the problem occurred because it missed a report, so the 5% change occurred over an hour (instead of the usual 30 minutes), which caused the excessive change to be triggered.

I'm going to try changing the excessive change threshold to 6% and see if that helps. If not, then I may disable the excessive change altogether. It'll take longer for the fan to turn on initially, as the excessive change is usually detected 2-4 minutes after the shower is turned on, whereas the sensitivity is detected 7-8 minutes after, but that may be what it takes to prevent the false positives.

Sorry if I'm being a little dumb here, but isn't one threshold event enough? Why is there a range? Having:
if (current > min)
fanOn();
else if (current > max)
fanOn();

doesn't kae much sense to me, as the first part of condition is sufficient. I'm probably missing something here so I'd like to ask for what do you utilize the max value?

The fan only turns on above the minimum value if the humidity is currently increasing beyond the supplied sensitivity (rate of change). Once it exceeds the max value, it enables regardless of the rate of change. This prevents a slow creep of humidity due to ambient conditions bypassing the exhaust fan trigger.

That explains it, thank you. However, rapidly switching on/off states when humidity oscilates around threshold value (minimum, in this case), is usually solved differently. It turns on when value reaches maxThreshold - no matter how big increments are - and turns off only when it's under minThreshold. That way, you don't have to worry about increase speed (= Excessive Change workaround for Aqara) at all. See this example - min is 40, max is 50, first column is current value:
30 - do nothing
35 - do nothing
40 - do nothing
45 - do nothing
50 - turn fan on
55 - do nothing (leave fan on)
50 - do nothing (leave fan on)
45 - do nothing (leave fan on)
50 - do nothing (leave fan on)
45 - do nothing (leave fan on)
40 - turn fan off
35 - do nothing
40 - do nothing
45 - do nothing

This is how it's usually solved in thermostats (just the oposite way, as you want to increase temperature, and here you want to decrease humidity).
Implementing it this way, not relying on increment speed, only checking absolute values, would make this app more relyable even for Aqara, without that workaround settings.

I mean, I appreciate your work, and I'm glad you did it so we can automate our bathroom fans in a nice and easy way. This is just a suggestion how it could be made a bit better.