🚿 Bathroom Humidity Exhaust Fan

@sweetpotatobeef

O okay, that is strange. Obviously you can’t adjust the 15min or just disable this feature in your fan.

Sorry the automation will not do what your asking.

Blacky :smiley:

Perfect. Thanks a lot! Warning’s gone

@jonathanarcher

Nice, your welcome.

Blacky :smiley:

Hi, @Blacky
thanks for your quick response. We had a discussion here on the forum in June 2024, and you helped me then with setting up a manual switch as a bypass for your automation (your post number 494 in forum here) - I used your code suggestion directly in configuration.yaml. I note, however, that this bit of code in configuration.yaml does not affect the fan behavior after HA restart. Thanks for your concern and help, it was invaluable for me especially at the beginning when I was a complete beginner - now I have a bit more insight (although I probably won’t learn much programming at my age…:frowning: )

My automatisation:

alias: VentilĂĄtor koupelna
description: ""
use_blueprint:
  path: Blackshome/bathroom-humidity-exhaust-fan.yaml
  input:
    trigger: sensor.derivacni_senzor_koupelna_2
    fan_switch:
      area_id: koupelna
      entity_id: light.tz3000_zojh9vz7_ts0001_svetlo
    time_out: 20
    include_manual_fan_switch: enable_manual_fan_switch_auto_off
    manual_fan_switch:
      - binary_sensor.manualni_zapnuti_ventilatoru
    rising_humidity: 0.7
    include_max_humidity: maximum_humidity_enabled
    max_humidity: 80
    bypass_auto_off_delay: 20
    winter_include_fan_speed: fan_speed_disabled
    manual_fan_switch_time_delay: 10
    include_manual_trigger: enable_manual_trigger_time_delay
    time_delay: 5

Your modified bypass of the manual switch from my configuration.yaml:

template:
  - trigger:
      - platform: state
        entity_id: light.tz3000_zojh9vz7_ts0001_svetlo
        to: "on"
        id: "t1"
      - platform: state
        entity_id: light.tz3000_zojh9vz7_ts0001_svetlo
        to: "off"

    binary_sensor:
      - name: "ManuĂĄlnĂ­ zapnutĂ­ ventilĂĄtoru"
        icon: mdi:fan
        state: >
          {% if trigger.id == 't1' and trigger.to_state.context.parent_id is none %}
            on
          {% else %}
            off
          {% endif %}

@vaclavIII

Thanks for your YAML. I have noticed 3 things… let’s clean this up first.

  1. You can’t use an area. Not sure why this is there. You will have to remove this or expand the area down to entities by clicking on the <> icon next to the X down to entities. From this list, select only the fan entity but it looks like it is already there so you could just remove this area selection.

  2. You have option 2 enabled but your not using this option as there is no manual trigger selected. Please disable this option.

  3. You have enabled max humidity but you haven’t added your humidity sensor into the trigger. Please add your humidity sensor into Bathroom Humidity Sensor

I see, yes the binary sensor will not survive a restart so when HA restarts the automation thinks it is OFF so the fan sits and waits for the Safeguard - Maximum Run Time before it turns OFF. It will turn OFF but in your case 20 min.

However when testing found a bug in the bypass if you where using a actual switch. I have fixed this and will release an update.

I do have another way of doing this that will survive a restart. I have another blueprint that works the same but toggles a toggle helper. I haven’t released it yet as it is not perfect but if your keen I can provide the link so you can test it out.

Blacky :smiley:

New update 2.6

Maintenance :toolbox:

  • From time to time, Home Assistant updates their YAML standards and coding practices. To align with their roadmap, we’ve updated the code accordingly. We will continue to apply these updates across all our blueprints as they are revised.

Bugs Fixed :bug:

  • HA restart: Manual Fan Switch and the fan switch is ON.

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:

Hey, @Blacky,

I corrected what I could according to your check of my update - it was obviously based on my misunderstanding of some of the functions of your blueprint. Yes, you are right that the maximum fan run time after HA restart is 20 minutes - which I experimentally verified when I once forgot to manually turn off the fan after HA restart :joy:-).
I’ll wait for your update, I don’t feel erudite enough to play with beta versions. However, despite everything, your blueprint works satisfactorily - it’s clearly robust, and has survived my unprofessional settings… Thanks for your help!

@vaclavIII

Thanks for the update, glad to help you. At least you know what will happen when you restart HA now and you lead me to fix another bug in the blueprint, thank you. I have already release the update so if you press the blue import button at the top it will update the blueprint but it will still work the same when you restart HA.

Enjoy

Blacky :smiley:

Hi,

Thanks for your amazing template!
Wanted to ask if you are planning on adding a timer lock that disables the fan during certain hours?

It does detect humidity accurately but during certain times I want to be as quiet as possible and having to log in, disable the automation and so on its just a chore.

@Cas7or

I wasn’t planning to have an easy selection to disable the fan because I never get a false positive and for any reason we take a shower at anytime I would like the fan ON.

That said, I recommend using the bypass option 2. Create a schedule helper for the times you don’t want the automation to run, and then add that schedule helper to the Bypass Switch. This way, you’ll achieve the exact behavior you’re looking for.

Blacky :smiley:

1 Like

Do you know why i get this error:

Blockquote
Message malformed: expected a dictionary for dictionary value @ data[‘actions’][0][‘choose’][0][‘sequence’][0][‘choose’][0][‘sequence’][2][‘parallel’][0][0][‘sequence’][0][‘target’]

Blockquote
i’m on HA 2024.10.3

i get this when in auto triggers area i select derivate senzor and i wanna save it, i didn’t change any other option in blueprint.

@MAdbUSU

Could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on “</>” and paste code in there.

Blacky :smiley:

1 Like
description: ""
alias: Bathroom Humidity Exhaust Fan
use_blueprint:
  path: Blackshome/bathroom-humidity-exhaust-fan.yaml
  input: {}

@MAdbUSU

You need to set up all the inputs and create a Derivative Sensor Helper

Step 1 = Click here
Step 2 = Click here

Blacky :smiley:

it’s strange because i try to fill all the settings in blueprints when i click save, i didn’t get error, but when i come back to see if the setting are save, they are not save.

ok i will try to take the steps you advice.

@MAdbUSU

After saving a blueprint automation, you’ll find it listed under the Automation’s tab, not the Blueprints tab. A blueprint acts as a reusable template, allowing you to create multiple automations from it. For example, you could use the same blueprint to set up automations for three different bathrooms.

Once saved, each automation will appear under the Automation’s tab, where you can view and adjust its specific settings.

It might feel a bit confusing at first, but I hope this explanation clarifies things!

Blacky :smiley:

Oh, now it’s more clear, found it in automation TAB, i will post YAML file

alias: Bathroom Humidity Exhaust Fan
description: ""
use_blueprint:
  path: Blackshome/bathroom-humidity-exhaust-fan.yaml
  input:
    trigger: sensor.senzor_de_umiditate_derivative
    bathroom_humidity_sensor: sensor.sonoff_temp_bucatarie_humidity
    manual_trigger:
      - switch.ventilator_baie_mare_switch_0
    manual_trigger_default_time_delay: 5
    manual_trigger_winter_time_delay: 5
    include_manual_trigger: enable_manual_trigger_time_delay
    fan_switch:
      area_id: baie_mare
      device_id: 436181267fd1aadc7eb96180cad80e5c
      entity_id: switch.ventilator_baie_mare_switch_0
    include_manual_fan_switch: enable_manual_fan_switch_auto_off
    manual_fan_switch:
      - switch.ventilator_baie_mare_switch_0
    manual_fan_switch_time_delay: 5

so for this fan i have a push button to control it, so i want to use this push button every time i think it’s necessary.

but with the current setting when i press the PB (shelly 1PM) the shelly start to flicker very fast on/off i don’t think it’s suppose to work like that.

i don’t know what option to use ?
if i disable both like in screenshoot fan works, but i need to set a working time like 5min when i press PB.


@MAdbUSU

I have adjusted your automation YAML.

  1. Fan Input: Only entities are supported; areas, devices, or labels cannot be included. I have adjusted this for you.
  2. In Manual Trigger and Manual Fan Switch it cannot be your actual Fan Switch entity; it must be a completely different entity. I have removed this and disabled these options. You will need to find a different switch other than the fan switch. You could add a toggle helper but it will not be a physical switch but this may be a good way to test it out. When selecting the entity if you scroll down to the bottom you will see Create new Toggle Helper, this will create one for you and then you add it into a dashboard.
alias: Bathroom Humidity Exhaust Fan
description: ""
use_blueprint:
  path: Blackshome/bathroom-humidity-exhaust-fan.yaml
  input:
    trigger: sensor.senzor_de_umiditate_derivative
    bathroom_humidity_sensor: sensor.sonoff_temp_bucatarie_humidity
    manual_trigger_default_time_delay: 5
    fan_switch:
      entity_id: switch.ventilator_baie_mare_switch_0

Blacky :smiley:

Hi Blacky,
Thank you for helping me.
I just want to point out , manual trigger work with phisical push button, i test it with delay time 5 min and works.

Now i think i need a little bit a fine tuning, i will explain why:
i take 2 showers with 5 min interval (i will post screenshoot)
the automation starts but only works for 5 min i will aspect to work till humidity falls back to normal levels :thinking:

here automation stop for few seconds then restarts for 5 min

current config:

alias: Bathroom Humidity Exhaust Fan
description: ""
use_blueprint:
  path: Blackshome/bathroom-humidity-exhaust-fan.yaml
  input:
    trigger: sensor.senzor_de_umiditate_derivative
    bathroom_humidity_sensor: sensor.sonoff_temp_bucatarie_humidity
    manual_trigger:
      - switch.ventilator_baie_mare_switch_0
    manual_trigger_default_time_delay: 5
    manual_trigger_winter_time_delay: 5
    include_manual_trigger: disable_manual_trigger
    fan_switch:
      area_id: baie_mare
      device_id: 436181267fd1aadc7eb96180cad80e5c
      entity_id: switch.ventilator_baie_mare_switch_0
    include_manual_fan_switch: enable_manual_fan_switch_auto_off
    manual_fan_switch:
      - switch.ventilator_baie_mare_switch_0
    manual_fan_switch_time_delay: 5