Automated ventilation fan bathroom based on humidity

In my bathroom I want to automate ventilation based on humidity level. My fan has 2 speeds and is controlled by a Fibaro FGS223 switch. Humidity is measured by an Aeotec Multisensor 6 that runs on power via USB (so no batteries).
I also use Reactor plugin for several automations.
I read the thread HOW-TO: Time Series - Reactor - Ezlo Community
I like this way to steer the fan based on spikes in the humidity levels. I also have concluded that you cannot use a fixed humidity level because of the seasonal influences (winter-summer). But even from day to day it can vary. In Holland we had very nice sunny weather past week and basic humidity level in the bathroom was say 43%. But today it has rained whole day and the basic level increased to 58%.
But my big question is: how can I stop the fan automatically when humidity level is (almost) back on the starting level ?
Start the fan is easy, from the moment there is activity in the bathroom (motion, lights on) and humidity starts increasing → just start the fan at a certain difference between max and min in a certain period (“range”)
But when you take a shower or a bath the humidity level will stay on a high level for as long as the shower or bath lasts. So in that period the “range” will be very small but the fan should be on max level.
When you are finished the humidity level will decrease fast during first 10-15 minutes (1% per minute) and then decreases very slowly (only 0,1-0,2% per minute).
I don’t know how to do this using this method.

My alternative idea is to get the humidity level at te moment activity starts in the bathroom (I want to use a virtual switch for that: “BathroomActive|”.
That HumidtyStart level must be determined once at the beginning and then remain unchanged.
Also I would use a variable “HumidityDIFF” as an expression which is Current Humidity Level minus HumidityStart.
This way I could start fan at low speed at the beginning of the activity, set it at high speed when the HumidityDIFF is for example > 3.
When the HumidityDIFF is < 3 again set the fan back on low speed.
My Question is how can I define a variable Humidity Start without updates during the activity ?

Who can help ?

A lot of approaches to take here. One may simply be, when you determine it’s time to turn the fan on, you save the average of the low samples… if you have one sample per minute and you’re keeping 10 samples as your window, you keep the average of the oldest (presumably least humid/before shower) half (5) of them as a reference starting humidity. You then turn off when delta-H is small and you’re close to the reference start.

By example, let’s say you look for a 10% change over the 10-minute period to start ventilation. You estimate that when the humidity is within 5% of the start and the rate of change is below 3% over the 10-minute sampling period, you are finished and can turn the ventilation off.

At some time during the day, you see these samples:

43,44,43,44,43,45,46,48,52,58

So your δ-humidity is 15 (max-min == 58-43), it’s time to turn the ventilation on. At that time, you also compute and save the mean/average of the oldest 5 samples: 43.4.

Now you just wait, until the δ-humidity is <= 3, and the most recent sample is less than 45.57 (43.4 x 1.05), and when you see that, ventilation off.

Here you can see the set of expressions that would do this, and the conditions:

Here are the actions. The only thing tricky here is the Set Variable expression computing the low cutoff point and saving it in the variable low_cutoff.

Edit: and I just realized I forgot to change the name of the switch before doing the screenshots, but you get the idea… they should have been “Vent Switch” or similar.

3 Likes

I compare the bathroom humidity level with the living room humidity level. When Bath - Living > 20, turn on bath fan. You have to experiment on the target delta since different devices measure humidity better than others.

Interesting, having the same “issue”. Gonna try this soon.

1 Like

Similar here for our laundry room. I compare it to outside humidity minus 20 and I never trigger if it’s under 45, since this is an optimal humidity value per se. I usually turn the fan off after a fixed amount of time (15 minutes) and recheck the condition every 30 minutes. The fan usually run 1-2 times per day. But @rigpapa’s solution is really more elegant and I’ll probably try to write a similar feature in the future :wink:

1 Like

@rigpapa:
Many thanks for your help, really useful!
Because my Aetotec Multisensor 6 (on USB power) shows quite stable humidity figures (without strange unexplainable peaks) I decided to nut use the series solutions but start quite basic.

When first movement in the bathroom is registered by the Multisensor 6 a virtual switch BathroomActive is put on “ON”. Lights go on and the fan is started on low circulation speed. At the same time the humidity level is registered, it is called “RVstart” (sorry, Dutch…) as a variable with no expression.
A variable “RVactueel” is defined as an expression, getting the actual humidity level from the Multisensor 6
Another variable “RV diff” is defnied as an expression: RVactueel-RVstart.

As soon as RVdiff >5 the fan is put on high circulation speed.
When humidity levels start decreasing afther the bath or shower the fan goes back to low speed as soon as RVdiff drops <5.
As soon as RVdiff > 3 the fan is put on off.
Some screen shots from reactor:

Expressions:

Conditions:

Activities:

This is all done in 1 Reactor Sensor for the Bathroom with 7 groups of conditions and activities.
Did some testing and some tweaking and it seems to work very well

2 Likes

Some help please @rigpapa , busy with your solution, but stuck with some itmes. Push is not a function? And some others, but I think because of the push.

Edit: Changed push to arraypush… lets see

Ok, playing with @rigpapa his solution, but so far not the result I would like.

First of al, the Fan On, also goes true when the percentage drops more then 10%:
[72,69,68,66,65,64,63,62,61,62]

Besides that it also goes wrong when more people are taking a shower within say 1 hour.
Humidity rises for 15%, then drops about 8, new person takes a shower, humidity rises again, etc.
Then the last 10 values are < 10.

And so far I can’t find good settings to turn the fan off. This takes way too long.

To compare, I now use just this: above 72%, turn fan on, below 72% turn fan off. That work pretty good. During the winter the values are somewhat different.

@Mai_Pensato

A little help please. I am going to place a motion sensor in my bathroom too. Looked at your solution, but what and how do you mean with When first movement … I mean If there is constant movement, RVstart is constantly changing and RCdiff will never be > 5. How did you do this exactly?

Gently reminder…

Hi it is just as I described. At first movement in the bathroom a virtual switch called Bathroom Active is put ON. At that moment RVstart is set at that moment. This value does not change during the time Bathroom Active is ON.

Ah… seems I didn’t read close enough. Thanks, now it makes sense.

@Mai_Pensato I read you are using a Aetotec Multisensor 6. Are you happy with this one? I am looking for a multisensor for my bathroom, but I read several negative reviews about it. Not accurate and very slow. Not directly for the motion, but in some case humidity is 20 minutes behind. Do you have this too? Could you share your experience please?

I have it on USB power and very satisfied. Motion detection is accurate. Humidity and also temp react fast. You can set parameters on change levels to report. Within 2 minutes after start of shower the humity level starts to increase. Range from below 50% to over 80%.
Although absolute level is not that important it seems quite accurate. Light levels in Lux are way to low, much lower than Fibaro 3in1. On batteries this automation will not work.

Thanks. I think I will buy one one then and have it powered on USB.

@Mai_Pensato

Sorry, just a few more questions… hopefully the last.

When do you set the virtual switch to in-active? After a certain time of no movement?

As we have 3 kids, they often use the bathroom for say 1.5 hr total. So there is 1.5 hr movement.
How do you set and use the humidity value from the beginning? I mean, with every new movement, the RVstart is set and so RVDiff is shifting.

Maybe you could share all condition, expression (I think you did already) and actions?

Maybe I am thinking way to difficult…

The virtual switch is set to inactive when RVdiff < 3 and there is no movement. The fan is than stopped.
It usually takes 1-1,5 hour after shower or bath to get the humidity (RV) back on that level.

Still have to figure out when the bathroomactivity should set to OFF. I now see that it sometimes stays ON for ever.
This is because someone enters the bathroom (ON) and humidity never changes. Then the fan is never turned of and of and thus bathroomactivity will never be set to OFF, because RVdiff is 0 and stays 0. Any tips?

Already tried about setting bathroomctivity to Off after 5 minutes, but then the RVstart is set again every 5 minutes and despite humidity is rising, it will never be > 10.

I have set it as follows: bathroom active = OFF when RVdiff <3 AND no motion

Ok makes sense. I have a fibaro motion sensor (the well known eye ball) and with this answer I think I have to do something with the motion. How to you use AS LONG THERE IS MOTION? I mean the sensor trips, and that is one time. After 8 seconds the sensor reacts again if there is (still) motion. But it can be, there is 1 second no motion, because it has to measure again. You see this in the UI, sensor is red, after 8 seconds it goes back to white, and right again it will become red again. But that means, activity will be triggered again and so the RVstart will be set again. And this can happens several times. Hope you know what I mean. How can this be solved?

O btw how do you turn off the light? Turn it off after several minutes after movement? Useless to leave it on as long bathroomactive is ON, (1.5hr)