Skip to content

Instantly share code, notes, and snippets.

@malosaa
Last active October 1, 2023 06:41
Show Gist options
  • Save malosaa/da4cff6df0471c8d58101e8d3c9bc5ae to your computer and use it in GitHub Desktop.
Save malosaa/da4cff6df0471c8d58101e8d3c9bc5ae to your computer and use it in GitHub Desktop.
☀️ SMART SAVER CONTROL V1.0.1 ☀️
blueprint:
name: ☀️ Smarter Saver Control ☀️
description: |
## ☀️ SMART SAVER CONTROL V1.0.1 ☀️
Save 💰💰💰 by this blueprint, easy setup, it just takes 1 minute to setup..
### Optional entities:
+ A heater device for the new added quick heater feature.
- A scene to use with the extra heater feature (not ready)
### features:
- Trigger automatically when the temperature changes outside but must have a attribute called **TEMPERATURE** (example zigbee device)
- Trigger automatically every **1 hour**.
- Trigger on home-assistant **restart**.
- Checks the temperature outside and u can customize everything.
- Setup the min-max of the temp sensor that needs to match so it changes the thermostat inside.
- Setup the thermostat temp it must match with the outside temperature.
- select a time-zone that this all will trigger and work.
- Select a custom night time so it stops triggering and pre-sets the thermostat to your custom input.
- Manually type the name of (preset mode) when the morning time kicks in so it sets it up in that selection.
- Manually type the name of (preset mode) when the night time kicks in so it sets it up in that selection.
### Optional features:
- extra heater, like i use to speed up the heating in my house (optional) (not ready).
- added quick heater, to extra quick warm-up at the morning.
### changes and fixes:
```yaml
- Corrected some check issue.
+ Added quick heater OPTIONAL feature.
+ Added trigger by value change of the outside temp sensor.
- Night state check to not keep triggering.
```
domain: automation
input:
heating:
name: ♨️Climate Device♨️
description: Your thermostat device.
selector:
entity:
domain: climate
temp_sensor:
name: 🌡️Outside temperature sensor🌡️
description: This sensor checks with the thermostat inside.
selector:
entity:
domain: sensor
device_class: temperature
state_name_morning:
description: Here you type the preset-state name of your thermostat when entering the morning and start spending money.
name: 💰Preset for the morning💰
default: "home"
state_name_night:
description: Here you type the preset-state name of your thermostat when entering the night time to save some money(lowercase)
name: 💚Preset for the night💚
default: "asleep"
extra_heater:
name: 💰Extra heater (beta) NOT READY (EXPERMIENTAL)💰
description: (OPTIONAL)
default: false
selector:
entity:
domain: sensor
quick_heat:
description: (OPTIONAL) Set it to true or false, will set the thermostat to 25 to heat using the preset of freezing state, starts after 05:00 will stop before the morning state.
name: 💰quick heater mode💰
default: false
selector:
boolean:
#==================================================================================================================
min_temp:
name: 🌡️Minimal temperature🌡️
description: this will check if the value is above the outside temperature
default: 20
selector:
number:
min: 15
max: 30
step: 0.1
mode: slider
max_temp:
name: 🌡️Maximal temperature🌡️
description: this will check if the value is below the outside temperature
default: 40
selector:
number:
min: 0
max: 40.0
step: 0.1
mode: slider
set_temp:
name: ♨️Set thermostat temp♨️
description: If the temperature match the min and max it sets the thermostat to this setup value.
default: 17
selector:
number:
min: 14.0
max: 25.0
step: 0.5
mode: slider
#==================================================================================================================
#==================================================================================================================
min_temp2:
name: 🌡️Minimal temperature🌡️
description: this will check if the value is above the outside temperature
default: 18
selector:
number:
min: 0
max: 25.0
step: 0.1
mode: slider
max_temp2:
name: 🌡️Maximal temperature🌡️
description: this will check if the value is below the outside temperature
default: 20
selector:
number:
min: -20.0
max: 25.0
step: 0.1
mode: slider
set_temp2:
name: ♨️Set thermostat temp♨️
description: If the temperature match the min and max it sets the thermostat to this setup value.
default: 19.5
selector:
number:
min: 14.0
max: 30.0
step: 0.5
mode: slider
#==================================================================================================================
#==================================================================================================================
min_temp3:
name: 🌡️Minimal temperature🌡️
description: this will check if the value is above the outside temperature
default: 15
selector:
number:
min: 0
max: 30
step: 0.1
mode: slider
max_temp3:
name: 🌡️Maximal temperature🌡️
description: this will check if the value is below the outside temperature
default: 17
selector:
number:
min: 0
max: 30
step: 0.1
mode: slider
set_temp3:
name: ♨️Set thermostat temp♨️
description: If the temperature match the min and max it sets the thermostat to this setup value.
default: 20.5
selector:
number:
min: 14
max: 30
step: 0.5
mode: slider
#==================================================================================================================
#==================================================================================================================
min_temp4:
name: 🌡️Minimal temperature🌡️
description: this will check if the value is above the outside temperature
heating on.
default: 9,1
selector:
number:
min: 0
max: 30
step: 0.1
mode: slider
max_temp4:
name: 🌡️Maximal temperature🌡️
description: this will check if the value is below the outside temperature
heating on.
default: 14
selector:
number:
min: 0
max: 30
step: 0.1
mode: slider
set_temp4:
name: ♨️Set thermostat temp♨️
description: If the temperature match the min and max it sets the thermostat to this setup value.
default: 21
selector:
number:
min: 14.0
max: 30.0
step: 0.5
mode: slider
#==================================================================================================================
#==================================================================================================================
min_temp5:
name: 🌡️Minimal temperature🌡️
description: this will check if the value is above the outside temperature
heating on.
default: 0,6
selector:
number:
min: 0
max: 25
step: 0.1
mode: slider
max_temp5:
name: 🌡️Maximal temperature🌡️
description: this will check if the value is below the outside temperature
heating on.
default: 9
selector:
number:
min: 0
max: 25.0
step: 0.1
mode: slider
set_temp5:
name: ♨️Set thermostat temp♨️
description: If the temperature match the min and max it sets the thermostat to this setup value.
default: 21.5
selector:
number:
min: 14
max: 30
step: 0.5
mode: slider
#==================================================================================================================
#==================================================================================================================
min_temp6:
name: ❄️Minimal temperature (FOR FREEZING STATE )❄️
description: this will check if the value is above the outside temperature
heating on.
default: -0.1
selector:
number:
min: -40
max: -0
step: 0.1
mode: slider
max_temp6:
name: ❄️Maximal temperature (FOR FREEZING STATE )❄️
description: this will check if the value is below the outside temperature
heating on.
default: -30
selector:
number:
min: -40
max: 0
step: 0.1
mode: slider
set_temp6:
name: ♨️Set thermostat temp♨️
description: If the temperature match the min and max it sets the thermostat to this setup value.
default: 22
selector:
number:
min: 14
max: 30
step: 0.5
mode: slider
#==================================================================================================================
#==================================================================================================================
time_after:
name: Time After
description: This is the timer that it will check the sensors to trigger
default: 08:00:00
selector:
time: {}
time_before:
name: Time Before
description: This is the timer that it will check the sensors to trigger
default: '00:00:00'
selector:
time: {}
time_night:
name: Time night
description: After this time the heating turns off, This to prevent the heating
is on in the middle of the night
default: '00:00:00'
selector:
time: {}
variables:
set_temp: !input 'set_temp'
set_temp2: !input 'set_temp2'
set_temp3: !input 'set_temp3'
set_temp4: !input 'set_temp4'
set_temp5: !input 'set_temp5'
set_temp6: !input 'set_temp6'
set_temp_turbo: '25'
extra_heater: !input extra_heater
heating: !input 'heating'
morning: !input 'state_name_morning'
quick_heat: !input 'quick_heat'
#trigger:
#- platform: homeassistant
# event: start
#- platform: event
# event_type: automation_reloaded
#- platform: time_pattern
# minutes: /2
trigger:
- platform: homeassistant
event: start
- platform: state
entity_id: !input 'temp_sensor'
attribute: temperature
- platform: time_pattern
hours: /1
action:
- choose:
- conditions:
- condition: not
conditions:
- condition: state
entity_id: !input 'heating'
state: !input 'state_name_morning'
attribute: preset_mode
sequence:
- service: climate.turn_on
target:
entity_id: !input 'heating'
- service: climate.set_preset_mode
target:
entity_id: !input 'heating'
data:
preset_mode: !input 'state_name_morning'
- choose:
- conditions:
- condition: numeric_state
entity_id: !input 'temp_sensor'
above: !input 'min_temp'
below: !input 'max_temp'
- condition: time
before: !input 'time_before'
after: !input 'time_after'
- condition: not
conditions:
- condition: state
entity_id: !input 'heating'
state: !input 'set_temp'
attribute: temperature
sequence:
- service: climate.set_temperature
data:
entity_id: !input 'heating'
hvac_mode: heat_cool
temperature: '{{ set_temp }}'
- conditions:
- condition: numeric_state
entity_id: !input 'temp_sensor'
above: !input 'min_temp2'
below: !input 'max_temp2'
- condition: time
before: !input 'time_before'
after: !input 'time_after'
- condition: not
conditions:
- condition: state
entity_id: !input 'heating'
state: !input 'set_temp2'
attribute: temperature
sequence:
- service: climate.set_temperature
data:
entity_id: !input 'heating'
hvac_mode: heat_cool
temperature: '{{ set_temp2 }}'
- conditions:
- condition: numeric_state
entity_id: !input 'temp_sensor'
above: !input 'min_temp3'
below: !input 'max_temp3'
- condition: time
before: !input 'time_before'
after: !input 'time_after'
- condition: not
conditions:
- condition: state
entity_id: !input 'heating'
state: !input 'set_temp3'
attribute: temperature
sequence:
- service: climate.set_temperature
data:
entity_id: !input 'heating'
hvac_mode: heat_cool
temperature: '{{ set_temp3 }}'
- conditions:
- condition: numeric_state
entity_id: !input 'temp_sensor'
above: !input 'min_temp4'
below: !input 'max_temp4'
- condition: time
before: !input 'time_before'
after: !input 'time_after'
- condition: not
conditions:
- condition: state
entity_id: !input 'heating'
state: !input 'set_temp4'
attribute: temperature
sequence:
- service: climate.set_temperature
data:
entity_id: !input 'heating'
hvac_mode: heat_cool
temperature: '{{ set_temp4 }}'
- conditions:
- condition: numeric_state
entity_id: !input 'temp_sensor'
above: !input 'min_temp5'
below: !input 'max_temp5'
- condition: time
before: !input 'time_before'
after: !input 'time_after'
- condition: not
conditions:
- condition: state
entity_id: !input 'heating'
state: !input 'set_temp5'
attribute: temperature
sequence:
- service: climate.set_temperature
data:
entity_id: !input 'heating'
hvac_mode: heat_cool
temperature: '{{ set_temp5 }}'
- conditions:
- condition: numeric_state
entity_id: !input 'temp_sensor'
below: !input 'min_temp6'
above: !input 'max_temp6'
- condition: time
before: !input 'time_before'
after: !input 'time_after'
- condition: not
conditions:
- condition: state
entity_id: !input 'heating'
state: !input 'set_temp6'
attribute: temperature
sequence:
# - service: climate.set_preset_mode
# data:
# entity_id: !input 'heating'
# preset_mode: 'home'
- service: climate.set_temperature
data:
entity_id: !input 'heating'
hvac_mode: heat_cool
temperature: '{{ set_temp6 }}'
######################################### QUICK HEATER ##################################
- conditions:
- condition: numeric_state
entity_id: !input 'temp_sensor'
below: !input 'min_temp6'
above: !input 'max_temp6'
- condition: time
before: !input 'time_after'
after: '05:00'
- condition: template
value_template: "{{ quick_heat }}"
sequence:
- service: climate.set_temperature
data:
entity_id: !input 'heating'
hvac_mode: heat_cool
temperature: '{{ set_temp_turbo }}'
######################################### NIGHT TIME #####################################
- choose:
- conditions:
- condition: not
conditions:
- condition: state
entity_id: !input 'heating'
state: !input 'state_name_night'
attribute: preset_mode
- condition: time
after: !input 'time_night'
before: !input 'time_after'
- condition: template
value_template: "{{ not quick_heat }}"
# "{{ not zone_only }}"
sequence:
- service: climate.set_preset_mode
target:
entity_id: !input 'heating'
data:
preset_mode: !input 'state_name_night'
############IF NOTHING IS TRUE##############################
# default:
# - service: notify.persistent_notification
# data:
# message: a message
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment