🚿 Bathroom Humidity Exhaust Fan

Hi @Blacky

Thanks for your response. Could how elaborate how I should approach this with the bypass?
Thanks again

Hi, @Blacky
I’m writing to you after some time - your blueprint works perfectly for me. The only minor flaw: When restarting Home Assistant (for example, after every upgrade…) the exhaust fan always turns on. I was wondering if a similar condition could be included in the integration (borrowed from @gcobb321, thanks, Garry!):

alias: HA - Started Flag, Set
description: ""
triggers:
  - event: start
    trigger: homeassistant
conditions: null
actions:
  - delay: "00:00:20"
  - entity_id: input_boolean.ha_started_flag
    action: input_boolean.turn_on
mode: single

Being an absolute amateur, I didn’t have the courage to change your blueprint … Thanks for your opinion!

H,
First I‘d Like to say thanks a lot for the great blueprint. I’ve been using it for quite a while now and it’s working perfectly for me. There is only one slightly annoying thing: in the logs I quit frequently get this warning:

2024-11-24 22:50:24.436 WARNING (MainThread) [homeassistant.components.automation] Error evaluating condition in 'Automatiksteuerung BadlĂźfter':
In 'condition' (item 1 of 2):
  In 'or' (item 3 of 18):
    In 'and' (item 1 of 2):
      In 'template' condition: UndefinedError: 'dict object' has no attribute 'entity_id'

I’d appreciate if you could have a look at that.

Thanks a lot

@sweetpotatobeef

When set up correctly, the fan should run for the specified duration to effectively manage humidity according to your site conditions. The fan should only turn OFF as per your settings and you can adjust this. I not sure when you say “no new signal input”.

Bypass:

If you’d like to manually ensure the fan runs, you can use the bypass feature. In the bypass mode, select option 1 and add a switch to control it. This can be a physical switch or a toggle helper added to your interface, allowing you to turn the fan ON and OFF as needed. You can also enable the auto-off feature. This will automatically turn the bypass OFF after the set time delay, ensuring the fan doesn’t run longer than necessary.

Blacky :smiley:

@vaclavIII

When you restart the fan should only come ON if it thinks it needs to as per your settings. I never have this when I restart. 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.

Once I have your YAML I will try and reproduce it and if it is a bug I will squash it.

Blacky :smiley:

@jonathanarcher

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:

Sure:

alias: Automatiksteuerung BadlĂźfter
description: Feuchteabhängige Steuerung des Badlßfters.
use_blueprint:
  path: Blackshome/bathroom-humidity-exhaust-fan.yaml
  input:
    by_pass: fan.badlufter
    trigger: sensor.ableitung_badezimmerfeuchte
    fan_switch:
      device_id: 5912a7d423c42bbe65ebb3df15709c00
    automation_link: []
    bypass_options:
      - bypass_turn_fan_off
    include_bypass: bypass_enabled_turn_on
    include_bypass_auto_off: bypass_auto_off_enabled
    bypass_auto_off_delay: 10
    include_max_humidity: maximum_humidity_enabled
    max_humidity: 80
    bathroom_humidity_sensor: sensor.multisensor_badezimmer_humidity

Thanks a lot!

Hi @Blacky

Thanks for your response.

The fan has a built in zigbee receiver. I send a “turn on” via z2m once the automation kicks in. But this “turn on” must be repeated or the fan will turn itself off after 15min.
So thats why I ask for a “keep-alive” function to repeatedly send a “turn-on” in a certain interval.

@jonathanarcher

Thanks that makes it easy.

Your Fan Switch needs to be set as an entity, not a device. Currently, it’s set as a device (blue), but it should be an entity (green). To change this, click the <> icon next to the X on the device you selected for the Fan Switch. This will show a list of entities associated with that device. From this list, select only the fan entity.

Blacky :smiley:

@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.