diff --git a/config/packages/climate.yaml b/config/packages/climate.yaml index 65f67ca..7174c7c 100644 --- a/config/packages/climate.yaml +++ b/config/packages/climate.yaml @@ -20,11 +20,24 @@ automation: not_to: - unavailable - unknown + - platform: state + attribute: temperature + not_to: + - unavailable + - unknown + entity_id: climate.living_room_a_c + - platform: state + attribute: current_temperature + not_to: + - unavailable + - unknown + entity_id: climate.living_room_a_c + condition: "{{ not is_state('switch.living_room_a_c_ionizer', 'on') }}" action: - service: switch.turn_on entity_id: switch.living_room_a_c_ionizer - - alias: "Set Living Room AC fan to auto" + - alias: "Set Living Room AC fan speed" id: b09bd43d-4e5d-4ff3-84cb-3aaa8d878463 trigger: - platform: state @@ -36,19 +49,47 @@ automation: not_from: - unavailable - unknown + - platform: state + attribute: temperature + not_to: + - unavailable + - unknown + entity_id: climate.living_room_a_c + - platform: state + attribute: current_temperature + not_to: + - unavailable + - unknown + entity_id: climate.living_room_a_c - platform: state entity_id: switch.living_room_a_c_jet_mode not_to: - unavailable - unknown - "on" + variables: + delta: "{{ (state_attr('climate.living_room_a_c', 'current_temperature') - state_attr('climate.living_room_a_c', 'temperature')) | abs }}" condition: "{{ not is_state('switch.living_room_a_c_jet_mode', 'on') }}" action: - - service: climate.set_fan_mode - data: - fan_mode: NATURE - target: - entity_id: climate.living_room_a_c + - choose: + - conditions: "{{ delta > 10 and not (is_state('climate.living_room_a_c', 'unavailable') or is_state('climate.living_room_a_c', 'unknown')) }}" + sequence: + - service: switch.turn_on + target: + entity_id: switch.living_room_a_c_jet_mode + - conditions: "{{ delta > 5 }}" + sequence: + - service: climate.set_fan_mode + data: + fan_mode: HIGH + target: + entity_id: climate.living_room_a_c + default: + - service: climate.set_fan_mode + data: + fan_mode: NATURE + target: + entity_id: climate.living_room_a_c - alias: "Capture Living Room AC state" id: 15a75d0a-bc08-45c7-95d1-b16d02f6927a @@ -62,21 +103,36 @@ automation: not_from: - unavailable - unknown - - platform: numeric_state + - platform: state entity_id: climate.living_room_a_c attribute: temperature + not_to: + - unavailable + - unknown - platform: state entity_id: climate.living_room_a_c attribute: fan_mode + not_to: + - unavailable + - unknown - platform: state entity_id: climate.living_room_a_c attribute: swing_mode + not_to: + - unavailable + - unknown - platform: state entity_id: climate.living_room_a_c attribute: swing_mode_horizontal + not_to: + - unavailable + - unknown - platform: state entity_id: climate.living_room_a_c attribute: swing_mode_vertical + not_to: + - unavailable + - unknown - platform: state entity_id: switch.living_room_a_c_jet_mode not_to: