Files
home-assistant/packages/climate/climate.yaml
2022-08-18 15:17:28 -07:00

120 lines
3.1 KiB
YAML

# Climate Package
# -----------------------------------------------------------------------------
# Climate State Helpers
input_select:
climate_mode:
name: Climate Control Mode
options:
- Home
- Night
- Away
- 'Off'
- Manual
- Paused
template:
binary_sensor:
- name: HVAC Fan Running
state: >
{{ 'Running' in state_attr('climate.thermostat', 'fan_state') }}
# -----------------------------------------------------------------------------
# Climate Automations
automation:
# Automations for Open Windows/Doors
- alias: Pause HVAC when Doors/Windows Open
mode: queued
trigger:
- platform: state
entity_id: binary_sensor.all_doors
to: 'on'
for:
minutes: 5
- platform: state
entity_id: binary_sensor.all_windows
to: 'on'
for:
minutes: 5
condition: "{{ not is_state('input_select.climate_mode', 'Paused') }}"
action:
- service: scene.create
data:
scene_id: hvac_restore_state
snapshot_entities:
# See https://github.com/home-assistant/core/issues/69925
# - climate.thermostat
- input_select.climate_mode
- service: climate.set_hvac_mode
target:
entity_id: climate.thermostat
data:
hvac_mode: "off"
- service: input_select.select_option
target:
entity_id: input_select.climate_mode
data:
option: Paused
- service: notify.telegram_home
data:
message: HVAC Paused (Window or Door Open)
- alias: Restore HVAC when Doors/Windows Closed
mode: queued
trigger:
- platform: state
entity_id: binary_sensor.all_doors
from: 'on'
to: 'off'
for:
minutes: 5
- platform: state
entity_id: binary_sensor.all_windows
from: 'on'
to: 'off'
for:
minutes: 5
condition: "{{ is_state('input_select.climate_mode', 'Paused') }}"
action:
- service: scene.turn_on
target:
entity_id: scene.hvac_restore_state
# See https://github.com/home-assistant/core/issues/69925
# Assume thermostat is always heat_cool when not off
- service: climate.set_hvac_mode
target:
entity_id: climate.thermostat
data:
hvac_mode: "{{ 'off' if is_state('input_select.climate_mode', 'Off') else 'heat_cool' }}"
- service: notify.telegram_home
data:
message: HVAC Restored (Window or Door Open)
- alias: Widen HVAC Range at Night
mode: queued
trigger:
- platform: time
at: "20:00"
action:
- service: climate.set_temperature
target:
entity_id: climate.thermostat
data:
target_temp_high: 76.0
target_temp_low: 68.0
- alias: Narrow HVAC Range during Day
mode: queued
trigger:
- platform: time
at: "10:00"
action:
- service: climate.set_temperature
target:
entity_id: climate.thermostat
data:
target_temp_high: 74.0
target_temp_low: 70.0