🚿 Bathroom Humidity Exhaust Fan

if you mean, you want the fan to come on when it reaches 70% humidity regardless of derivative, then yes set as below

set your humidity sensor

set Use The Maximum Humidity Option (Optional) to Enable and then set the Maximum Humidity to 70%

the slider will not go below 95%, so just click in the text field and enter 70

then save.

2 Likes

Thank you very much. I thought that the red stripe indicates an error.)))))

New update 2.1

New Features :new:

  • Manual Fan Switch Option - This allows you to add a switch to turn the fan ON and OFF manually and still allows the automation to be triggered, taking control of your fan :partying_face:. This is useful in removing any unwanted fumes from deodorant, hairspray, toilet etc. The auto off time delay in option 2 makes sure you never forget to turn the fan OFF.

    The switch can be:

    • Switch
    • Binary sensor
    • Input boolean

:warning: Please Note: The switch can not be the actual fan switch and must be independent. If you use the actual fan switch then the automation will not work.

What can this now do?

  1. If you have a toilet in the bathroom you can now have a physical manual switch on the wall, or a sensor that can turn the fan on for a set time period. If you then have a shower the automation will take control of your fan.
  2. Getting ready for the day and you spray deodorant or hairspray and would like to remove the fumes?.. you can now turn the fan ON and OFF or use the auto OFF option and it will run for X amount of time.
  3. Getting in the shower and you would just like to start the fan manually from the start and not wait for the trigger to then have the automation take control, this is now possible.
  4. Turn the fan ON and OFF in HA or with a local switch + opt to use a time delay option, this is now possible.
  5. Cancel the automation with a local fan switch or in HA dashboard, turn the switch ON and OFF. It may restart depending on site conditions.

It can do more but I think you get the idea.

If you like this blueprint? Consider hitting the :heart: button in the top post :+1:

If you like my blueprints, and would like to show your support or just say thank you? Click Here :smiling_face_with_three_hearts:

Enjoy

Blacky :grinning:

1 Like

Hi Blacky,
I have a % controlled fan. I would like to go to 100% when showering and then go to 20% when finished.

I have set up two helpers

afzuig100: fan goes to 100%
afzuig20: fan goes to 20%

when I switch afzuig100 on afzuig20 goes to off en vice versa.
how can ik make my setup work with your wonderful blueprint?

what should i put as entities below?

Fan Switch: afzuig100%
input - Fan Speed - Low Speed Switch (Optional):
Input - Fan Speed - Switch Off (Optional):
Use The Fan Speed Options (Optional):

@fransiefrans I have something similar. Created scripts for High, Medium and Low, like this:

alias: Ventilatie High
sequence:
  - service: fan.turn_on
    data:
      percentage: 100
    target:
      entity_id: fan.mechanical_ventilation
mode: single
icon: mdi:fan-speed-3

The Blacky script is calling this:

    fan_switch:
      entity_id:
        - script.ventilatie_high
        - input_boolean.bathroom_fan_high_speed_toggle_helper
    fan_speed_low:
      - script.ventilatie_medium
      - input_boolean.bathroom_fan_low_speed_toggle_helper
    fan_speed_off:
      - script.ventilatie_low

New update 2.2

New Features :new:

  • Input - Fan Speed - Switch Off (Optional) - This now allows you to add a input boolean.

If you like this blueprint? Consider hitting the :heart: button in the top post :+1:

If you like my blueprints, and would like to show your support or just say thank you? Click Here :smiling_face_with_three_hearts:

Enjoy

Blacky :grinning:

1 Like

@fransiefrans

Hi

First please update to version 2.2. I have now added the ability to add your helper into “Input - Fan Speed - Switch Off (Optional)”.

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

A Please follow these steps Click Here

Once updated then you would do this.

Then for normal (summer) this.

If using winter mode, then this.

.

If this doesn’t work for you, you can create scripts for 100% and 20% like @balk77 suggested above and enter them into the same areas. If you do use scripts then you will need to enter in a toggle helper (that controls nothing, just a dummy toggle) into “Fan Switch” only. You do not need to add a toggle helper into “Input - Fan Speed - Switch Off (Optional)”

Hope this helps, and let us know how you go.

Blacky :smiley:

PS: If you would like to share how you created helpers to control your fan % then I am sure it would help the community.

1 Like

I have scripts running to control fan speed and valves all together.
For the fan speed on, the automation triggers a script which essentially does 3 things:

  • Opens the valve for the appropriate room (set valve percentage to 100%)
  • Increases the speed of the central motor to 80%

The third one was a bit more complex where I had to think a bit more :rofl: I have 3 valves for 3 rooms which are permantly open for 20% (functioning as air circulation).

When the automation is triggered I want to close the valves in the other 2 rooms, as I don’t want all heat to be sucked out of that room (because there is only 1 central motor which ups to 80% capacity).

Therefore the 3rd thing the script does is check if there are any other automations currently running in the other 2 rooms, then it shouldn’t close their valves. If not, it can safely close them.

The fan script off is doing the same:

  • It sets the valve of the relevant room back to 20% open
  • If no other automation is running for the other 2 rooms it sets the motor back to 20% capacity and sets the valves of the other 2 rooms back from 0% to 20%

It stil has a few improvements I could make such as: if the script off runs in the above described way and there is an automation running in another room, it should not put the valve to 20%, but rather fully close it.
But that’s probably something for later :grinning_face_with_smiling_eyes:

@BeeGee

Nice work!! Glad it is all working for you
 thanks for sharing your set up :+1: :wink:

1 Like

@R0yk3

Just posting my set up now as promised. I will update this in the next few weeks as I am waiting for some items so I only need to use one ESP32.

thank you for the script. I’m trying the 2.2 version. if this does not work, I’ll try the script.

thanks, I’ll let you know

@Blacky hey. I have updated to 2.2 and am just going through testing/configuring. I dont know if I am an edge case, if so please feel free to ignore me, however, regarding the ‘Manual Fan Switch’ section, for me this is turning on the fan speed high (I have a Shelly 2.5 to control high speed and low speed of the bathroom fan (one device but stepped speeds), the Shelly also therefore shows me when the light switch is turned on). I have configured ‘Fan Switch’ to be the high speed fan and ‘Input - Fan Speed - Low Speed Switch (Optional)’ to be the low speed fan HA entities. The problem is, with having ‘Manual Fan Switch’ enabled, when I turn on the bathroom light switch the high speed fan is being turned on but because the low speed fan is not also turned on the fan doesnt come on at all. For full clarity, I did also enable the ‘Use The Fan Speed Options (Optional)’ and set that to the first option (‘switch to low speed then turn off’).
I tried reversing the selected entities in the ‘Fan Switch’ and ‘Input - Fan Speed - Low Speed Switch(Optional)’ fields and the low speed fan then came on when enabling ‘Manual Control’. I think maybe the logic needs reversing when a low fan speed option has been selected higher up?

FAQ - Can you show us your full set up?

Below is one of my bathrooms. I will show all my controllers (ESP32), sensors, setting along with the settings for my sensor light as it all works together. I will try an document as much as possible for you. If you need more information just let us know. It is a big read so maybe make yourself a coffee first.

NOTE: I am waiting on some parts as they have just been released and I am updating my systems. When I receive them I will update this post, so if your interested then maybe check back in in a few weeks.

:gear: The Controller And Sensors

All the items are from m5stack. I have spare controllers and sensors if they need to be replaced ASAP.

ATOM Lite ESP32 IoT Development Kit

1

ENV III Unit with Temperature Humidity Air Pressure Sensor

4

Dlight Unit - Ambient Light Sensor

2

PIR Motion Sensor

3

ATOMIC PortABC Extension Base

5

I2C Hub 1 to 6 Expansion Unit

6

:camera: The Bathroom

Below is one of my bathrooms. Note, the linear slot diffuser directly above the shower head, this is critical for the automation to work correctly. It is connected to my exhaust fan and sucks air over the sensor when the fan is ON. Inside this linear slot diffuser is my humidity sensor.

Below shows the LED lighting. They are separated into segments
 the mirror, under the vanity and in the niche

Inside the linear slot diffuser the cable passes through into the cushion head. This cable is in the ceiling space where the ESP32 is plugged into mains power.

I have cut out one of the slots so the sensor finishes flush with the face of the linear slot diffuser. I also painted the cover of the sensor black to hide it and drilled some small holes in the other side of the sensor cover to allow for good airflow trough it.

Below is the sensor fitted to the linear slot diffuser.

Under the vanity is my LUX and motion sensor.

:memo: The code used in the ESP32 (atom light) and esphome

This is for the humidity sensor, temp sensor, LUX sensor, motion sensor, door sensor and the “Manual Fan Switch”.

## "#" = Item - "##" = Note - "###" = DEACTIVATED option

esphome:
  name: bed2-ens
  friendly_name: Bed 2 Ensuite

esp32:
  board: m5stack-atom
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: !secret encryption_key

# Over The Air Password (Stops somone on your network accessing files)
ota:
  password: !secret esphome_secret

# Wifi Information
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

## Optional manual - Static IP
###  manual_ip:
###    static_ip: ?.?.?.?
###    gateway: ?.?.?.?
###    subnet: 255.255.255.0

# Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "bed2-ens"
    password: !secret fallback_ap_password

# Captive Portal
## After 1 minute of unsuccessful WiFi connection attempts, 
## the Atom Lite will start a WiFi hotspot (with the credentials from your fallback).
## Use your AP (Access Point WiFi) SSID & Password to connect then go to http://192.168.4.1/ in your browser.
captive_portal:

# This is for sensors plugged into I2C Hub 1 to 6 Expansion Unit - It can be tricky

i2c:
  sda: 25
  scl: 21
  scan: true

sensor:
  - platform: bh1750
    name: "LUX Sensor"
    address: 0x23
    update_interval: 10s

  - platform: sht3xd ## sht3xd is for a ENV III - sht4x is for a ENV IV
    temperature:
      name: "Bathroom Temperature"
      id: bathroom_temperature
    humidity:
      name: "Bathroom Humidity"
      id: bathroom_humidity
    address: 0x44
    update_interval: 60s

  - platform: qmp6988 ## qmp6988 is for a ENV III - bmp280 is for a ENV IV
    pressure:
      name: "Bathroom Pressure"
    address: 0x70 ## 0x70 is for a ENV III - 0x76 is for a ENV IV
    update_interval: 60s
    iir_filter: 2x

# This is for the physical switch on the wall and to allow for control in a HA dashboard
switch:
  - platform: gpio
    pin: GPIO23
    id: bathroom_manual_control 
    name: "Bathroom Fan - Manual Control" # Link to the binary sensor below
    icon: "mdi:fan-clock"

# The physical switch on the wall
binary_sensor:
  - platform: gpio
    pin: 
      number: GPIO33 ## Wire from this pin to the push button on the wall and back to ground on esp32
      inverted: true
      mode:
        input: true
        pullup: true
    name: "Bathroom Fan - Bypass Wall Button"
    icon: "mdi:gesture-tap-button"
    on_press: ## on_press is for a push button switch. on_state is for a toggle switch. Choose on_state or on_press for the type of wall switch you have, you can only use one or the other.
      then:
        - switch.toggle: 
            id: bathroom_manual_control # Link back to the switch above
    filters:
      - delayed_on: 10ms

# For a motion sensor in bathroom
  - platform: gpio
    pin: GPIO19
    name: "Motion Sensor"
    device_class: motion

## You can add another "gpio" on pin 32. This can be used for a door contact sensor. 
## I am not using a door contact sensor it is just there to show you how to use it if you require one. 
## For me I am using this pin for another motion sensor located in the WIR to turn on lights.
  - platform: gpio
    pin: GPIO32
    name: "Bathroom Door"
    device_class: door

:shower: The Bathroom Humidity Exhaust Fan Blueprint Settings

Below are the main sensor settings for the automation. I dont have a fan with different speeds so nothing is entered into the 2 “Input - Fan Speed” selections. If you have a fan with different speeds then you would enter them in here. I do use the “Maximum Humidity” in the settings so I have entered in my humidity sensor into “Input - Bathroom Humidity Sensor”.

Below are the main settings. I refer these setting as “Summer Mode” but the are not labelled like that as it is just easer to read this way.

Below is to enable winter mode. I use it but you don’t have to use it as it is an option.

Below are the winter settings.

Below are the light settings. I dont use them as I use my :bulb: Sensor Light blueprint to control the lights with the “Automation Link Option”.

Below is the manual fan switch settings. This is the switch I created in the ESP32 code and wired to a physical switch on the wall.

Below is the “Automation Link” settings. This will be referred to later when showing my sensor light set up. I have set this to 2 minutes. This allow us to dry ourselves before the motion sensor is able to detect motion again once we move to the other side of the glass shower screen. I have created a toggle helper for this.

I have entered in a by-pass but realy don’t use it now we have developed the manual fan switch.

:bulb: The Sensor Light Blueprint Settings

Click here for my :bulb: Sensor Light blueprint.

Below is the main settings. Trigger is the motion sensor under the vanity and in the ESP32. You can see my 3 LED lights entered in. The main light is controlled manually as we use the LED light most of the time and only turn ON the main lights when needed.

The light settings

The by-pass settings. This is where the automation link in the bathroom humidity exhaust fan blueprint controls and takes over this automation disabling it. I have selected to turn the lights ON as this allows it to work without ever knowing anything is happening. Note the by-pass time delay of 1 minute. This allows for when the by-pass is turned OFF for us to trigger this automation again before turning OFF the lights.

Sun options, don’t use them in this automation.

This is the LUX sensor under the vanity and in the ESP32. Selected “YES” as this sensor is affected by the lights.

Time options, don’t use them in this automation.

Device tracker, don’t use them in this automation.

Night Light main input settings.

Night lights, light settings for lower softer lights at night.

Night light conditions. 2 iPhones used to enable the night lights when they are in do not disturb.

And that is it :partying_face:. If you got this far you have done well :rofl:

Hope this helps you set up your automations

Enjoy

Blacky :smiley:

Back to FAQ: Click Here

3 Likes

@Townsmcp

The manual switch can not control the fan directly. You can’t use the switch connected to the fan. It has to be stand alone and it will only turn the fan ON and OFF. Low speed will not run.

If you would like to test it you can create a toggle helper and use that toggle as your manual switch.

If you are happy with it, you will probably have to add another Shelly in
 like a Shelly plus 1 and wire another switch (or connect it to the existng fan switch and disconnect the other Shelly 2.5 to the switch) to it and connect it to nothing. Then use that switch to turn ON manual control.

Hope this helps.

Blacky :smiley:

1 Like

@Blacky thanks for the info.

I love your bathroom! Looks like you live in a hotel!

Question regarding ‘Automation Link - By-pass Control’ - can an automation be used as one of the entities? Automations can be turned on and off like an input_boolean. I use the Toilet Exhaust Fan blueprint and wondered if adding the blueprint automation into this field will simply turn the automation off and on as needed?

@Townsmcp

Yes but you will need to edit the code. The reason I say this is if your using my :toilet: Toilet Exhaust Fan with time delay there is no by-pass yet
 yes it is on the road map and I will make it work with this blueprint :infinity:. Rather than edit the code I would suggest you create a template sensor that will do this for you, that way you never have to edit the blueprint code. It make it easer when updating. If you are not sure how to do this just reach out and I will provide the code for you.

FYI: When we enable and disable an automation it preforms not action, so it is basic function and not my recommendation. When we use the by-pass in my blueprints you have options, on what to do when you turn them ON (smart function). When we turn the by-pass OFF the blueprint analyse the automation and all your settings and tries to preform the correct action (smart function). So this is not realy good automation to enable or disable automations, just basic function. So if there is a by-pass I would recommend to use it rather than enabling and disabling an automation.

Blacky :smiley:

1 Like

ended up using the script! this works, thanks

1 Like

@fransiefrans

Thanks for letting us know
 glad you are up and running :partying_face:

Enjoy

Blacky

1 Like

@Townsmcp

This :toilet: Toilet Exhaust Fan with time delay blueprint has now been updated so it will work with this blueprint now. Just need to create a toggle helper and enter it into both blueprints. More information can be found in its thread Click Here.

Blacky :smiley:

1 Like