From 005a8c2aefaf48fcd4b51f2f77bec9102e5b2ca9 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Wed, 13 Sep 2023 23:32:52 +0200 Subject: [PATCH] Update ac automations precool home fix script for turning on AC --- configuration/automations/office-ac.yaml | 36 ++++++++++++++++++++++-- scripts/80.ac.yaml | 10 ++++--- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/configuration/automations/office-ac.yaml b/configuration/automations/office-ac.yaml index 77ba2ac..6fb73be 100644 --- a/configuration/automations/office-ac.yaml +++ b/configuration/automations/office-ac.yaml @@ -7,7 +7,7 @@ entity_id: sensor.office_sensor_temperature above: '26' for: - minutes: 1 + minutes: 5 condition: - condition: state entity_id: input_select.home_mode @@ -38,6 +38,37 @@ data_template: temperature: "{{ state_attr('climate.ac', 'temperature') -1 }} " +- id: ac_precool + alias: '[AC] Pre cool office' + trigger: + - platform: state + entity_id: input_select.home_mode + to: 'Day' + condition: + - condition: state + entity_id: input_select.home_mode + state: Day + - condition: state + entity_id: input_boolean.vacation_mode + state: 'off' + - condition: state + entity_id: binary_sensor.dining_window_1_open_close + state: 'off' + - condition: state + entity_id: binary_sensor.dining_window_2_open_close + state: 'off' + - condition: state + entity_id: binary_sensor.office_window_open_close + state: 'off' + - condition: template + value_template: "{{ state_attr('weather.home', 'forecast')[0].temperature > 24 }}" + - service: script.ac_on + - service: climate.set_temperature + target: + entity_id: climate.ac + data: + temperature: 24 + - id: ac_enable alias: '[AC] Enable back AC when windows are closed' trigger: @@ -73,7 +104,8 @@ entity_id: binary_sensor.office_window_open_close state: 'off' action: - - service: script.ac_on + - service: switch.turn_on + entity_id: switch.ac_power_outlet - id: ac_turn_off alias: '[AC] Turn off when windows are open' diff --git a/scripts/80.ac.yaml b/scripts/80.ac.yaml index 9380097..f81582e 100644 --- a/scripts/80.ac.yaml +++ b/scripts/80.ac.yaml @@ -26,12 +26,14 @@ ac_on: - service: switch.turn_on entity_id: switch.ac_power_outlet - repeat: - until: - - condition: state - entity_id: climate.ac - state: unavailable sequence: - delay: '0:00:30' + until: + - condition: not + conditions: + - condition: state + entity_id: climate.ac + state: unavailable - service: climate.turn_on target: entity_id: climate.ac