No problem, your welcome.
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?
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
This is quite a big update . I am slowly going through my blueprint so they all look and feel the same
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
-
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.
- Turn fan ON.
- Turn fan OFF.
- 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
- Start of time trigger.
- Some other bugs.
If you like this blueprint? Consider hitting the button in the top post
If you like my blueprints, and would like to show your support or just say thank you? Click Here
Enjoy
Blacky
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
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.
If you need help creating this template sensor then let us know and I will provide you the code.
Blacky
The code would be great, thanks so much!
No problem
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
BLUEPRINT CODE UPDATE
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.
If you like this blueprint? Consider hitting the button in the top post
If you like my blueprints, and would like to show your support or just say thank you? Click Here
Enjoy
Blacky
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.
Good suggestion, I will look at it tonight and add maximum run time option. Stay tuned for the update.
Blacky
New Features
- 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 button in the top post
If you like my blueprints, and would like to show your support or just say thank you? Click Here
Enjoy
Blacky
It seems not to be workingā¦ settings are the same as before, only set maximum runtime to 60min.
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
Thanks Kim, found a bug, it is fixed and updating now. Let us know if it is working.
Blacky
Bugs Fixes
- Fix a bug if no global condition was set the automation would not run.
If you like this blueprint? Consider hitting the button in the top post
If you like my blueprints, and would like to show your support or just say thank you? Click Here
Enjoy
Blacky
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!!
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.