šŸŒ” Temperature Control Exhaust Fan

No problem, your welcome. :slightly_smiling_face:

Hey man,
new to the hole template thing.
I am trying to change your script. I would like to invert it.

If the temp goes under a specific value: turn ON
If the temp goes over a specific value: turn OFF

I tried to change the conditions from below to above but that didnt work.
Furthermore I changed the ā€œwait_for_triggerā€ section:

wait_for_trigger:
      platform: numeric_state
      entity_id: sensor.bme280_temperature
      above: 20.7

So yeah, if the temp goes below a value, the trigger goes on. That is working. But I do not get it to work to turn off above a specific value.

Can you maybe give me a hint, how I should change the script to act like I want it to? :slight_smile:

Hi @MoJack Firstly welcome to the community.

I will do a new blueprint that works the opposite way. Working on it now. What do you need it for so I know what t call it?

Hey @Blacky , thank you for the welcome!

I basically use it to turn on/off a smart plug that controls a heating pad.
If itā€™s to cold, turn it on, if the desired temp is reached, turn it off.

Thank you for your help!

Ok, I will do it in the same blueprint but give the option to invert it.

Edit: A new Blueprint done just testing now

Edit: All done passed test, creating new blueprint now

Edit: New blueprint ā„ Temperature Control Exhaust Fan - Inverted

2 Likes

New update 1.5

This is quite a big update :firecracker:. I am slowly going through my blueprint so they all look and feel the same :partying_face:

:warning: Please read this before upgrading. If you use ā€œFan Speed - Switch Off Optionā€ in you automations, once you upgrade you will need to select ā€œEnable the fan speed - switch off optionā€ as shown below and click save.

New Features :new:

  • Added ā€œFanā€ domain to fan switch.

  • Added enable / disable option to the ā€œFan Speed ā€“ Switch OFF Optionā€.

  • Added Fan domain to ā€œFan Speed ā€“ Switch OFF Optionā€.

  • Upgraded by-pass to have 3 options. You can now choose what you would like the fan to do when you turn the by-pass ON.

    1. Turn fan ON.
    2. Turn fan OFF.
    3. Keep the current fan state.
  • Added the ability to use a ā€œBy-pass Auto OFF Optionā€. This is used when you turn the by-pass ON and you would like the by-pass to automatically turn OFF in a set time delay. It can also be used as a timer to turn the fan ON and then OFF if you have chosen to use ā€œEnable the By-pass - Turn fan ONā€.

  • Added end of time trigger. The fan will turn OFF when end time crosses over and your ā€œRising Valueā€ is over itā€™s setting.

  • Added some safe guards for HA restart.

  • Cleaned up some code.

Bugs Fixes :bug:

  • Start of time trigger.
  • Some other bugs.

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:

Working great with my ceiling fan! Is there a way to add a condition so that it only works when my presence tracker is showing as ā€œhomeā€?

Hi @crepetsky

Nice :+1:

Currently the blueprint doesnā€™t have "zoneā€™ as a condition. I will put this on the list.

If you would like to do this you could set up a template sensor that is OFF when you are ā€œHomeā€. You would then put that sensor in the bypass and select ā€œEnable the By-pass - Turn fan OFFā€. So what would happen is when your are ā€œNot Homeā€ or ā€œAwayā€ the template sensor would get automaticity turned ON thus turning your bypass ON and the fan OFF when you leave. When you get home the bypass would go OFF allowing the automation to run. :wink:

If you need help creating this template sensor then let us know and I will provide you the code.

Blacky :smiley:

1 Like

The code would be great, thanks so much!

@crepetsky

No problem :wink:

Below are 2 sensors. One for a individual person and one for the zone. You will need to decide what suits you. If you would like to track multiple persons then you could create all your person sensors and then group them with a helper. The zone one is for any device in a zone you are tracking. You then would enter this code into your ā€œconfiguration.yamlā€ file and restart home assistant. You will then have the new sensor you can enter into the by-pass.

Things you can change to your liking are;

  • ceiling_fan_zone_person_blacky_sensor - (The name must be unique and be in lower case and if you would like a space then it must be ā€œ_ā€. This is the entity ID of your sensor)
  • Ceiling Fan Zone - Blacky Home Sensor
  • presence
  • mdi:map-marker-account-outline
  • ceiling_fan_zone_sensor - (The name must be unique and be in lower case and if you would like a space then it must be ā€œ_ā€. This is the entity ID of your sensor)
  • Ceiling Fan Zone - Home Sensor

Things you must change (entity name) or check the zone you have

  • device_tracker.blacky_iphone
  • ā€˜homeā€™ - you may have a different zone name other than ā€œhomeā€
  • zone.home

This is for a person.

binary_sensor:
  - platform: template
    sensors:
      ceiling_fan_zone_person_blacky_sensor:
        friendly_name: "Ceiling Fan Zone - Blacky Home Sensor"
        device_class: presence
        icon_template: mdi:map-marker-account-outline
        value_template: >-
          {% if states('device_tracker.blacky_iphone', 'home') %}
            off
          {% else %}
            on
          {% endif %}

This is for a zone.

binary_sensor:
  - platform: template
    sensors:
      ceiling_fan_zone_sensor:
        friendly_name: "Ceiling Fan Zone - Home Sensor"
        device_class: presence
        icon_template: mdi:map-marker-account-outline
        value_template: >-
          {% if states('zone.home')|float > 0 %}
            off
          {% else %}
            on
          {% endif %}

You could have both, so if a bedroom for ā€œblackyā€ has a ceiling fan and when blacky is home the fan will work. You could have another bedroom that is for a different person so you would add another sensor in for that person. But you could have ceiling fans in kitchen then you could use zone or a group helper with all your person sensors selected. You would then use the correct sensor for the automation.

This is using both sensors together. NOTE: We only need one ā€œbinary_sensor:ā€ header.

binary_sensor:
  - platform: template
    sensors:
      ceiling_fan_zone_person_blacky_sensor:
        friendly_name: "Ceiling Fan Zone - Blacky Home Sensor"
        device_class: presence
        icon_template: mdi:map-marker-account-outline
        value_template: >-
          {% if states('device_tracker.blacky_iphone', 'home') %}
            off
          {% else %}
            on
          {% endif %}

  - platform: template
    sensors:
      ceiling_fan_zone_sensor:
        friendly_name: "Ceiling Fan Zone - Home Sensor"
        device_class: presence
        icon_template: mdi:map-marker-account-outline
        value_template: >-
          {% if states('zone.home')|float > 0 %}
            off
          {% else %}
            on
          {% endif %}

Hope this helps.

Blacky :smiley:

1 Like

New update 1.6

:warning: BLUEPRINT CODE UPDATE :exclamation:

Just a heads up if your still on a old HA version before you update.

From time to time Home Assistant update their code structure and the old code will become ā€œDEPRECATEDā€ stopping / breaking automations from working. It effected this blueprint about 4 to 6 months ago. I wanted to wait some time so everyone had a chance to update their HA version before updating the code as older HA versions can not run the new code. This blueprint has now been updated so it will still operate once HA remove the ā€œDEPRECATEDā€ code from their system. :wink: :+1:

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:

How do I set it that when the FAN goes on when passing a valueā€¦ then normally it should go off when below a value. Sometimes it takes too long and would like it to turn off after 45min if it didnā€™t get below that value.

@kimbo1st

Good suggestion, I will look at it tonight and add maximum run time option. Stay tuned for the update.

Blacky :smiley:

1 Like

New update 1.7

New Features :new:

  • Added ā€œMaximum Run Time Option". This allows you to set a maximum run time for the fan if the falling value is not achieved.
  • Added ā€œGlobal Conditionsā€. You can now set any condition you like.

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:

It seems not to be workingā€¦ settings are the same as before, only set maximum runtime to 60min.

@kimbo1st

Hi Kim

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.


alias: Badkamer FAN automatie
description: ""
use_blueprint:
  path: Blackshome/temperature-control-exhaust-fan.yaml
  input:
    trigger_sensor: sensor.shelly_temp_sensor_humidity
    entity_turn_on:
      entity_id: switch.badkamer_ventilator_switch_0
    rising_value: 75
    falling_value: 68
    maximum_run_time:
      hours: 0
      minutes: 45
      seconds: 0
    after_time: "07:00:00"
    before_time: "23:00:00"
    include_maximum_run_time: enabled_maximum_run_time
    include_time: time_enabled

@kimbo1st

Thanks Kim, found a bug, it is fixed and updating now. Let us know if it is working.

Blacky :smiley:

New update 1.8

Bugs Fixes :bug:

  • Fix a bug if no global condition was set the automation would not run.

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:

1 Like

Hi - this seems to be exactly what iā€™ve been after and as similar posts have suggested I am using it to trigger heating on/off. Thankyou!! :slight_smile:

I do seem to be having issue after my initial testing. If I manually run the blueprint it works as expected.

How frequently does it run, or pull data before a decision is made? Or do I need to something else with this? As it does not yet seem to be ā€œautomatedā€ For info I have enabled time options and during testing they are within the range.