diff --git a/configuration/automations/ac.yaml b/configuration/automations/ac.yaml index ee46b27..1bc7b63 100644 --- a/configuration/automations/ac.yaml +++ b/configuration/automations/ac.yaml @@ -48,7 +48,6 @@ target: entity_id: climate.ac - - 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 new file mode 100644 index 0000000..c2ddcf4 --- /dev/null +++ b/configuration/automations/bedroom-ac.yaml @@ -0,0 +1,75 @@ +- id: bedroom-ac-turn-on + alias: '[AC][Bedroom] Turn on AC when it is hot in bedroom' + mode: single + trigger: + - platform: numeric_state + entity_id: sensor.ble_temperature_bedroom_sensor_ble + above: '26' + for: + minutes: 15 + - platform: numeric_state + entity_id: sensor.bedroom_air_purifier_temperature + above: '26' + for: + minutes: 15 + condition: + - condition: state + entity_id: input_select.home_mode + state: Night + action: + - 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 + - service: climate.set_temperature + data: + temperature: 24 + hvac_mode: cool + target: + entity_id: climate.ac + +- id: bedroom-ac-turn-off + alias: '[AC][Bedroom] Turn off AC when it is cold in bedroom' + trigger: + - platform: numeric_state + entity_id: sensor.ble_temperature_bedroom_sensor_ble + below: '23' + for: + minutes: 15 + - platform: numeric_state + entity_id: sensor.bedroom_air_purifier_temperature + below: '26' + for: + minutes: 15 + condition: + - condition: state + entity_id: input_select.home_mode + state: Night + action: + - choose: + - conditions: + - condition: state + entity_id: climate.ac + attribute: temperature + state: '25' + sequence: + - service: climate.turn_off + target: + entity_id: climate.ac + default: + - service: climate.set_temperature + target: + entity_id: climate.ac + data: + temperature: "{{ state_attr('climate.ac', 'temperature') + 1 }} " diff --git a/scripts/10.modes.yaml b/scripts/10.modes.yaml index fcc284d..cfb900f 100644 --- a/scripts/10.modes.yaml +++ b/scripts/10.modes.yaml @@ -45,9 +45,15 @@ good_night: - service: lock.lock target: entity_id: lock.front_door_25f246fe_door_lock - - service: climate.turn_off - target: - entity_id: climate.ac + - choose: + - conditions: + - condition: numeric_state + entity_id: sensor.ble_temperature_bedroom_sensor_ble + below: '26' + sequence: + - service: climate.turn_off + target: + entity_id: climate.ac - service: switch.turn_on entity_id: switch.mute_doorbell - service: input_boolean.turn_off