From d33ef15efc90040473101fc981e44bf023e3fdbd Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Fri, 5 Aug 2022 00:30:08 +0200 Subject: [PATCH] Add autolowering of temperature on ac --- configuration/automations/ac.yaml | 34 ++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/configuration/automations/ac.yaml b/configuration/automations/ac.yaml index a387743..ee46b27 100644 --- a/configuration/automations/ac.yaml +++ b/configuration/automations/ac.yaml @@ -5,7 +5,7 @@ trigger: - platform: numeric_state entity_id: sensor.ble_temperature_computer_cave_sensor - above: '27' + above: '26' for: minutes: 1 condition: @@ -25,15 +25,29 @@ entity_id: binary_sensor.office_window_open_close state: 'off' action: - - service: climate.turn_on - target: - entity_id: climate.ac - - service: climate.set_temperature - data: - temperature: 25 - hvac_mode: cool - target: - entity_id: climate.ac + - choose: + - conditions: + - condition: state + entity_id: climate.ac + state: cool + sequence: + - service: climate.set_temperature + target: + entity_id: climate.ac + data: + temperature: "{{ state_attr('climate.ac', 'temperature') -1 }} " + default: + - service: climate.turn_on + target: + entity_id: climate.ac + data: {} + - service: climate.set_temperature + data: + temperature: 25 + hvac_mode: cool + target: + entity_id: climate.ac + - id: ac-turn-off alias: '[AC] Turn off when windows are open'