Compare commits

..

7 Commits

3 changed files with 610 additions and 574 deletions
+529 -544
View File
File diff suppressed because it is too large Load Diff
@@ -7,11 +7,23 @@ blueprint:
temp_threshold: temp_threshold:
name: Temperature Threshold to switch AC on name: Temperature Threshold to switch AC on
description: This threshold is the temperature above which AC must be switched on description: This threshold is the temperature above which AC must be switched on
default: 29 default: 29.0
selector: selector:
number: number:
min: 25 min: 25.0
max: 40 max: 40.0
step: 0.5
unit_of_measurement: celsius
temp_hist:
name: Temperature Histeresys from off to on
description: This gap is difference between on and off
default: 2.0
selector:
number:
min: 1.0
max: 4.0
step: 0.5
unit_of_measurement: celsius unit_of_measurement: celsius
climate_target: climate_target:
@@ -22,31 +34,40 @@ blueprint:
filter: filter:
- domain: climate - domain: climate
mode: single mode: restart
# Definiamo l'input come variabile per usarlo dentro i template dei trigger variables:
trigger_variables: target_AC: !input climate_target
target_temp: !input temp_threshold target_temp: !input temp_threshold
sensor_entity: !input climate_target target_hist: !input temp_hist
triggers: triggers:
# Si attiva quando la temperatura attuale del clima sale SOPRA la soglia impostata - trigger: state
- trigger: template entity_id: !input climate_target
value_template: "{{ state_attr(sensor_entity, 'current_temperature') | float(0) > target_temp | float(0) }}" attribute: current_temperature
id: AC_on
# Si attiva quando la temperatura attuale del clima scende SOTTO la soglia meno 2 gradi
- trigger: template
value_template: "{{ state_attr(sensor_entity, 'current_temperature') | float(0) < (target_temp | float(0) - 2) }}"
id: AC_off
conditions: [] conditions: []
actions: actions:
- choose: - choose:
# CONDITION 1: Turn AC ON & Adjust Fan
- conditions: - conditions:
- condition: trigger - condition: template
id: value_template: "{{ state_attr(target_AC, 'current_temperature') | float(0) >= target_temp }}"
- AC_on - condition: or
conditions:
- condition: state
entity_id: !input climate_target
state: "off"
- condition: state
entity_id: !input climate_target
state: "heat_cool"
- condition: state
entity_id: !input climate_target
state: "dry"
- condition: state
entity_id: !input climate_target
state: "fan_only"
sequence: sequence:
- action: climate.set_hvac_mode - action: climate.set_hvac_mode
target: target:
@@ -57,19 +78,31 @@ actions:
target: target:
entity_id: !input climate_target entity_id: !input climate_target
data: data:
fan_mode: Auto fan_mode: >-
{% set curr_temp = state_attr(target_AC, 'current_temperature') | float(0) -%}
{% set targ_temp = state_attr(target_AC, 'temperature') | float(0) -%}
{% set diff_temp = curr_temp - targ_temp -%}
{% if diff_temp >= 4.0 -%}
5
{% elif diff_temp >= 3.5 and diff_temp < 4.0 -%}
4
{% elif diff_temp >= 3.0 and diff_temp < 3.5 -%}
3
{% elif diff_temp >= 1.5 and diff_temp < 3.0 -%}
2
{% else -%}
Auto
{% endif %}
# CONDITION 2: Turn AC OFF (Hysteresis)
- conditions: - conditions:
- condition: trigger - condition: template
id: value_template: >-
- AC_off {{ state_attr(target_AC, 'current_temperature') | float(0) <= (target_temp | float(0) - target_hist | float(0)) }}
- condition: state
entity_id: !input climate_target
state: "cool"
sequence: sequence:
- action: climate.set_hvac_mode - action: climate.turn_off
target: target:
entity_id: !input climate_target entity_id: !input climate_target
data:
hvac_mode: "off"
- action: climate.set_fan_mode
target:
entity_id: !input climate_target
data:
fan_mode: Auto
+18
View File
@@ -4,6 +4,24 @@ default_config:
# packages directory # packages directory
homeassistant: homeassistant:
packages: !include_dir_named packages_dir packages: !include_dir_named packages_dir
# customize temperature steps
customize:
climate.mansarda:
target_temp_step: 0.5
climate.matrimoniale:
target_temp_step: 0.5
climate.soggiorno_1:
target_temp_step: 0.5
climate.camera_est:
target_temp_step: 0.5
climate.camera_ovest:
target_temp_step: 0.5
climate.soggiorno:
target_temp_step: 0.5
climate.salotto:
target_temp_step: 0.5
climate.studio_est:
target_temp_step: 0.5
# Load frontend themes from the themes folder # Load frontend themes from the themes folder
frontend: frontend: