🚿 Bathroom Humidity Exhaust Fan

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

GitHub Link Click Here

Step into the future of freshness - customize it your way and experience the convenience of automated humidity control! :herb::shower:

Like this blueprint? Consider hitting the :heart: button below :+1:

Version: 2.5 :fire:

:warning:You must be on Home Assistant Version 2024.6 or later.

Need help? :eyes: See our FAQ: Click Here

:newspaper: The Automation Process:

  • Trigger:

    • When the derivative percentage rises above a set value, the fan turns ON
    • When the derivative percentage falls below a set value, the automation waits for a time delay and then turns the fan OFF.
    • Optional - Set a maximum humidity percentage to trigger the fan ON. This is useful when having back-to-back showers.

    :warning: Note: You must have a humidity sensor in the bathroom and set up a ‘Derivative Helper’ for this automation to work.

  • Manual Trigger Option:

    • This feature allows you to manually trigger the automation.
  • Multi-Speed Fan Control Option:

    • You have the option to use fan speeds to control the staging of your fan.
    • You can choose to stage your fan in your preferred configuration, such as High/Off, High/Low, High/Low/Off, High/Med/Low, etc.
  • Winter Mode Option:

    • You have the option to use ‘Winter Mode.’ This mode allows for different settings to be applied, accommodating the typically higher humidity levels experienced in winter compared to summer.
  • Light Control Option:

    • Use the “Light Control” option to turn ON lights, adjusting brightness levels, colour temperatures, and transition times.
    • This feature is commonly utilized with LED lights in a shower niche.
    • For expanded lighting options, consider integrating my :bulb:Sensor Light blueprint, which utilizes the automation link feature.
  • Manual Control Option:

    • Use a manual fan switch to toggle the fan ON/OFF.
    • Opt to use the auto-OFF option for timer-like functionality.
    • This is particularly useful for removing unwanted fumes from deodorant, hairspray, or the toilet.
  • Automation Link Option:

    • This feature simplifies the process of automatically disabling your other automations by providing an automation linking mechanism.
  • Bypass Functionality Option:

    • This allows you to bypass the automation, offering manual control and additional customization capabilities.
  • Safety Measures:

    • Set a maximum runtime safeguard for the fan to prevent continuous operation.
    • Benefit from built-in safeguards to ensure smooth operation and reliability, even if Home Assistant restarts.
  • Blueprint Add-On Integration:

    • Sensor Light: Control your lights in the bathroom. Click Here to learn more.
    • Toilet Exhaust Fan: Integrate with a toilet in the bathroom. Click Here to learn more.

:rocket: CHANGELOG

  • Version: 2.5 - 25 June-24 - Added manual trigger, update deprecated code in light and fixed some bugs.
  • Version: 2.4 - 12 June-24 - Added collapsible sections, Updated descriptions and some code clean up.
  • Version: 2.3 - 28 Jan-24 - Some housekeeping, increased max humidity slider range and bug fix in option 2 by-pass auto OFF.
  • Version: 2.2 - 6 October-23 - Added “input boolean” domain to “Input - Fan Speed - Switch Off (Optional)”
  • Version: 2.1 - 5 October-23 - Added a manual fan switch option.
  • Version: 2.0 - 2 October-23 - Added an automation link option. Major upgrade of HA restart. Fixed bugs in by-pass.
  • Version: 1.9 - 18 Sep-23 - Multiple fan speeds control. Light separate time delay. Update deprecated code. Fixed two bugs.
  • Version: 1.8 - 20 Aug-23 - Fixed a bug stopping the automation.
  • Version: 1.7 - 18 Aug-23 - Fixed a bug in light transition.
Changelog of all releases click here
  • Version: 1.6 - 15 July-23 - By-pass upgrade, By-pass auto OFF, works with blueprint link & updated HA restart.
  • Version: 1.5 - 7 June-23 - Added a maximum humidity, winter mode settings & options for lights.
  • Version: 1.4 - 8 March-23 - Added “fan” domain.
  • Version: 1.3 - 6 Feb-23 - Added the ability to use scripts.
  • Version: 1.2 - 26 Jan-23 - Added “Fan Speed - Off Switch Option” and ability to select lights.
  • Version: 1.1 - 22 Jan-23 - Added safeguard if Home Assistant restarts
  • Version: 1.0 - 30 Dec-22 - Initial release

:shield: MY OTHER BLUEPRINTS

:bulb: Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time
:high_brightness: Smart Light - Entity - Sun Elevation - Ambient & Time Triggers
:infinity: Sensor Light Add On - Media & Movie Lights - House Alarm Lights - Smoke Alarm Lights & Exhaust Fans + More
:low_battery: Low Battery Notifications & Actions
:vibration_mode: Appliance Notifications & Actions - Washing Machine - Clothes Dryer - Dish Washer - ETC
:loudspeaker: Notifications & Announcements
:calendar: Calendar Notifications & Actions
:round_pushpin: State Notifications & Actions
:robot: Android Notification Channel Manager
:toilet: Toilet Exhaust Fan with time delay
:hourglass_flowing_sand: Entity - Run ON Timer
:stopwatch: Trigger - Run ON Timer
:magic_wand: Manual light control with auto OFF
:door: Closet, Pantry, and Cupboard Lighting
:timer_clock: Timer
:thermometer: Temperature Control Fan
:snowflake: Temperature Control Exhaust Fan - Inverted
:eight_spoked_asterisk: Toggle Switch - Turn ON & OFF Entities
:nazar_amulet: Press Button - Turn ON & OFF Entities
:on: Switch - Turn ON & OFF Entities

Like this blueprint? Consider hitting the :heart: button below :+1:

100 Likes

FAQ

Q: How do you set up a Derivative Sensor Helper?

A: Please follow these steps Click Here

Q: I have set up a “Derivative Sensor Helper” but how do i set up the automation settings?

A: Please follow these steps Click Here

Q: Can you provide more information on the Manual Trigger?

A: Find out more please Click Here

Q: How to use the same ‘Fan Switch’ also in ‘Manual Trigger’ or ‘Manual Fan Switch’?

A: Find out more please Click Here

Q: How do you update the blueprint and not delete / recreate existing automations?

A: Please select below. It all depends on what version of HA you have and how you installed it.

  • For HA version 2023.12.0 + Please follow these steps Click Here
  • If you are on an older version of HA then please follow these steps Click Here

Q: Can you show us your full set up?

A: Sure
 check this post out Click Here

Q: FAQ - How can I use a light domain for the “Fan Switch”

A: Please follow these steps Click Here

Q: How to use the “Humidity Derivative Sensor By-pass” without having a physical switch?

A: If you don’t have a physical switch you can create one in Home Assistant that will allow you to use the by-pass. If you would like to create a by-pass switch then follow the steps below.

How to create a By-pass switch

  • First go to Settings / Devices & Services / click on the “Helpers” tab / click “+ CREATE HELPER” and select “Toggle”.
  • In the name area, enter a name that best suits you. For this example we will put “Bathroom Humidity Sensor By-pass”. Then click save.
  • Go back into the automation and in the “Humidity Derivative Sensor By-pass” search for the name you created, in our case “Bathroom Humidity Sensor By-pass”. Then click save.

How to add by-pass switch to a dashboard

  • In a “Dashboard” click “Edit dashboard” then click “+ ADD CARD” click on “Button” or “Entities” and in the entity field again search for the name (entity) you created in our case “Bathroom Humidity Sensor By-pass”. Then click save.
  • Then click “DONE”.

You now have a “Humidity Derivative Sensor By-pass” switch to disable the trigger sensor of your Bathroom Humidity Exhaust Fan automation.

Q: How Do I Use The Automation Link?

A Please follow these steps Click Here

Q: Can we link the Bathroom Humidity Exhaust Fan blueprint with the Toilet Exhaust Fan blueprint as my bathroom has a toilet and a shower?

A Yes, please follow these steps Click Here.

Q: I have selected to only use scripts but the automation is not working correctly. What am I doing wrong?

A Please follow these steps Click Here

Q: I would like to set a different value but the slider is not letting me?

A Just simply type the number value you would like in the field and click save. A red line will appear under the number you have entered but once you click save, exit the automation and go back into it the red line will not be there.

Q: I can’t see the time window when creating a Humidity Derivative Sensor?

A Please reboot your HA, not a restart of HA but a reboot of HA. Sometimes you will need to reboot your system for the time window to reappear.

3 Likes

Derivative Sensor Helper - FAQ

To ensure this automation works properly, you need to set up a Derivative Sensor Helper in Home Assistant and install a humidity sensor in the bathroom. In my setup, I use an ENV III Temperature Humidity Air Pressure sensor located on the fan inlet. It’s crucial that your humidity sensor reports changes frequently. I have set my humidity sensor to update every 60 seconds, as this frequency is essential for the blueprint to function correctly.

Note that Home Assistant automatically purges humidity data after a default period of 10 days to prevent data buildup, so there’s no need to worry about excessive data accumulation.

When locating your humidity sensor, it’s advisable to position it as high as possible in the room or as close to the fan inlet as feasible. This ensures the automation can react quickly and effectively to changes in humidity, particularly during showering.

To add derivative sensor helper to HA, follow these steps.

Go to Settings / Devices & Services and click on the “Helpers” tab at the top. Click create helper and select “Derivative”

Fill out the name you would like your derivative sensor to be, select your humidity sensor in “input sensor” (this is my ENV III Temperature Humidity Air Pressure sensor) , precision = 2, time window can be 3 to start but you can change this later (see edit helper below) and in time unit, select “minutes”. Now click “SUBMIT”

Once you’ve created the Derivative Sensor Helper in Home Assistant, return to the blueprint configuration and select or enter that derivative sensor in the “Humidity Derivative Sensor” field. Then, fill out the rest of the settings according to your requirements. For further assistance on setting up the automation correctly, please click here.

Your exhaust fan should automatically come ON now when you have a shower and turn OFF when your finished. :wink:

If you would like to know how to set up the automation settings so if functions correctly Click Here

EDIT HELPER
If you need to edit the Helper. Go back to Settings / Devices & Services / click on the “Helpers” tab / click the helper you would like to edit, in this case “Bathroom Humidity Derivative”. Click on the cogged wheel.

Then select “Derivative Options”

You will then see your settings. Edit as required.

Enjoy

Blacky :grinning:

Back to FAQ: Click Here

4 Likes

Thanks! I have been looking for something like this for some time. None of the methods I have tried have been reliable enough to trust. I’ll see how it works tomorrow morning :slight_smile:

One nice addition would be to add a time out, so that the fan will be turned off after a period of time even if the humidity hasn’t dropped enough.

Already there :blush:

1 Like

@sota no problem at all.

Hope it what your looking for, let us know how you go.

1 Like

The automation did not trigger this morning. The humidity derivative went to a max of +3.8% and -4.5%, but I had set the rising and falling limits to + & -5%. I reduced them to 3.5% and I’ll try again tomorrow.
Two possible suggestions:

  1. I currently trigger the fan when the bathroom light is turned on and turn it off 30 minutes after the light is turned off. It would be nice to have the option to include an entity that would turn on the fan immediately instead of waiting for the humidity to rise.
  2. When trying to get this to work, I had problems with false triggers - usually in the middle of the night. Not good for the WAF as the bathroom is off our bedroom! I don’t know if you have experienced this, but it might be nice to have a lockout time range where the automation cannot trigger.

Thanks.

I would suggests you start at +1 & -1. The best way to find your settings is to add your fan, humidity sensor and your derivative sensor into a dashboard. You will then be able to monitor your site. When you have a shower have a look at what happened and look at the first real increase to see what % that is. Below is a example and this is just normal humidity changes through the day in a 2 hour window.

below is a actual shower. The idea is to have the lowest % possible that will not give you a false trigger. Sensor position should also be considered (close to the steam).

I have a different blueprint for this called 'toilet exhaust fan with time delay"

Is this with this blueprint? as I haven’t had any false triggers to date. I have had false triggers when I tried different blueprints turning ON at night.

Thanks for the tips, I have done that now. I just started with your blueprint yesterday, so I am trying to avoid false triggers while getting it to work :wink: Previously, I had used the Generic Hygrostat integration and it was very unreliable.
Here is the graph from today showing the peaks for the shower around 9:00am, but there are also peaks of +1% and -1.5% so I think I will start at 2% and take it from there.

Screenshot 2023-01-01 171549

Yep that’s the way to do it :+1:

Success! The fan turned on just over a minute after the shower started, and it triggered the off delay about two minutes after it stopped.
Thanks!

1 Like

All good :smiley: :+1:

The Settings - FAQ

First you must set up a “Humidity Derivative Sensor”. On how to do this Click Here

Humidity Derivative Sensor

This is the sensor that will be used as the trigger.

Fan Switch

This is the fan you would like to turn ON. You can also include an input boolean. Input booleans are used to link my toilet exhaust fan blueprint with this blueprint.

Input - Fan Speed - Low Speed Switch

If you have a fan with different speeds, you will have the option to stage your fan before turning it OFF. This is where you would enter your low-speed entity. It will be used in your selection for summer and winter modes

Input - Fan Speed - Switch Off

If you have a fan with different speeds, this allows you to enter your OFF entity. It will be used in your selection for summer and winter modes.

Input - Bathroom Humidity Sensor (Optional)

Select your bathroom humidity sensor. This sensor, located in your bathroom, will be used as the reference if you choose ‘The Maximum Humidity Option’ in your selection for summer and winter modes.

Rising Humidity & Falling Humidity Settings

Once you have your ‘Humidity Derivative Sensor’ set up in Home Assistant (HA), the best way to find your settings is to add your exhaust fan, humidity sensor, and humidity derivative sensor to a dashboard. To do this:

  1. Go to a dashboard.
  2. In the top right corner, click the three dots and select ‘Edit dashboard.’
  3. Click ‘+ ADD CARD.’
  4. Select ‘History Graph.’
  5. In the entity field, add your exhaust fan, humidity sensor, and humidity derivative sensor entities.
  6. Set the time range to show ‘2’ hours (you can change this any time).
  7. Click ‘Save’ and ‘DONE.’

You will now see something like this.

The above image shows humidity changes throughout the day in a 2-hour window. You can see the ‘Humidity Derivative Sensor’ values fluctuating around +0.75 and -0.48. Your values might be higher, as it all depends on your specific site and the location of your sensor.

The image below illustrates the effects of taking showers, with data from two separate instances. In the first shower, the humidity level increases to around +10.0 and then decreases to approximately -7.0 after finishing. Similarly, in the second shower, the humidity rises to about +14.0 and then drops to around -7.5 afterward. If you hover your mouse over your graph in Home Assistant (HA), a pop-up window will display more accurate figures.

Now that we can observe what’s happening, we can adjust our settings accordingly. Looking at the Rising Humidity Derivative %:

  1. The first shower’s initial increase is just below +5.0, and the ending is just above -5.0.
  2. The second shower’s initial increase is around +7.0, and the ending is just above -5.0.

Note: These readings are with a working exhaust fan, so you may need to initially set it to +1.0 & -1.0 and then adjust and readjust your settings to achieve the desired results.

My sensor is positioned at the highest point right next to the fan inlet, resulting in high readings. Your readings might be lower, but the fundamental principle remains the same.

After monitoring my site for some time, I’ve observed that during summer mode, my readings never exceed +2.3 & -1.5, while in winter mode, they never exceed +1.0 & -0.8. With the sensor positioned high next to the fan, showering results in similar patterns to the graph above. It’s advisable to keep your settings as low as possible for faster reaction times, but we also want to avoid false triggers, especially at night.

In my setup, I’ve set the “Rising Humidity %” in summer (hot climate) to +3.2 and the “Falling Humidity %” to -3.1. In winter (cold climate), I’ve adjusted the “Rising Humidity %” to +1.8 and the “Falling Humidity %” to -1.2

Your settings will vary depending on factors such as your site, location, and climate. However, having the ability to monitor your settings will help you determine the optimal configuration for your specific situation.

If you experience false triggers turning ON the fan, consider adjusting your ‘Rising Humidity %’ or ‘Maximum Humidity’ settings if you’re using that option, as these are the triggers for activating the fan. You can analyze your trace lines to determine whether it was the ‘Rising Humidity %’ or the ‘Maximum Humidity’ that caused the activation, helping you pinpoint which setting to adjust.

Conversely, the ‘Falling Humidity %’ or the ‘Maximum Run Time Setting’ triggers the automation to initiate the ‘Time Delay.’ Monitor the system’s behavior and adjust the settings as necessary.

Time Delay

The ‘Time Delay’ setting is crucial, but its optimal duration can vary depending on factors such as the type of fan you have and the location of your humidity sensor. It’s essential to monitor this setting to ensure the fan adequately reduces humidity before turning off. As shown in the above image, the humidity tends to return to around the starting value after a shower, which can be particularly challenging during colder winter months. In such cases, additional measures like providing heat, opening a window, removing wet towels, or drying them may be necessary to reduce humidity levels effectively.

Start with a time delay of around 10 minutes and adjust as necessary based on your observations. For my setup, I have my ‘Time Delay’ set to 4.5 minutes in summer (hot climate) and 15 minutes in winter (cold climate).

Safe Guard - Maximum Run Time Setting

The Maximum Run Time Setting serves as a safeguard, ensuring the fan doesn’t run excessively, even during the longest showers. It shouldn’t be necessary if your settings are correct. I’ve set mine to 17 minutes for summer (hot climate) and 20 minutes for winter (cold climate).

Use The Maximum Humidity Option (Optional)

Sometimes, after a shower, the humidity can take longer to return to its normal level. This delay may result in a lower rising % when another shower is taken before the humidity has fully normalized, thus failing to trigger the automation. Enabling this option allows the fan to be activated when the humidity rises above the set value.

I’ve found this option particularly effective during busy periods with back-to-back showers. Remember, my sensor is directly on the fan inlet above the shower. For summer (hot climate), I’ve set mine to 85%, and for winter (cold climate), I’ve set mine to 87%.

NOTE: To enable this option, you must input your ‘Bathroom Humidity Sensor’ in ‘Input - Bathroom Humidity Sensor’. Your bathroom humidity sensor is the actual humidity sensor located in your bathroom.

Use The Winter Mode Option (Optional)

This option allows you to add another set of settings specifically for the winter months (colder months). The settings are the same as above, but you’ll need to select the months you want to apply the winter mode settings to. I’ve enabled this option for my setup.

Humidity Derivative Sensor By-pass

This will enable you to bypass the humidity derivative sensor and operate your fan as usual. Please note that the entity cannot be included in the ‘Fan Switch’, ‘Fan Speed - Low Speed Switch’, or ‘Fan Speed - Off Switch Option’ selections. Please see our FAQ on how to set this up without having a physical switch.

Use The Fan Speed Options

This applies if you have a fan with multiple speeds. You can choose the options you’d like to use.

Fan Speed - Low Speed Time Delay

This is an additional time delay to run the fan on low speed before turning it off. To use this feature, you must select the option to use the low-speed fan in ‘The Fan Speed Options,’ and you must enter your low fan speed in the 'Input - Fan Speed - Low Speed Switch.

Manual Fan Switch Option

This feature enables you to add a switch for manual control of the fan, allowing you to turn it on and off manually while still allowing the automation to take control when needed. This is particularly useful for removing any unwanted fumes from deodorant, hairspray, or the toilet. The auto-off time delay in option 2 ensures that you never forget to turn the fan off.

The switch can be:

  • Switch
  • Binary sensor
  • Input boolean

:warning: Please Note: The switch cannot be the actual fan switch and must be independent. Using the actual fan switch will prevent the automation from functioning properly.

Lights Options

This feature is useful for controlling different lights when taking a shower, especially if you have LED lights installed in a shower niche.

The Automation Link

This feature enables you to link your other automations, automatically disabling them when this automation is activated. It’s particularly useful if you’re using another blueprint to control the lights, switches, or scenes in your bathroom and want to deactivate it when this automation is on. This ensures that the bathroom lights remain on when you’re in the shower and the motion sensor is unable to detect motion.

For more information on the Automation Link Option Click Here

Safe Guard - HA Restart

If Home Assistant restarts for any reason, the automation will evaluate the conditions and try to preform the correct action.

Enjoy

Blacky :smiley:

Back to FAQ: Click Here

1 Like

Hello I’m trying to use your blueprint, so far seems the most well thought that I have found for humidity control. I plan to use it in a technical room where I have some electronic equipment (router, switches, etc) but which is also prone to increased level of humidity. I have purchased an Aqara temperature humidity sensor and an Aqara smart plug, I also already have a dehumidifier. So basically what I am trying o do is whenever humidity is rising above a certain procent the dehumidifier to start automatically, it’s on auto and plugged into the Aqara plug. I have created the derivative humidity sensor with the helper and also make the Aqara plug look like a fan switch but in the blueprint settings it says at the fan section that no matching device is found, I have attached the part of the blueprint with the troubling settings.

@ionutm80 Firstly welcome to the community :smiley:

This issue is a bug in the latest release of HA. If you go back to your backup then it will be resolved until HA fixes it but you will loose what you have done from your update to now.

Another way if you are keen then you can try this.

Find out your “entity ID” you would like to use. Go to, Settings / Devices & Services, click on top tab “Entities”. Find it there.

Open the blueprint, click on 3 dots top right, and “edit in YAML”. You should see something like this.

alias: Bathroom Humidity Exhaust Fan
description: ""
use_blueprint:
  path: Blackshome/bathroom-humidity-exhaust-fan.yaml

For “Fan Switch *” enter “input” and change your entity_id to your sensor.

alias: Bathroom Humidity Exhaust Fan
description: ""
use_blueprint:
  path: Blackshome/bathroom-humidity-exhaust-fan.yaml
  input:
    fan_switch:
      entity_id:
        - switch.your_sensor_here

This is how my one looks like once everything is filled in.

alias: Bathroom Humidity Exhaust Fan
description: ""
use_blueprint:
  path: Blackshome/bathroom-humidity-exhaust-fan.yaml
  input:
    trigger: sensor.bathroom_humidity_derivative
    fan_switch:
      entity_id: switch.bathroom_exhaust_fan
    falling_humidity: -2
    rising_humidity: 2
    time_out: 25
    include_bypass: bypass_disabled
    time_delay: 3

Now click 3 dots top right and select “Edit in visual editor”

Hopefully you see your fan now :crossed_fingers:

Fill out the rest.

Not sure if it will work because I don’t know what HA did but be assured the blueprint works.

1 Like

Hi again, it worked, I could add my fan switch, now I have to fine tune the automation based on your guidance above. Thanks a lot for this blueprint and for the help provided!

Love it. If you have any other questions just ask. Your use case is interesting.

1 Like

Hi again,

I have set the derivative sensor with a time window of 3 minutes as per your FAQ above. Initially I have set the autommation based on your blueprint to -0.5 & 0.5 so it did not triggered when the first event that I was looking for happened: my wife put some clothes to dry in the technical room to take advantage of the heat inside at exactly 9.31 PM, I have attached 2 graphs with the evolution of the 2 sensors.



What would be the best settings for me to trigger specifically when these type of events occur? The derrivative jumps immediately at 9.31 PM but then drops also abruptly at 9.53 PM while the humidity remains high and above the 25% threshold that I would like to see constant within the technical room. Please help me, I’m a bit lost.
Thanks in advance and kind regards.

Hi, I have attached below the evolution up to this morning of the 2 senzors, derivative and actual humidity, as can be seen the derivative is decreasing very abruptly because it has a 3 minute moving average while the actual humidity is decreasing over a longer time period.The small period in which the dehumidifier worked is because I trigerred it manually to see whether the switch is working.

By the way the graphs are before updating this morning to 2023.1.2, after that the derivative senzors do not show anymore like line graphs but instead like history bar.

@ionutm80 I will PM you.