From db800d1f7823cdaab8af5ee806b9e98a1aab5283 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Sun, 27 Aug 2023 21:02:16 +0200 Subject: [PATCH] Fix AC automations --- configuration/automations/ac.yaml | 39 ++++++++++++++++++++++- configuration/automations/bedroom-ac.yaml | 2 +- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/configuration/automations/ac.yaml b/configuration/automations/ac.yaml index e342094..77ba2ac 100644 --- a/configuration/automations/ac.yaml +++ b/configuration/automations/ac.yaml @@ -35,9 +35,46 @@ - service: climate.set_temperature target: entity_id: climate.ac - data: + data_template: temperature: "{{ state_attr('climate.ac', 'temperature') -1 }} " +- id: ac_enable + alias: '[AC] Enable back AC when windows are closed' + trigger: + - platform: state + entity_id: binary_sensor.dining_window_1_open_close + to: 'off' + for: + minutes: 1 + - platform: state + entity_id: binary_sensor.dining_window_2_open_close + to: 'off' + for: + minutes: 1 + - platform: state + entity_id: binary_sensor.office_window_open_close + to: 'off' + for: + minutes: 1 + 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' + action: + - service: script.ac_on + - id: ac_turn_off alias: '[AC] Turn off when windows are open' mode: single diff --git a/configuration/automations/bedroom-ac.yaml b/configuration/automations/bedroom-ac.yaml index bed1519..6b7ed94 100644 --- a/configuration/automations/bedroom-ac.yaml +++ b/configuration/automations/bedroom-ac.yaml @@ -27,7 +27,7 @@ - service: climate.set_temperature target: entity_id: climate.ac - data: + data_template: temperature: "{{ state_attr('climate.ac', 'temperature') -1 }} " - id: bedroom_ac_turn_off