1
0
Fork 0
ha-config/config/packages/climate.yaml

172 lines
5.4 KiB
YAML

# TODO:
#
# * Turn on AC when: someone is home, weather outside is cold, and are out of bed or about to get out of bed
# - maybe can change the logic that manages the blinds using the sleep/wake logic to be backed by a schedule state that multiple things can key off?
automation:
- alias: "Keep Living Room AC ionizer on"
id: dfc2753d-9a70-4e77-adb0-c4a85f8f3406
trigger:
- platform: state
entity_id: climate.living_room_a_c
not_to:
- unavailable
- unknown
- "off"
not_from:
- unavailable
- unknown
- platform: state
entity_id: switch.living_room_a_c_jet_mode
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('climate.living_room_a_c', 'off') or 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 speed"
id: b09bd43d-4e5d-4ff3-84cb-3aaa8d878463
trigger:
- platform: state
entity_id: climate.living_room_a_c
not_to:
- unavailable
- unknown
- "off"
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: "{{ (states('sensor.area_temperature_degc_living_room') | float - state_attr('climate.living_room_a_c', 'temperature') | float) | abs }}"
condition: "{{ not (is_state('climate.living_room_a_c', 'off') or is_state('switch.living_room_a_c_jet_mode', 'on')) }}"
action:
- choose:
- conditions: |
{{ delta > 10 and not (
is_state('switch.living_room_a_c_jet_mode', 'unavailable') or
is_state('switch.living_room_a_c_jet_mode', 'unknown')
)
}}
sequence:
- if: "{{ not is_state('switch.living_room_a_c_jet_mode', 'on') }}"
then:
- service: switch.turn_on
target:
entity_id: switch.living_room_a_c_jet_mode
- conditions: "{{ delta > 5 }}"
sequence:
- if: "{{ not is_state_attr('climate.living_room_a_c', 'fan_mode', 'HIGH') }}"
then:
- service: climate.set_fan_mode
data:
fan_mode: HIGH
target:
entity_id: climate.living_room_a_c
default:
- if: "{{ not is_state_attr('climate.living_room_a_c', 'fan_mode', 'NATURE') }}"
then:
- 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
trigger:
- platform: state
entity_id: climate.living_room_a_c
not_to:
- unavailable
- unknown
- "off"
not_from:
- unavailable
- unknown
- 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:
- unavailable
- unknown
- "on"
condition: "{{ not is_state('switch.living_room_a_c_jet_mode', 'on') and not is_state('climate.living_room_a_c', 'off') }}"
action:
- service: scene.create
data:
scene_id: living_room_ac_state
snapshot_entities:
- switch.living_room_a_c_ionizer
- climate.living_room_a_c
- id: 7e0f6c8f-28ab-4342-96f9-a28a1fa8d580
alias: Restore AC state after Jet mode is off
trigger:
- platform: state
entity_id: switch.living_room_a_c_jet_mode
to: "off"
action:
- service: scene.turn_on
target:
entity_id: scene.living_room_ac_state