🚽 Toilet Exhaust Fan - Time Delay - Trigger Wait Time - Time

For detect smelly side effect you need right sensor (H2S, metan, …). :smiley:

@Kaacz

I have developed it for 3 more option if the trigger is inverted (light from on to off = fan on). I have done the testing and it works, but will probably do some more tests. Just need to clean it up before I release it (version 1.6). Once I am 100% happy I will release it. Probably be in a day or two.

New update 1.6

Added “Trigger Options”. You can now select “Normal Mode” or “Invert Trigger”.

Normal Mode (Default) - This will start the fan when the trigger goes from an OFF to ON state. Example, Light turned ON or motion sensor detected.

Invert Trigger - This will start the fan when the trigger goes from an ON to OFF state. Example, Light turned OFF. It is not recommended to use this option when using a motion sensor.

Enjoy

Blacky :grinning:

New update 1.7

Fixed a bug when using “Trigger Wait Option”. In one scenario the fan would not turn off.

Enjoy

Blacky :grinning:

1 Like

New update 1.8

New Features :new:

  • By-pass Options - This allows you to add a by-pass to the automation. you have 3 by-pass options.

    • Enable the By-pass - Turn fan ON
    • Enable the By-pass - Turn fan OFF
    • Enable the By-pass - Keep the fan current state

What can this now do?

  1. Allow manual control of you fan.
  2. Allow you to create a run on timer for the fan.
  3. Allow you to use this blueprint with my other blueprints.

Example on how to use it with my :shower: Bathroom Humidity Exhaust Fan

If you are using my “Bathroom Humidity Exhaust Fan” blueprint and you would like to give priority to it and disable this automation to then return back to normal when the “Bathroom Humidity Exhaust Fan” blueprint finishes then you would do the following.

  1. First create a toggle helper and enter it into “Enable the By-pass - Turn fan ON” or “Enable the By-pass - Keep the fan current state” as shown below.

  2. Then in my “Bathroom Humidity Exhaust Fan” blueprint you would enter this same helper into the “Fan Switch” as shown below.

  3. If you are using low speed in my “Bathroom Humidity Exhaust Fan” blueprint you would enter this same helper into the “Fan Switch” & “Low Speed Switch” as shown below.

  4. That is it your done :partying_face:

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:

2 Likes

New update 1.9

New Features :new:

  • Trigger Wait Option - Now works with “Invert Trigger”.

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:

New update 2.0

New Features :new:

  • HA Restart Option - You now have the option to enable a Home Assistant Restart Option. This will now turn the fan OFF in the set time delay when HA restarts. We have made it an enable / disable option as if you are using one of my other blueprint like :shower: Bathroom Humidity Exhaust Fan blueprint and the same fan is used in that automation then do not need to enable this option as “Bathroom Humidity Exhaust Fan” blueprint already has a built in safeguard when HA restarts. This will prevent conflicts and why it is an option to enable or disable.

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:

Hi Blacky,

Thank you for your efforts in making HA more usable with these insanely good blueprints.

I was wondering if there was a way to link this with “Sensor Light” so the light automation is disabled while the fan is on.

The only way i can do this, i believe is by adding the Bathroom Humidity Exhaust Fan.

Thank you in advance for your help.

Hi @ripblade

Firstly welcome to the community :wave:

Your welcome and thanks for your kind words.

You would have to create a template sensor. So I will do one better for you, I will add the same automation link as used in the bathroom humidity exhaust fan blueprint… I will need to think about all the logic when using light, toilet, humidity blueprints all together… but I will keep you updated. Keep an eye out for a new update in the next few days.

EDIT: Can you explain to me your set up so I can understand your use case. Can you also let me know what is your trigger.

Blacky :smiley:

Hi Blacky,

Thanks for getting back to me! I appreciate the time spent.

I have 2 workflows using your blueprints:
Powder Room

  1. Sensor Lights blueprint triggers lights on motion and turns off when no motion is detected unless powder room door is closed
  2. Toilet Exhaust Fan blueprint triggers the fan based on door contact sensor closing (sensor lights disabled ideally while this is happening - bypassing above logic)
    2.1 - i do have a problem currently using the contact door sensor and cant seem to have this logic work even in inverted mode. Basically fan only turns on for the allocated time and turns off regardless is the door is open or closed.

Bathroom

  1. Sensor Lights blueprint triggers lights on motion and turns off when no motion is detected unless bathroom door is closed
  2. Toilet Exhaust Fan blueprint triggers the fan based on door contact sensor closing (sensor lights disabled ideally while this is happening), fan is turned off 2 mins after door is open (disabled by below and bypass above logic)
  3. Bathroom Humidity Exhaust Fan will turn on the fan if humidity is too high even when the door is open and will turn off when humidity returns (bypass above logic)

I hope that is clear and thank you for your help in advance.

Side question is there a way for the Toilet Exhaust Fan to turn off the fan based on how long the door has been closed? trying to track a quick toilet use vs a longer one where i would want the fan on longer after door is open

@ripblade

No problem.

All this is possible… there is some work to do.

For your powder room and your bathroom using the door as the trigger can be unreliable because sometimes you close the toilet door and your not even using it. You are also trying to turn it ON when the door is closed and turn OFF when the door is close :thinking:. Good thing is I have a solution for you. What you need to do is create a template sensor I call " :honeybee: Bee In The Hive :honeybee:“. This works with your motion sensor and your door sensor. If the door is closed and motion is detected it knows the bee in in the hive and turn ON, nice hay :wink:. I have a post in my sensor light blueprint on template sensors but it will work perfectly for this Click Here. Once you create the template sensor " :honeybee: Bee In The Hive :honeybee:” use this for your toilet trigger and your sensor light group your motion sensor and " :honeybee: Bee In The Hive :honeybee:" for the trigger, then you will not need a by-apss in the sensor light.

Have a look at my set up Click Here.

You will not need this once you create " :honeybee: Bee In The Hive :honeybee:“. Here is my settings… for me when the light is on for 2 min the fan will come on and when I turn the light OFF the time delay starts. If the light is ON for les then 2 min the fan will not come on. Rather than the light as the trigger use then " :honeybee: Bee In The Hive :honeybee:”.

Hope this helps you… let us know how you get on.

Blacky :smiley:

Hey there,

Sorry it took a while, I rushed in and didnt read the instructions properly and had a week of hell before i figure out what I did wrong.

This Bee In The Hive is an ingenious workaround!

I had to bump up the timer to 30 sec (motion sensors lowest refresh rate) but so far it seems to work, a few quirks which im sure i’ll figure out.

Now to try and make this work in the bathrooms!

Thanks again.

PS: any word on the bypass option for this blueprint so it can be bypassed by Bathroom Humidity Exhaust Fan

Hey Blacky,

Wondering why you choose to use the light as a trigger for your fans instead of the Bee In The Hive + motion sensor group?

Thanks!

@ripblade

It is a nice sensor :wink: :hearts: I do like it a lot, and it is so simple once you know.

The bathroom humidity blueprint has a “Automation Link Option” so you can by-pass this blueprint. I would say the bathroom humidity blueprint should have priority. Let me know if this works?

For me I have separate room for my toilets, they are not in the bathroom. I dont have a motion or a door sensors for the toilet room and I just use the light with “Trigger Wait Option " and time so the fan will not run when we are sleeping. Works perfectly for me. I don’t use the " :honeybee: Bee In The Hive :honeybee:” for the toilets.

Blacky :smiley:

Hey @Blacky can I get some help please?
I have both this automation installed and running and bathroom humidity exhaust fan automations. They seem to be conflicting with each other - and switching the fan off when it shouldnt be turned off (even though technically it should be turned off due to derivative sensor).
So I have a binary sensor that shows the state of a physical switch from a Shelly 2.5. This is what I use to facilitate toilet exhaust fan operation. A person needs to turn the switch on (to turn on non smart lights) when having a shower (shower is also in the same bathroom as the toilet). The same goes for using the toilet - turn on the physical switch to turn the light on in the bathroom - HA knows when the bathroom light is on due to the Shelly.

  • ‘Toilet Exhaust Fan’ automation should turn on the fan after 2 minutes of binary_sensor.bathroom_light_switch being turned on. This works fine.
  • ‘Toilet Exhaust Fan’ automation should turn off the fan after 5 minutes of binary_sensor.bathroom_light_switch being turned off. This works fine in isolation.
  • ‘Bathroom Humidity Exhaust Fan’ automation turns the fan on when sensor.ensuite_bathroom_humidity_derivative rises to +2.5%. This works fine.
  • ‘Bathroom Humidity Exhaust Fan’ automation turns the fan off when sensor.ensuite_bathroom_humidity_derivative drops to -2.3%. This works fine in isolation.

However, what I am seeing is the fan going off while someone is showering - humidity derivative appears to have master control as the values are telling HA to turn the fan off. Overall this isnt good because I am the only one (of 4) that opens the window when showering (better to get the humidity out naturally as well as via the fan). Sadly, I have noticed as of yesterday mould has started to build up very quickly.

What I want to happen is ‘Toilet Exhaust Fan’ to take the lead - if the light is on for more than the 3 minute timer, turn on the fan regardless of humidity levels. Then, when someone turns off the bathroom light, if the humidity is still too high, the ‘Bathroom Humidity Exhaust Fan’ to continue to bring down the humidity level
What I dont want to happen is the ’ Bathroom Humidity Exhaust Fan’ take the lead and turn off the fan even though the bathroom light is on.

Can you help?
Here are the yaml configs:

Bathroom Humidity Exhaust Fan

alias: Fan - Ensuite - Toilet Exhaust Fan
description: ""
use_blueprint:
  path: Blackshome/toilet-exhaust-fan.yaml
  input:
    entity_trigger: binary_sensor.bathroom_light_switch
    fan_switch: fan.ensuite_fan_combined
    trigger_bypass: input_boolean.ensuite_fan_automation
    include_bypass:
      - bypass_enabled
      - bypass_enabled_turn_on
    time_delay: 5
    trigger_wait_option: wait_for_trigger
    bypass_fan_on:
      - input_boolean.ensuite_bathroom_fan_automation_link_bypass
    include_bypass_auto_off:
      - bypass_auto_off_enabled_on
    trigger_wait_time: 2

Bathroom Humidity Exhaust Fan

alias: Fan - Ensuite - Bathroom Humidity Exhaust Fan
description: ""
use_blueprint:
  path: Blackshome/bathroom-humidity-exhaust-fan.yaml
  input:
    trigger: sensor.ensuite_bathroom_humidity_derivative
    fan_switch:
      entity_id:
        - fan.ensuite_fan_combined
        - input_boolean.ensuite_bathroom_fan_automation_link_bypass
    bathroom_humidity_sensor: sensor.ensuite_humidity_sensor_humidity
    rising_humidity: 2.5
    falling_humidity: -2.3
    include_max_humidity: maximum_humidity_enabled
    max_humidity: 75
    fan_speed_low:
      - fan.fan_idle_speed
    time_out: 40
    include_fan_speed: fan_speed_disabled
    winter_include_max_humidity: maximum_humidity_disabled
    winter_max_humidity: 85
    include_winter_mode: winter_mode_disabled
    month_winter_mode:
      - "1"
      - "2"
      - "3"
      - "10"
      - "11"
      - "12"
    winter_rising_humidity: 2
    winter_falling_humidity: -2
    winter_time_out: 40
    winter_include_fan_speed: fan_speed_disabled
    manual_fan_switch: []
    include_manual_fan_switch: disable_manual_fan_switch
    include_automation_link: disable_automation_link
    automation_link:
      - input_boolean.ensuite_bathroom_fan_automation_link_bypass
    include_bypass: bypass_disabled
    bypass_options: []

@Townsmcp

Hi James

First lets do some house keeping. Please delete the line as shown below and save. If you happy and it easy you could recreate the toilet exhaust fan just encase I missed something.

Then lets look at the toilet exhaust fan automation first. You have an auto off for the bypass. If you have this for a reason… like to run the fan for x amount of time to then get turned OFF then all is good… but create a new by-pass entity and use the by-pass in the humidity blueprint not here. In this automation disable the by-pass auto OFF.

Now lets look at your bathroom humidity exhaust fan automation. In the fan switch enter your by-pass used in the toilet automation that does not have an auto OFF for it. I have allowed for this to be entered into the fan switch for when you use both of these 2 blueprint together (maybe I should document it in a FAQ). Don’t use the automation link for the toilet blueprint. Again if you wanted a by-pass to turn the fan on for x amount of time to then turn OFF create a new by-pass entity (toggle helper) and use the by-pass in this blueprint.

So now the same bypass should be in the toilet blueprint by-pass and the humidity blueprint fan switch.

Now what will happen.

  1. Toilet works as you said. = All good.
    1. When the bathroom humidity exhaust fan automation is triggered it will turn the by-pass ON and OFF with the fan. When it is ON the toilet blueprint will be disabled. = All good.
  2. When the bypass goes OFF and the light is still ON the fan will turn OFF until you turn the light OFF and back ON. = Not so good but normally at this point your done. If the light is OFF the fan will turn OFF. I could be wrong on this point as I have so many options in blueprints. If so let me know and I will check the code.

This should work…let me know how you go.

Blacky :smiley:

Thank you @Blacky. I rebuilt automation as recommended and didnt select the ‘Enable the by-pass auto off - Turn fan ON option’ that I had selected before (had it enabled before as I thought it was related to the the bypass being on for more than 60 minutes and the automation would then switch the fan and bypass off)

Fan switch in humidity automation is just used by the Toilet Exhaust Fan in ‘By-pass Switch - Turn Fan ON’ only :slight_smile:

I dont think point 3 should occur now?

Your welcome.

If you are happy try it out for a week and then provide some feedback. I think point 3 needs to be resolved.

Blacky :smiley:

1 Like

Hi - firstly I love the idea of this blueprint, and appreciate all the effort you’ve put into it. However, I’m having some trouble and I’m hoping you may be able to assist.

I have two bathrooms using this but have set up both identically. Both are experiencing the same issue.

I don’t have any smart devices near those bathrooms yet, so I added Hue Indoor Motion Sensors and Hue Smart Plugs on the exhaust fans. I’m trying to use your blueprint with these two devices.

The first problem I had was the fan would never be triggered. I think this was due to the Motion Sensors detecting motion and clearing quite rapidly, and therefore resetting the blueprint. Could you confirm that would be an issue?

In an attempt to solve it, I added a couple of helpers and automation so that an input_boolean for each bathroom will only clear if no motion is detected for 30 seconds. This seems to have improved the problem of the trigger flipping too rapidly.

Now, the issue I have is the fans not turning off. Often I’ll walk past and hear the fan still on 30 minutes after use. I’ve tried tracing your blueprint, but you have so much logic in there!

Appreciate any suggestions!

@stormshaker

Depending on how you are trying to control the fan, but yes if you are using the trigger wait time as it has to be a ON for X and if it keeps clearing then it will reset.

Let me have a look at it and see if I can come up with a better option. Having a fast motion to me is better but we need some logic.

That is strange, I have never has this and we use it every day working perfectly. We use the light switch as the trigger. So you have to turn the light ON and OFF manually.

I did try a motion sensor about 2 weeks ago as I had a spare Shelly motion sensor but their minimum blind time is 1 min and that is no good so I ended up removing it (back to being a paper weight) and when back to the light switch. I did contact Shelly but that is it you can’t adjust it lower. I am not sure why they don’t just give you an option and let the user decide. Rather than a slider they could have an input with minutes and seconds. Cost nothing but would make it more user friendly. Not sure if it is a battery thing but hay we will just recharge it. I normally love Shelly but their motion sensors are…

Stay turned

Blacky :smiley: