diff --git a/automations.yaml b/automations.yaml index deb16b0..6b970b1 100644 --- a/automations.yaml +++ b/automations.yaml @@ -741,3 +741,19 @@ data: fan_mode: Auto mode: single +- id: '1782056533736' + alias: Auto_AC_Mansarda + description: '' + use_blueprint: + path: homeassistant/auto_ac_control.yaml + input: + temp_threshold: 28 + climate_target: climate.mansarda +- id: '1782056620495' + alias: Auto_AC_SoggiornoP1 + description: '' + use_blueprint: + path: homeassistant/auto_ac_control.yaml + input: + temp_threshold: 27 + climate_target: climate.soggiorno_1 diff --git a/blueprints/automation/homeassistant/auto_ac_control.yaml b/blueprints/automation/homeassistant/auto_ac_control.yaml new file mode 100644 index 0000000..79a343a --- /dev/null +++ b/blueprints/automation/homeassistant/auto_ac_control.yaml @@ -0,0 +1,75 @@ +blueprint: + name: Auto AC Control + description: Auto Turn on Air Conditioning + domain: automation + author: Tiziano Trabattoni + input: + temp_threshold: + name: Temperature Threshold to switch AC on + description: This threshold is the temperature above which AC must be switched on + default: 29 + selector: + number: + min: 25 + max: 40 + unit_of_measurement: celsius + + climate_target: + name: Termostat Control + description: Identifies the AC climate to be controlled + selector: + entity: + filter: + - domain: climate + +mode: single + +# Definiamo l'input come variabile per usarlo dentro i template dei trigger +trigger_variables: + target_temp: !input temp_threshold + sensor_entity: !input climate_target + +triggers: + # Si attiva quando la temperatura attuale del clima sale SOPRA la soglia impostata + - trigger: template + value_template: "{{ state_attr(sensor_entity, 'current_temperature') | float(0) > target_temp | float(0) }}" + 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: [] + +actions: + - choose: + - conditions: + - condition: trigger + id: + - AC_on + sequence: + - action: climate.set_hvac_mode + target: + entity_id: !input climate_target + data: + hvac_mode: cool + - action: climate.set_fan_mode + target: + entity_id: !input climate_target + data: + fan_mode: Auto + - conditions: + - condition: trigger + id: + - AC_off + sequence: + - action: climate.set_hvac_mode + 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