Hello. Tell me please. Is it possible to set the threshold for turning on the fan to 70%?
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.
Thank you very much. I thought that the red stripe indicates an error.)))))
New Features
-
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 . 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
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?
- 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.
- 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.
- 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.
- Turn the fan ON and OFF in HA or with a local switch + opt to use a time delay option, this is now possible.
- 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 button in the top post
If you like my blueprints, and would like to show your support or just say thank you? Click Here
Enjoy
Blacky
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 Features
- Input - Fan Speed - Switch Off (Optional) - This now allows you to add a input boolean.
If you like this blueprint? Consider hitting the button in the top post
If you like my blueprints, and would like to show your support or just say thank you? Click Here
Enjoy
Blacky
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
PS: If you would like to share how you created helpers to control your fan % then I am sure it would help the community.
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 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
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.
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
ENV III Unit with Temperature Humidity Air Pressure Sensor
Dlight Unit - Ambient Light Sensor
PIR Motion Sensor
ATOMIC PortABC Extension Base
I2C Hub 1 to 6 Expansion Unit
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.
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
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 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.
The Sensor Light Blueprint Settings
Click here for my 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 . If you got this far you have done well
Hope this helps you set up your automations
Enjoy
Blacky
Back to FAQ: Click Here
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
@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?
Yes but you will need to edit the code. The reason I say this is if your using my 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 . 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
ended up using the script! this works, thanks