Skip to content

Instantly share code, notes, and snippets.

@briodan
Last active January 17, 2024 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save briodan/8494b05f2070d715fbb4e16a3973b3ea to your computer and use it in GitHub Desktop.
Save briodan/8494b05f2070d715fbb4e16a3973b3ea to your computer and use it in GitHub Desktop.
Thermostat with room sensors
blueprint:
name: thermostat with helper tolerance
description: turn on thermostat based on remote sensor and time of day. the automation will turn run on the interval specified in frequency and turn on the thermostat via selected script. the times and sensors allow you to control it based on different rooms and times of day.
domain: automation
## This Blueprint requires 3 helpers
## - one helper to be built as type dropdown with the following options: Heat, Cool, Idle - this is used for a more esily readable display on the dashbaord when looking at history
## - one helper to be built as type number with a min value of 0.5 a max of 5 and a step of 0.5 - this is used to adjust the heating temperature quickly and avoid the thermostat/AC from flapping
## - one helper to be built as type number with a min value of 0.5 a max of 5 and a step of 0.5 - this is used to adjust the cooling temperature quickly and avoid the thermostat/AC from flapping
## This blueprint is still a work in progress
input:
frequency:
name: Frequency
description: how often to check sensor status? 1, 5 or 10 minues
selector:
select:
options:
- /1
- /5
- /10
cool_tolerance_helper:
name: Tolerance for cooling
description: Precision for heating target, when heating it will cause the thermostat to stop short of target temperature by this value. If target temp is 20 and this is set to 1 it will heat to 19.
default: {}
selector:
entity:
heat_tolerance_helper:
name: Tolerance for heating
description: Precision for cooling target, when cooling it will cause the thermostat to stop short of target temperature by this value. If target temp is 20 and this is set to 1 it will cool to 21.
default: {}
selector:
entity:
temp_current_sensor:
name: Current Temp Sensor
description: will be updated to display the current temp sensor
default: {}
selector:
entity:
temp_current_temp:
name: Current Temperature
description: will be updated to display the current temperature when the automation last ran
default: {}
selector:
entity:
temp_target_temp:
name: Current Temp Target
description: will be updated to display the temperature target
default: {}
selector:
entity:
low_setpoint:
name: low setpoint
description: Low Setpoint - the lowest value to which it will allow temperature to drop - suggest value 15
selector:
number:
min: 10
max: 25
step: 1
unit_of_measurement: "°C"
high_setpoint:
name: high setpoint
description: High Setpoint - the highest value to which it will allow temperature to rise - suggested value 30
selector:
number:
min: 15
max: 35
step: 1
unit_of_measurement: "°C"
thermostat:
name: Thermostat
description: Select the Thermostat
selector:
entity:
domain: climate
error_boolean_helper:
name: error_boolean_helper
description: Select the error testing helper
selector:
entity:
time_1:
name: M-F first time
description: first time interval of the day on Monday to Friday
selector:
time:
target_temp_1:
name: M-F first target temperature
description: the thermostat will heat to target sensor 1 temp minus heat tolerance setting , or cool to sensor 1 temp plus cool tolerance setting on Monday to Friday
selector:
number:
min: 15
max: 30
step: 0.5
unit_of_measurement: "°C"
sensor_1:
name: M-F first sensor
description: first sensor to use for temperature on Monday to Friday
selector:
entity:
domain: sensor
device_class: temperature
time_2:
name: M-F second time
description: second time interval of the day on Monday to Friday
selector:
time:
target_temp_2:
name: M-F second target temperature
description: the thermostat will heat to target sensor 2 temp minus heat tolerance setting , or cool to sensor 2 temp plus cool tolerance setting on Monday to Friday
selector:
number:
min: 15
max: 30
step: 0.5
unit_of_measurement: "°C"
sensor_2:
name: M-F second sensor
description: second sensor to use for temperature on Monday to Friday
selector:
entity:
domain: sensor
device_class: temperature
time_3:
name: M-F third time
description: third time interval of the day on Monday to Friday
selector:
time:
target_temp_3:
name: M-F third target temperature
description: the thermostat will heat to target sensor 3 temp minus heat tolerance setting, or cool to sensor 3 temp plus cool tolerance setting on Monday to Friday
selector:
number:
min: 15
max: 30
step: 0.5
unit_of_measurement: "°C"
sensor_3:
name: M-F third sensor
description: third sensor to use for temperature on Monday to Friday
selector:
entity:
domain: sensor
device_class: temperature
time_4:
name: M-F fourth time
description: fourth time interval of the day on Monday to Friday
selector:
time:
target_temp_4:
name: M-F fourth target temperature
description: the thermostat will heat to target sensor 4 temp minus heat tolerance setting, or cool to sensor 4 temp plus cool tolerance setting on Monday to Friday
selector:
number:
min: 15
max: 30
step: 0.5
unit_of_measurement: "°C"
sensor_4:
name: M-F fourth sensor
description: fourth sensor to use for temperature on Monday to Friday
selector:
entity:
domain: sensor
device_class: temperature
time_1_ss:
name: S-S first time
description: first time interval of the day on Saturday and Sunday
selector:
time:
target_temp_1_ss:
name: S-S first target temperature
description: the thermostat will heat to target sensor 1 temp minus heat tolerance setting, or cool to sensor 1 temp plus cool tolerance setting on Saturday and Sunday
selector:
number:
min: 15
max: 30
step: 0.5
unit_of_measurement: "°C"
sensor_1_ss:
name: S-S first sensor
description: first sensor to use for temperature on Saturday and Sunday
selector:
entity:
domain: sensor
device_class: temperature
time_2_ss:
name: S-S second time
description: second time interval of the day on Saturday and Sunday
selector:
time:
target_temp_2_ss:
name: S-S second target temperature
description: the thermostat will heat to target sensor 2 temp minus heat tolerance setting, or cool to sensor 2 temp plus cool tolerance setting on Saturday and Sunday
selector:
number:
min: 15
max: 30
step: 0.5
unit_of_measurement: "°C"
sensor_2_ss:
name: S-S second sensor
description: second sensor to use for temperature on Saturday and Sunday
selector:
entity:
domain: sensor
device_class: temperature
time_3_ss:
name: S-S third time
description: third time interval of the day on Saturday and Sunday
selector:
time:
target_temp_3_ss:
name: S-S third target temperature
description: the thermostat will heat to target sensor 3 temp minus heat tolerance setting, or cool to sensor 3 temp plus cool tolerance setting on Saturday and Sunday
selector:
number:
min: 15
max: 30
step: 0.5
unit_of_measurement: "°C"
sensor_3_ss:
name: S-S third sensor
description: third sensor to use for temperature on Saturday and Sunday
selector:
entity:
domain: sensor
device_class: temperature
time_4_ss:
name: S-S fourth time
description: fourth time interval of the day on Saturday and Sunday
selector:
time:
target_temp_4_ss:
name: S-S fourth target temperature
description: the thermostat will heat to target sensor 4 temp minus heat tolerance setting, or cool to sensor 4 temp plus cool tolerance setting on Saturday and Sunday
selector:
number:
min: 15
max: 30
step: 0.5
unit_of_measurement: "°C"
sensor_4_ss:
name: S-S fourth sensor
description: fourth sensor to use for temperature on Saturday and Sunday
selector:
entity:
domain: sensor
device_class: temperature
variables:
cool_tolerance_helper: !input cool_tolerance_helper
cool_tolerance_helper_value: "{{ states(cool_tolerance_helper) | float }}"
heat_tolerance_helper: !input heat_tolerance_helper
heat_tolerance_helper_value: "{{ states(heat_tolerance_helper) | float }}"
temp_current_temp: !input temp_current_temp
temp_target_temp: !input temp_target_temp
sensor_1: !input sensor_1
sensor_2: !input sensor_2
sensor_3: !input sensor_3
sensor_4: !input sensor_4
sensor_1_ss: !input sensor_1_ss
sensor_2_ss: !input sensor_2_ss
sensor_3_ss: !input sensor_3_ss
sensor_4_ss: !input sensor_4_ss
target_temp_1: !input target_temp_1
target_temp_2: !input target_temp_2
target_temp_3: !input target_temp_3
target_temp_4: !input target_temp_4
target_temp_1_ss: !input target_temp_1_ss
target_temp_2_ss: !input target_temp_2_ss
target_temp_3_ss: !input target_temp_3_ss
target_temp_4_ss: !input target_temp_4_ss
actual_temp_1: "{{ states(sensor_1) | float(20) }}"
actual_temp_2: "{{ states(sensor_2) | float(20) }}"
actual_temp_3: "{{ states(sensor_3) | float(20) }}"
actual_temp_4: "{{ states(sensor_4) | float(20) }}"
actual_temp_1_ss: "{{ states(sensor_1_ss) | float(20) }}"
actual_temp_2_ss: "{{ states(sensor_2_ss) | float(20) }}"
actual_temp_3_ss: "{{ states(sensor_3_ss) | float(20) }}"
actual_temp_4_ss: "{{ states(sensor_4_ss) | float(20) }}"
heat_1: "{{ (target_temp_1 - heat_tolerance) - actual_temp_1 }}"
heat_2: "{{ (target_temp_2 - heat_tolerance) - actual_temp_2 }}"
heat_3: "{{ (target_temp_3 - heat_tolerance) - actual_temp_3 }}"
heat_4: "{{ (target_temp_4 - heat_tolerance) - actual_temp_4 }}"
heat_temp_1: "{{ heat_1 | round(2) }}"
heat_temp_2: "{{ heat_2 | round(2) }}"
heat_temp_3: "{{ heat_3 | round(2) }}"
heat_temp_4: "{{ heat_4 | round(2) }}"
cool_1: "{{ (target_temp_1 + cool_tolerance) - actual_temp_1 }}"
cool_2: "{{ (target_temp_2 + cool_tolerance) - actual_temp_2 }}"
cool_3: "{{ (target_temp_3 + cool_tolerance) - actual_temp_3 }}"
cool_4: "{{ (target_temp_4 + cool_tolerance) - actual_temp_4}}"
cool_temp_1: "{{ cool_1 | round(2) }}"
cool_temp_2: "{{ cool_2 | round(2) }}"
cool_temp_3: "{{ cool_3 | round(2) }}"
cool_temp_4: "{{ cool_4 | round(2) }}"
error_boolean_helper: !input error_boolean_helper
time_1: !input time_1
time_2: !input time_2
time_3: !input time_3
time_4: !input time_4
heat_1_ss: "{{ (target_temp_1_ss - heat_tolerance) - actual_temp_1_ss }}"
heat_2_ss: "{{ (target_temp_2_ss - heat_tolerance) - actual_temp_2_ss }}"
heat_3_ss: "{{ (target_temp_3_ss - heat_tolerance) - actual_temp_3_ss }}"
heat_4_ss: "{{ (target_temp_4_ss - heat_tolerance) - actual_temp_4_ss }}"
heat_temp_1_ss: "{{ heat_1_ss | round(2) }}"
heat_temp_2_ss: "{{ heat_2_ss | round(2) }}"
heat_temp_3_ss: "{{ heat_3_ss | round(2) }}"
heat_temp_4_ss: "{{ heat_4_ss | round(2) }}"
cool_1_ss: "{{ (target_temp_1_ss + cool_tolerance) - actual_temp_1_ss }}"
cool_2_ss: "{{ (target_temp_2_ss + cool_tolerance) - actual_temp_2_ss }}"
cool_3_ss: "{{ (target_temp_3_ss + cool_tolerance) - actual_temp_3_ss }}"
cool_4_ss: "{{ (target_temp_4_ss + cool_tolerance) - actual_temp_4_ss }}"
cool_temp_1_ss: "{{ cool_1_ss | round(2) }}"
cool_temp_2_ss: "{{ cool_2_ss | round(2) }}"
cool_temp_3_ss: "{{ cool_3_ss | round(2) }}"
cool_temp_4_ss: "{{ cool_4_ss | round(2) }}"
time_1_ss: !input time_1_ss
time_2_ss: !input time_2_ss
time_3_ss: !input time_3_ss
time_4_ss: !input time_4_ss
high_setpoint: !input high_setpoint
low_setpoint: !input low_setpoint
heat_low_setpoint: "{{ high_setpoint - 2 }}"
cool_high_setpoint: "{{ low_setpoint + 2 }}"
trigger:
- platform: time_pattern
minutes: !input frequency
- platform: state
entity_id:
- !input cool_tolerance_helper
- !input heat_tolerance_helper
action:
- service: system_log.write
data:
message: >
heat_tolerance: {{ heat_tolerance }}, cool_tolerance: {{ cool_tolerance }},{{"\n"}}
heat_tolerance_helper: {{ heat_tolerance_helper }}, cool_tolerance_helper: {{ cool_tolerance_helper }},{{"\n"}}
heat_tolerance_helper_value: {{ heat_tolerance_helper_value }}, cool_tolerance_helper_value: {{ cool_tolerance_helper_value }},{{"\n"}}
heat calculations: ((target_temp_# - heat_tolerance) - actual_temp_#),{{"\n"}}
cool calculations: ((target_temp_# + cool_tolerance) - actual_temp_#),{{"\n"}}
sensor_1: {{ sensor_1 }},{{"\n"}}
target_temp_1: {{ target_temp_1 }}, actual_temp_1: {{ actual_temp_1 }}, heat_temp_1: {{ heat_temp_1 }}, cool_temp_1: {{ cool_temp_1 }},{{"\n"}}
time_1: {{ time_1 }}, time_2: {{ time_2 }},{{"\n"}}
sensor_1_ss: {{ sensor_1_ss }},{{"\n"}}
target_temp_1_ss: {{ target_temp_1_ss }}, actual_temp_1_ss: {{ actual_temp_1_ss }}, heat_temp_1_ss: {{ heat_temp_1_ss }}, cool_temp_1_ss: {{ cool_temp_1_ss }},{{"\n"}}
time_1_ss: {{ time_1_ss }}, time_2_ss: {{ time_2_ss }},{{"\n"}}
MF time check: {{ ((now().strftime('%H:%M:%S') >= time_1 ) and (now().strftime('%H:%M:%S') < time_2 )) }}, day check: {{ (now().weekday() < 5 ) }}, temp check: {{ (heat_temp_1 > 0 ) }}, time day check: {{ (((now().strftime('%H:%M:%S') >= time_1 ) and (now().strftime('%H:%M:%S') < time_2 )) and (now().weekday() < 5 )) }}, time day temp check: {{ ((((now().strftime('%H:%M:%S') >= time_1 ) and (now().strftime('%H:%M:%S') < time_2 )) and (now().weekday() < 5 )) and (heat_temp_1 > 0 )) }},{{"\n"}}
SS time check: {{ ((now().strftime('%H:%M:%S') >= time_1_ss) and (now().strftime('%H:%M:%S') < time_2_ss)) }}, day check: {{ (now().weekday() >= 5) }}, temp check: {{ (heat_temp_1_ss > 0) }}, time day check: {{ (((now().strftime('%H:%M:%S') >= time_1_ss) and (now().strftime('%H:%M:%S') < time_2_ss)) and (now().weekday() >= 5)) }}, time day temp check: {{ ((((now().strftime('%H:%M:%S') >= time_1_ss) and (now().strftime('%H:%M:%S') < time_2_ss)) and (now().weekday() >= 5)) and (heat_temp_1_ss > 0)) }},{{"\n"}}
MF time check: {{ ((now().strftime('%H:%M:%S') >= time_1 ) and (now().strftime('%H:%M:%S') < time_2 )) }}, day check: {{ (now().weekday() < 5 ) }}, temp check: {{ (cool_temp_1 < 0 ) }}, time day check: {{ (((now().strftime('%H:%M:%S') >= time_1 ) and (now().strftime('%H:%M:%S') < time_2 )) and (now().weekday() < 5 )) }}, time day temp check: {{ ((((now().strftime('%H:%M:%S') >= time_1 ) and (now().strftime('%H:%M:%S') < time_2 )) and (now().weekday() < 5 )) and (cool_temp_1 < 0 )) }},{{"\n"}}
SS time check: {{ ((now().strftime('%H:%M:%S') >= time_1_ss) and (now().strftime('%H:%M:%S') < time_2_ss)) }}, day check: {{ (now().weekday() >= 5) }}, temp check: {{ (cool_temp_1_ss < 0) }}, time day check: {{ (((now().strftime('%H:%M:%S') >= time_1_ss) and (now().strftime('%H:%M:%S') < time_2_ss)) and (now().weekday() >= 5)) }}, time day temp check: {{ ((((now().strftime('%H:%M:%S') >= time_1_ss) and (now().strftime('%H:%M:%S') < time_2_ss)) and (now().weekday() >= 5)) and (cool_temp_1_ss < 0)) }},{{"\n"}}
level: debug
logger: blueprints.briodan.thermostat
- service: system_log.write
data:
message: >
heat_tolerance: {{ heat_tolerance }}, cool_tolerance: {{ cool_tolerance }},{{"\n"}}
heat_tolerance_helper: {{ heat_tolerance_helper }}, cool_tolerance_helper: {{ cool_tolerance_helper }},{{"\n"}}
heat_tolerance_helper_value: {{ heat_tolerance_helper_value }}, cool_tolerance_helper_value: {{ cool_tolerance_helper_value }},{{"\n"}}
heat calculations: ((target_temp_# - heat_tolerance) - actual_temp_#),{{"\n"}}
cool calculations: ((target_temp_# + cool_tolerance) - actual_temp_#),{{"\n"}}
sensor_2: {{ sensor_2 }},{{"\n"}}
target_temp_2: {{ target_temp_2 }}, actual_temp_2: {{ actual_temp_2 }}, heat_temp_2: {{ heat_temp_2 }}, cool_temp_2: {{ cool_temp_2 }},{{"\n"}}
time_2: {{ time_2 }}, time_3: {{ time_3 }},{{"\n"}}
sensor_2_ss: {{ sensor_2_ss }},{{"\n"}}
target_temp_2_ss: {{ target_temp_2_ss }}, actual_temp_2_ss: {{ actual_temp_2_ss }}, heat_temp_2_ss: {{ heat_temp_2_ss }}, cool_temp_2_ss: {{ cool_temp_2_ss }},{{"\n"}}
time_2_ss: {{ time_2_ss }}, time_3_ss: {{ time_3_ss }},{{"\n"}}
MF time check: {{ ((now().strftime('%H:%M:%S') >= time_2 ) and (now().strftime('%H:%M:%S') < time_3 )) }}, day check: {{ (now().weekday() < 5 ) }}, temp check: {{ (heat_temp_2 > 0 ) }}, time day check: {{ (((now().strftime('%H:%M:%S') >= time_2 ) and (now().strftime('%H:%M:%S') < time_3 )) and (now().weekday() < 5 )) }}, time day temp check: {{ ((((now().strftime('%H:%M:%S') >= time_2 ) and (now().strftime('%H:%M:%S') < time_3 )) and (now().weekday() < 5 )) and (heat_temp_2 > 0 )) }},{{"\n"}}
SS time check: {{ ((now().strftime('%H:%M:%S') >= time_2_ss) and (now().strftime('%H:%M:%S') < time_3_ss)) }}, day check: {{ (now().weekday() >= 5) }}, temp check: {{ (heat_temp_2_ss > 0) }}, time day check: {{ (((now().strftime('%H:%M:%S') >= time_2_ss) and (now().strftime('%H:%M:%S') < time_3_ss)) and (now().weekday() >= 5)) }}, time day temp check: {{ ((((now().strftime('%H:%M:%S') >= time_2_ss) and (now().strftime('%H:%M:%S') < time_3_ss)) and (now().weekday() >= 5)) and (heat_temp_2_ss > 0)) }},{{"\n"}}
MF time check: {{ ((now().strftime('%H:%M:%S') >= time_2 ) and (now().strftime('%H:%M:%S') < time_3 )) }}, day check: {{ (now().weekday() < 5 ) }}, temp check: {{ (cool_temp_2 < 0 ) }}, time day check: {{ (((now().strftime('%H:%M:%S') >= time_2 ) and (now().strftime('%H:%M:%S') < time_3 )) and (now().weekday() < 5 )) }}, time day temp check: {{ ((((now().strftime('%H:%M:%S') >= time_2 ) and (now().strftime('%H:%M:%S') < time_3 )) and (now().weekday() < 5 )) and (cool_temp_2 < 0 )) }},{{"\n"}}
SS time check: {{ ((now().strftime('%H:%M:%S') >= time_2_ss) and (now().strftime('%H:%M:%S') < time_3_ss)) }}, day check: {{ (now().weekday() >= 5) }}, temp check: {{ (cool_temp_2_ss < 0) }}, time day check: {{ (((now().strftime('%H:%M:%S') >= time_2_ss) and (now().strftime('%H:%M:%S') < time_3_ss)) and (now().weekday() >= 5)) }}, time day temp check: {{ ((((now().strftime('%H:%M:%S') >= time_2_ss) and (now().strftime('%H:%M:%S') < time_3_ss)) and (now().weekday() >= 5)) and (cool_temp_2_ss < 0)) }},{{"\n"}}
level: debug
logger: blueprints.briodan.thermostat
- service: system_log.write
data:
message: >
heat_tolerance: {{ heat_tolerance }}, cool_tolerance: {{ cool_tolerance }},{{"\n"}}
heat_tolerance_helper: {{ heat_tolerance_helper }}, cool_tolerance_helper: {{ cool_tolerance_helper }},{{"\n"}}
heat_tolerance_helper_value: {{ heat_tolerance_helper_value }}, cool_tolerance_helper_value: {{ cool_tolerance_helper_value }},{{"\n"}}
heat calculations: ((target_temp_# - heat_tolerance) - actual_temp_#),{{"\n"}}
cool calculations: ((target_temp_# + cool_tolerance) - actual_temp_#),{{"\n"}}
sensor_3: {{ sensor_3 }},{{"\n"}}
target_temp_3: {{ target_temp_3 }}, actual_temp_3: {{ actual_temp_3 }}, heat_temp_3: {{ heat_temp_3 }}, cool_temp_3: {{ cool_temp_3 }},{{"\n"}}
time_3: {{ time_3 }}, time_4: {{ time_4 }},{{"\n"}}
sensor_3_ss: {{ sensor_3_ss }},{{"\n"}}
target_temp_3_ss: {{ target_temp_3_ss }}, actual_temp_3_ss: {{ actual_temp_3_ss }}, heat_temp_3_ss: {{ heat_temp_3_ss }}, cool_temp_3_ss: {{ cool_temp_3_ss }},{{"\n"}}
time_3_ss: {{ time_3_ss }}, time_4_ss: {{ time_4_ss }},{{"\n"}}
MF time check: {{ ((now().strftime('%H:%M:%S') >= time_3 ) and (now().strftime('%H:%M:%S') < time_4 )) }}, day check: {{ (now().weekday() < 5 ) }}, temp check: {{ (heat_temp_3 > 0 ) }}, time day check: {{ (((now().strftime('%H:%M:%S') >= time_3 ) and (now().strftime('%H:%M:%S') < time_4 )) and (now().weekday() < 5 )) }}, time day temp check: {{ ((((now().strftime('%H:%M:%S') >= time_3 ) and (now().strftime('%H:%M:%S') < time_4 )) and (now().weekday() < 5 )) and (heat_temp_3 > 0 )) }},{{"\n"}}
SS time check: {{ ((now().strftime('%H:%M:%S') >= time_3_ss) and (now().strftime('%H:%M:%S') < time_4_ss)) }}, day check: {{ (now().weekday() >= 5) }}, temp check: {{ (heat_temp_3_ss > 0) }}, time day check: {{ (((now().strftime('%H:%M:%S') >= time_3_ss) and (now().strftime('%H:%M:%S') < time_4_ss)) and (now().weekday() >= 5)) }}, time day temp check: {{ ((((now().strftime('%H:%M:%S') >= time_3_ss) and (now().strftime('%H:%M:%S') < time_4_ss)) and (now().weekday() >= 5)) and (heat_temp_3_ss > 0)) }},{{"\n"}}
MF time check: {{ ((now().strftime('%H:%M:%S') >= time_3 ) and (now().strftime('%H:%M:%S') < time_4 )) }}, day check: {{ (now().weekday() < 5 ) }}, temp check: {{ (cool_temp_3 < 0 ) }}, time day check: {{ (((now().strftime('%H:%M:%S') >= time_3 ) and (now().strftime('%H:%M:%S') < time_4 )) and (now().weekday() < 5 )) }}, time day temp check: {{ ((((now().strftime('%H:%M:%S') >= time_3 ) and (now().strftime('%H:%M:%S') < time_4 )) and (now().weekday() < 5 )) and (cool_temp_3 < 0 )) }},{{"\n"}}
SS time check: {{ ((now().strftime('%H:%M:%S') >= time_3_ss) and (now().strftime('%H:%M:%S') < time_4_ss)) }}, day check: {{ (now().weekday() >= 5) }}, temp check: {{ (cool_temp_3_ss < 0) }}, time day check: {{ (((now().strftime('%H:%M:%S') >= time_3_ss) and (now().strftime('%H:%M:%S') < time_4_ss)) and (now().weekday() >= 5)) }}, time day temp check: {{ ((((now().strftime('%H:%M:%S') >= time_3_ss) and (now().strftime('%H:%M:%S') < time_4_ss)) and (now().weekday() >= 5)) and (cool_temp_3_ss < 0)) }},{{"\n"}}
level: debug
logger: blueprints.briodan.thermostat
- service: system_log.write
data:
message: >
heat_tolerance: {{ heat_tolerance }}, cool_tolerance: {{ cool_tolerance }},{{"\n"}}
heat_tolerance_helper: {{ heat_tolerance_helper }}, cool_tolerance_helper: {{ cool_tolerance_helper }},{{"\n"}}
heat_tolerance_helper_value: {{ heat_tolerance_helper_value }}, cool_tolerance_helper_value: {{ cool_tolerance_helper_value }},{{"\n"}}
heat calculations: ((target_temp_# - heat_tolerance) - actual_temp_#),{{"\n"}}
cool calculations: ((target_temp_# + cool_tolerance) - actual_temp_#),{{"\n"}}
sensor_4: {{ sensor_4 }},{{"\n"}}
target_temp_4: {{ target_temp_4 }}, actual_temp_4: {{ actual_temp_4 }}, heat_temp_4: {{ heat_temp_4 }}, cool_temp_4: {{ cool_temp_4 }},{{"\n"}}
time_4: {{ time_4 }}, time_1: {{ time_1 }},{{"\n"}}
sensor_4_ss: {{ sensor_4_ss }},{{"\n"}}
target_temp_4_ss: {{ target_temp_4_ss }}, actual_temp_4_ss: {{ actual_temp_4_ss }}, heat_temp_4_ss: {{ heat_temp_4_ss }}, cool_temp_4_ss: {{ cool_temp_4_ss }},{{"\n"}}
time_4_ss: {{ time_4_ss }}, time_1_ss: {{ time_1_ss }},{{"\n"}}
MF time check: {{ ((now().strftime('%H:%M:%S') >= time_4 ) or (now().strftime('%H:%M:%S') < time_1 )) }}, day check: {{ (now().weekday() < 5 ) }}, temp check: {{ (heat_temp_4 > 0 ) }}, time day check: {{ (((now().strftime('%H:%M:%S') >= time_4 ) or (now().strftime('%H:%M:%S') < time_1 )) and (now().weekday() < 5 )) }}, time day temp check: {{ ((((now().strftime('%H:%M:%S') >= time_4 ) or (now().strftime('%H:%M:%S') < time_1 )) and (now().weekday() < 5 )) and (heat_temp_4 > 0 )) }},{{"\n"}}
SS time check: {{ ((now().strftime('%H:%M:%S') >= time_4_ss) or (now().strftime('%H:%M:%S') < time_1_ss)) }}, day check: {{ (now().weekday() >= 5) }}, temp check: {{ (heat_temp_4_ss > 0) }}, time day check: {{ (((now().strftime('%H:%M:%S') >= time_4_ss) or (now().strftime('%H:%M:%S') < time_1_ss)) and (now().weekday() >= 5)) }}, time day temp check: {{ ((((now().strftime('%H:%M:%S') >= time_4_ss) or (now().strftime('%H:%M:%S') < time_1_ss)) and (now().weekday() >= 5)) and (heat_temp_4_ss > 0)) }},{{"\n"}}
MF time check: {{ ((now().strftime('%H:%M:%S') >= time_4 ) or (now().strftime('%H:%M:%S') < time_1 )) }}, day check: {{ (now().weekday() < 5 ) }}, temp check: {{ (cool_temp_4 < 0 ) }}, time day check: {{ (((now().strftime('%H:%M:%S') >= time_4 ) or (now().strftime('%H:%M:%S') < time_1 )) and (now().weekday() < 5 )) }}, time day temp check: {{ ((((now().strftime('%H:%M:%S') >= time_4 ) or (now().strftime('%H:%M:%S') < time_1 )) and (now().weekday() < 5 )) and (cool_temp_4 < 0 )) }},{{"\n"}}
SS time check: {{ ((now().strftime('%H:%M:%S') >= time_4_ss) or (now().strftime('%H:%M:%S') < time_1_ss)) }}, day check: {{ (now().weekday() >= 5) }}, temp check: {{ (cool_temp_4_ss < 0) }}, time day check: {{ (((now().strftime('%H:%M:%S') >= time_4_ss) or (now().strftime('%H:%M:%S') < time_1_ss)) and (now().weekday() >= 5)) }}, time day temp check: {{ ((((now().strftime('%H:%M:%S') >= time_4_ss) or (now().strftime('%H:%M:%S') < time_1_ss)) and (now().weekday() >= 5)) and (cool_temp_4_ss < 0)) }},{{"\n"}}
level: debug
logger: blueprints.briodan.thermostat
- choose:
- conditions:
- alias: Wake heat
condition: template
value_template: >-
{{ ((((now().strftime('%H:%M:%S') >= time_1) and (now().strftime('%H:%M:%S') < time_2)) and (now().weekday() < 5)) and (heat_temp_1 > 0)) }}
sequence:
- service: input_select.select_option
target:
entity_id: !input error_boolean_helper
data:
option: heat
- service: climate.set_temperature
data:
target_temp_low: "{{ heat_low_setpoint }}"
target_temp_high: !input high_setpoint
target:
entity_id: !input thermostat
- conditions:
- alias: Wake heat SS
condition: template
value_template: >-
{{ ((((now().strftime('%H:%M:%S') >= time_1_ss) and (now().strftime('%H:%M:%S') < time_2_ss)) and (now().weekday() >= 5)) and (heat_temp_1_ss > 0)) }}
sequence:
- service: input_select.select_option
target:
entity_id: !input error_boolean_helper
data:
option: heat
- service: climate.set_temperature
data:
target_temp_low: "{{ heat_low_setpoint }}"
target_temp_high: !input high_setpoint
target:
entity_id: !input thermostat
- conditions:
- alias: morning heat
condition: template
value_template: >-
{{ ((((now().strftime('%H:%M:%S') >= time_2) and (now().strftime('%H:%M:%S') < time_3)) and (now().weekday() < 5)) and (heat_temp_2 > 0)) }}
sequence:
- service: input_select.select_option
target:
entity_id: !input error_boolean_helper
data:
option: heat
- service: climate.set_temperature
data:
target_temp_low: "{{ heat_low_setpoint }}"
target_temp_high: !input high_setpoint
target:
entity_id: !input thermostat
- conditions:
- alias: morning heat SS
condition: template
value_template: >-
{{ ((((now().strftime('%H:%M:%S') >= time_2_ss) and (now().strftime('%H:%M:%S') < time_3_ss)) and (now().weekday() >= 5)) and (heat_temp_2_ss > 0)) }}
sequence:
- service: input_select.select_option
target:
entity_id: !input error_boolean_helper
data:
option: heat
- service: climate.set_temperature
data:
target_temp_low: "{{ heat_low_setpoint }}"
target_temp_high: !input high_setpoint
target:
entity_id: !input thermostat
- conditions:
- alias: afternoon heat
condition: template
value_template: >-
{{ ((((now().strftime('%H:%M:%S') >= time_3) and (now().strftime('%H:%M:%S') < time_4)) and (now().weekday() < 5)) and (heat_temp_3 > 0)) }}
sequence:
- service: input_select.select_option
target:
entity_id: !input error_boolean_helper
data:
option: heat
- service: climate.set_temperature
data:
target_temp_low: "{{ heat_low_setpoint }}"
target_temp_high: !input high_setpoint
target:
entity_id: !input thermostat
- conditions:
- alias: afternoon heat SS
condition: template
value_template: >-
{{ ((((now().strftime('%H:%M:%S') >= time_3_ss) and (now().strftime('%H:%M:%S') < time_4_ss)) and (now().weekday() >= 5)) and (heat_temp_3_ss > 0)) }}
sequence:
- service: input_select.select_option
target:
entity_id: !input error_boolean_helper
data:
option: heat
- service: climate.set_temperature
data:
target_temp_low: "{{ heat_low_setpoint }}"
target_temp_high: !input high_setpoint
target:
entity_id: !input thermostat
- conditions:
- alias: evening heat
condition: template
value_template: >-
{{ ((((now().strftime('%H:%M:%S') >= time_4) or (now().strftime('%H:%M:%S') < time_1)) and (now().weekday() < 5)) and (heat_temp_4 > 0)) }}
sequence:
- service: input_select.select_option
target:
entity_id: !input error_boolean_helper
data:
option: heat
- service: climate.set_temperature
data:
target_temp_low: "{{ heat_low_setpoint }}"
target_temp_high: !input high_setpoint
target:
entity_id: !input thermostat
- conditions:
- alias: evening heat SS
condition: template
value_template: >-
{{ ((((now().strftime('%H:%M:%S') >= time_4_ss) or (now().strftime('%H:%M:%S') < time_1_ss)) and (now().weekday() >= 5)) and (heat_temp_4_ss > 0)) }}
sequence:
- service: input_select.select_option
target:
entity_id: !input error_boolean_helper
data:
option: heat
- service: climate.set_temperature
data:
target_temp_low: "{{ heat_low_setpoint }}"
target_temp_high: !input high_setpoint
target:
entity_id: !input thermostat
- conditions:
- alias: Wake cool
condition: template
value_template: >-
{{ ((((now().strftime('%H:%M:%S') >= time_1) and (now().strftime('%H:%M:%S') < time_2)) and (now().weekday() < 5)) and (cool_temp_1 < 0)) }}
sequence:
- service: input_select.select_option
target:
entity_id: !input error_boolean_helper
data:
option: cool
- service: climate.set_temperature
data:
target_temp_low: !input low_setpoint
target_temp_high: "{{ cool_high_setpoint }}"
target:
entity_id: !input thermostat
- conditions:
- alias: Wake cool SS
condition: template
value_template: >-
{{ ((((now().strftime('%H:%M:%S') >= time_1_ss) and (now().strftime('%H:%M:%S') < time_2_ss)) and (now().weekday() >= 5)) and (cool_temp_1_ss < 0)) }}
sequence:
- service: input_select.select_option
target:
entity_id: !input error_boolean_helper
data:
option: cool
- service: climate.set_temperature
data:
target_temp_low: !input low_setpoint
target_temp_high: "{{ cool_high_setpoint }}"
target:
entity_id: !input thermostat
- conditions:
- alias: morning cool
condition: template
value_template: >-
{{ ((((now().strftime('%H:%M:%S') >= time_2) and (now().strftime('%H:%M:%S') < time_3)) and (now().weekday() < 5)) and (cool_temp_2 < 0)) }}
sequence:
- service: input_select.select_option
target:
entity_id: !input error_boolean_helper
data:
option: cool
- service: climate.set_temperature
data:
target_temp_low: !input low_setpoint
target_temp_high: "{{ cool_high_setpoint }}"
target:
entity_id: !input thermostat
- conditions:
- alias: morning cool SS
condition: template
value_template: >-
{{ ((((now().strftime('%H:%M:%S') >= time_2_ss) and (now().strftime('%H:%M:%S') < time_3_ss)) and (now().weekday() >= 5)) and (cool_temp_2_ss < 0)) }}
sequence:
- service: input_select.select_option
target:
entity_id: !input error_boolean_helper
data:
option: cool
- service: climate.set_temperature
data:
target_temp_low: !input low_setpoint
target_temp_high: "{{ cool_high_setpoint }}"
target:
entity_id: !input thermostat
- conditions:
- alias: afternoon cool
condition: template
value_template: >-
{{ ((((now().strftime('%H:%M:%S') >= time_3) and (now().strftime('%H:%M:%S') < time_4)) and (now().weekday() < 5)) and (cool_temp_3 < 0)) }}
sequence:
- service: input_select.select_option
target:
entity_id: !input error_boolean_helper
data:
option: cool
- service: climate.set_temperature
data:
target_temp_low: !input low_setpoint
target_temp_high: "{{ cool_high_setpoint }}"
target:
entity_id: !input thermostat
- conditions:
- alias: afternoon cool SS
condition: template
value_template: >-
{{ ((((now().strftime('%H:%M:%S') >= time_3_ss) and (now().strftime('%H:%M:%S') < time_4_ss)) and (now().weekday() >= 5)) and (cool_temp_3_ss < 0)) }}
sequence:
- service: input_select.select_option
target:
entity_id: !input error_boolean_helper
data:
option: cool
- service: climate.set_temperature
data:
target_temp_low: !input low_setpoint
target_temp_high: "{{ cool_high_setpoint }}"
target:
entity_id: !input thermostat
- conditions:
- alias: evening cool
condition: template
value_template: >-
{{ ((((now().strftime('%H:%M:%S') >= time_4) or (now().strftime('%H:%M:%S') < time_1)) and (now().weekday() < 5)) and (cool_temp_4 < 0)) }}
sequence:
- service: input_select.select_option
target:
entity_id: !input error_boolean_helper
data:
option: cool
- service: climate.set_temperature
data:
target_temp_low: !input low_setpoint
target_temp_high: "{{ cool_high_setpoint }}"
target:
entity_id: !input thermostat
- conditions:
- alias: evening cool SS
condition: template
value_template: >-
{{ ((((now().strftime('%H:%M:%S') >= time_4_ss) or (now().strftime('%H:%M:%S') < time_1_ss)) and (now().weekday() >= 5)) and (cool_temp_4_ss < 0)) }}
sequence:
- service: input_select.select_option
target:
entity_id: !input error_boolean_helper
data:
option: cool
- service: climate.set_temperature
data:
target_temp_low: !input low_setpoint
target_temp_high: "{{ cool_high_setpoint }}"
target:
entity_id: !input thermostat
default:
- service: system_log.write
data:
message: >
no conditions matched
level: info
logger: blueprints.briodan.thermostat
- service: input_select.select_option
target:
entity_id: !input error_boolean_helper
data:
option: idle
- service: climate.set_temperature
data:
target_temp_low: !input low_setpoint
target_temp_high: !input high_setpoint
target:
entity_id: !input thermostat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment