🌡 Temperature Control Exhaust Fan

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

GitHub Link Click Here

Version: 1.4

The most common automation used for a Temperature Control Exhaust Fan. It really can turn anything ON and OFF on a rising & falling numeric value.

The Automation Process:

  • When the sensor rises above the set value it turns the fan ON.
  • When the sensor falls below the set value it turns the fan OFF.
  • If you would like the opposite values then try this blueprint. ❄ Temperature Control Exhaust Fan - Inverted
  • You have the option to use the “Fan Speed - Off Switch Option”. This is useful for turning OFF fans with different speeds.
  • You have the option to use the “Trigger Sensor By-pass”. This allows you to add a switch to manually By-pass the trigger sensor so you can use the fan as normal by turning it ON and OFF manually.
  • You have the option to set a start time, an end time and select weekdays. This will only allow the automation to run between the time periods.

Note: If you turn the fan on manually and the automation runs it will turn the fan OFF automatically. It is recommended to use the “Trigger Sensor By-pass” option if you would like to keep the fan ON or OFF for extended time periods.

blueprint:
  name: Temperature Control Exhaust Fan
  description: >
    # Temperature Control Exhaust Fan
    
    **Version: 1.4**
    
    
    The most common automation used for a Temperature Control Exhaust Fan. It really can turn anything ON and OFF on a rising & falling numeric value. 
    
    
    Let us know what you think of this blueprint and for community support including updates: [Click Here](https://community.home-assistant.io/t/temperature-control-exhaust-fan/515861/1)
    
    
    **The Automation Process:**
     - When the sensor rises above the set value it turns the fan ON.
     - When the sensor falls below the set value it turns the fan OFF.
     - You have the option to use the "Fan Speed - Off Switch Option". This is useful for turning OFF fans with different speeds.
     - You have the option to use the "Trigger Sensor By-pass". This allows you to add a switch to manually By-pass the trigger sensor so you can use the fan as normal by turning it ON and OFF manually.
     - You have the option to set a start time, an end time and select weekdays. This will only allow the automation to run between the time periods.

     Note: If you turn the fan on manually and the automation runs it will turn the fan OFF automatically. It is recommended to use the "Trigger Sensor By-pass" option if you would like to keep the fan ON or OFF for extended time periods.
     
     Required = *
     
     **Need help?** See our FAQ: [Click Here](https://community.home-assistant.io/t/temperature-control-exhaust-fan/515861/2)
  domain: automation
  input:
    trigger_sensor:
      name: Trigger Sensor *
      description: The trigger can be any sensor you like that has a numeric value.
      selector:
        entity:
          domain: 
            - sensor
    entity_turn_on:
      name: Fan Switch *
      description: Enter the fan you would like to turn ON. Can be any switch you like.
      selector:
        target:
          entity:
            domain: 
              - switch
    entity_turn_off:
      name: Fan Speed - Off Switch Option (Optional)
      description: Sometimes you need to select a different entity to turn the fan OFF. 
        This is normally used when having a fan that has different speeds.
        Please DO NOT select the same entities that are selected above in "Fan Switch" here, as the automation will not work.
      default: []
      selector:
        entity:
          multiple: true
          domain:
            - switch
    rising_value:
      name: Rising Value
      description: The rising value to turn the fan ON.
      default: 20
      selector:
        number:
          min: 0
          max: 100
          step: 0.5
          unit_of_measurement: value
    falling_value:
      name: Falling Value
      description: The falling value to turn the fan OFF.
      default: 20
      selector:
        number:
          min: 0
          max: 100
          step: 0.5
          unit_of_measurement: value
    include_bypass:
      name: Use The Trigger Sensor By-pass Option (Optional)
      description: Select enable or disable. 
      default: bypass_disabled
      selector:
        select:
          options:
            - label: Enable the By-pass option
              value: "bypass_enabled"
            - label: Disable the By-pass option
              value: "bypass_disabled"
    trigger_bypass:
      name: Trigger Sensor By-pass
      description: Select a switch that will By-pass the trigger sensor and make your fan function as normal.
        The entity cannot be included in the "Fan Switch" selection.
      default: []
      selector:
        entity:
    include_time:
      name: Use The Time Options (Optional)
      description: Use the "Start Time", "End Time" and the "Weekdays" values to only run the automation between the time periods. 
      default: time_disabled
      selector:
        select:
          options:
            - label: Enable the time options
              value: "time_enabled"
            - label: Disable the time options
              value: "time_disabled"
    after_time:
      name: Start Time
      description: Set the start time.
      default: 00:00:00
      selector:
        time:
    before_time:
      name: End Time
      description: Set the end time.
      default: 00:00:00
      selector:
        time:
    weekday_options:
      name: Weekdays
      description: Select the days of the week you would like the automation to run. You must select "Enable the time options" above for the weekdays selections to work.
      default:
        - mon
        - tue
        - wed
        - thu
        - fri
        - sat
        - sun
      selector:
        select:
          multiple: true
          mode: list
          options:
            - label: Monday
              value: "mon"
            - label: Tuesday
              value: "tue"
            - label: Wednesday
              value: "wed"
            - label: Thursday
              value: "thu"
            - label: Friday
              value: "fri"
            - label: Saturday
              value: "sat"
            - label: Sunday
              value: "sun"

# If the temp rises above the set point again it will restart the automation.
mode: restart
max_exceeded: silent

variables:
  trigger_sensor: !input trigger_sensor
  entity_turn_on: !input entity_turn_on
  entity_turn_off: !input entity_turn_off
  rising_value: !input rising_value
  falling_value: !input falling_value
  include_bypass: !input include_bypass
  trigger_bypass: !input trigger_bypass
  include_time: !input include_time
  after_time: !input after_time
  before_time: !input before_time
  weekday_options: !input weekday_options

trigger:
  - platform: numeric_state
    id: "t1"
    entity_id: !input trigger_sensor
    above: !input rising_value
  - platform: time
    id: "t2"
    at: !input after_time
  - platform: state
    id: "t3"
    entity_id: !input trigger_bypass
    from: "on"
    to: "off"

# All Conditions
condition:

#Trigger conditions
  - condition: or
    conditions:
      - condition: and # trigger on rising value is above set point
        conditions:
          - condition: numeric_state
            entity_id: !input trigger_sensor
            above: !input rising_value
      - condition: and # trigger by time & check rising value is above set point
        conditions:
          - condition: numeric_state
            entity_id: !input trigger_sensor
            above: !input rising_value
          - condition: trigger
            id: 't2'
      - condition: and # trigger by by-pass & check rising value is above set point
        conditions:
          - condition: numeric_state
            entity_id: !input trigger_sensor
            above: !input rising_value
          - condition: trigger
            id: 't3'

# Check the By-pass
  - condition: or
    conditions:
      - "{{ include_bypass == 'bypass_disabled' }}"
      - "{{ trigger_bypass == [] }}"
      - "{{ (include_bypass == 'bypass_enabled') and (states[trigger_bypass].state == 'off') }}"

# Check the time options
  - condition: or
    conditions:
      - "{{ include_time == 'time_disabled' }}"
      - condition: and
        conditions:      
        - condition: time
          after: !input after_time
          before: !input before_time
          weekday: !input weekday_options
        -  "{{ include_time == 'time_enabled' }}"

action:
  - alias: "Turn on the entity"
    service: homeassistant.turn_on
    target: !input entity_turn_on
  - alias: "Wait until sensor is below set value"
    wait_for_trigger:
      platform: numeric_state
      entity_id: !input trigger_sensor
      below: !input falling_value
  - alias: "Turn off the entity"
    service: homeassistant.turn_off
    target: !input entity_turn_on
  - alias: "Fan speed off option"
    service: homeassistant.turn_on
    entity_id: !input entity_turn_off

CHANGELOG

  • Version: 1.3: - 28 Jan-23 - Added “Fan Speed - Off Switch Option”
  • Version: 1.3: - 26 Jan-23 - Added weekday selection.
  • Version: 1.2: - 13 Jan-23 - fixed the selection bug in By-pass
  • Version: 1.1: - 11 Jan-23 - fixed a bug in By-pass
  • Version: 1.0: - 10 Jan-23 - Initial release

MY OTHER BLUEPRINTS
Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time
Smart Relay - Contactor
Push Button Relay - Contactor
Toilet Exhaust Fan with time delay
Timer Relay - Run ON Timer
Entity - Run ON Timer
Bathroom Humidity Exhaust Fan
Temperature Control Exhaust Fan - Inverted
Turn Light, Switch or Scene On & Off with Trigger Conditions

2 Likes

FAQ

Q: I don’t fully understand the “Fan Speed - Off Switch Option”, could you explain it to me?

A Sometimes you need to select a different entity to turn the fan OFF. This is normally used when having a fan that has different speeds and one of the speeds is OFF. You normally have to turn ON the switch to turn the fan OFF. If you have this scenario then select your OFF speed entity here. If you do not have this, then please leave it blank.

Q: How to use the “Trigger Sensor By-pass” without having a physical switch?

A: Go to Settings / Devices & Services / click on the “Helpers” tab / click “+ CREATE HELPER” and select “Toggle”. In the name put “Temp Exhaust Fan Sensor By-pass” and click save. Then go back into the automation and in the “Trigger Sensor By-pass” search for the name you created in this case “Temp Exhaust Fan Sensor By-pass” and click save. Now in a “Dashboard” click “Edit dashboard” then click “+ ADD CARD” click on “Button” or “Entities” in the entity field again search for the name you created in this case “Temp Exhaust Fan Sensor By-pass” and click save. Then click “DONE”. You now have a “Temp Exhaust Fan Sensor By-pass” switch to disable the Exhaust Fan.

Q: I would like to set a different value but the slider is not letting me?

A Just simply type the number value you would like in the field and click save. A red line will appear under the number you have entered but once you click save, exit the automation and go back into it the red line will not be there.

Hi, I have implemented this blueprint and it works, thanks a lot. I have another possible situation and I would like to ask you if it can be done. Supose we also have a window in the room and hence we can do ventilation manually. Would it be possible that the automation to not run if the window is open based on the reading from an open/close window sensor?

Yep, try using the by-pass and put your window sensor in there. When window is open it will be in the “ON” state thus stopping the automation and you will have manual control over your dehumidifier. You will have to make sure the dehumidifier is OFF when you do this. Would this work for you?

Hi, thanks. I will try it tonight, so basically when you say “You will have to make sure the dehumidifier is OFF when you do this” you are practically saying that I should change the automation and put the by-pass when the automation is not active, meaning the dehumidifier is off, am I right?

No, It will not matter if the dehumidifier is ON or OFF when you open the window, but if you would like it OFF and it is ON when you open the window you will have to manually turn it OFF. It will then stay OFF as the automation will be disabled until you close the window. If it is OFF when you open the window it will stay OFF until you close the window and allow the automation to take control. Same goes if you would like it ON.

So basically the window open / close acts like a by-pass disabling the automation. Open being disabled, closed being enabled. You then have manually control of the dehumidifier when it is disabled (window open).

Edit: That just made me thing of a potential bug / problem. I have fixed it now and there will be a new update version 1.1 out soon.

Excellent explanation, thanks. I will add an Aqara mini switch so that I can put the dehumidifier to OFF before opening the window.

New update 1.1

Fixed a bug in by-pass. If the rising value was above the set point and by-pass was turned OFF from ON the fan would stay OFF. Now the fan will be turned ON and the automation will run.

Enjoy

Blacky :grinning:

If you don’t mind I wanted to make a suggestion, I think the condition is more elegant written like this.

# All Conditions

condition:

#Trigger conditions

  - or:

      - '{{trigger.entity_id == trigger_sensor}}'

      - "{{ trigger.id == 't2' or trigger.id == 't3'}}"

# Check the By-pass

  - or:

      - "{{ include_bypass == 'bypass_disabled' }}"

      - "{{ trigger_bypass == 'none' }}"

      - "{{ (include_bypass == 'bypass_enabled') and (states[trigger_bypass].state == 'off') }}"

# Check The Time Options

  - or:

      - "{{ include_time == 'time_disabled' }}"

      - and:

        - condition: time

          after: !input after_time

          before: !input before_time

        -  "{{ include_time == 'time_enabled' }}"

Love it. Thanks for the tip :wink:

I guess the automation cannot use the same switch both as switch and bypass, right? (i.e. if I turn the fan on it will stay on until I turn it off)
So I will have to create a dummy switch.

Hi:
On next release if possible the temperature values to be with a decimal for fine tunning ex: xx.x
Thanks

Yes that is correct. Please see FAQ for how to do this.

Just simply type the number you would like and click save. Please see FAQ for this.

Hi:
Ok thanks with cursor keys (left and right) i can have 20 20.5 21 21.5 and so on.
Did not realized that.
Thanks

All good happy to help any time :slightly_smiling_face: :+1:

If you would like 20.3 just type it in and click save.

Hi Blacky, just stepped in to say that everything is working perfectly based on your blueprint, once the humidity rises over 30% the dehumidifier kicks in and brings it down. Tonight I’m going to add an Aqara button and test the by-pass option with window open.

I was looking for a blueprint that I could use to create a automation that would allow me to use temperature from a Shelly H&T and turn on/off an Insteon plug that has a heater connected to it. Your blueprint seems like a good starting point but the plug doesn’t show as an option under fan switch. I’m assuming because it’s not a switch but a plug. Is there a way to make it work? Thanks in advance.

It was a bug in HA update from 2023.1.0 to 2023.1.2. I reported it on 2023.1.0 and they have fixed it now :+1:. Try updating to 2023.1.4 and let us know how you go.

hi:
I upgrade HA to 2023.1.4 deleted the automation and create a new one and i get the error:

Message malformed: Entity none is neither a valid entity ID nor a valid UUID for dictionary value @ data[‘entity_id’]

of course using the same sensors.
any idea ??
Thanks

1 Like