Skip to content

Commit

Permalink
Merge pull request #248 from kylegordon/climate-automation
Browse files Browse the repository at this point in the history
Heating and hot water schedules
  • Loading branch information
kylegordon committed Dec 28, 2020
2 parents 016e01d + f927f6c commit 44aa06a
Showing 1 changed file with 135 additions and 13 deletions.
148 changes: 135 additions & 13 deletions packages/climate.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,148 @@
# Inspired by https://github.com/downthedeck/hassio-config/blob/master/packages/klimaat.yaml
# Not all modes are supported, as above uses Toon integration
# https://www.home-assistant.io/integrations/generic_thermostat/
# Generic thermostat currently only supports 'heat', 'cool' and 'off'

sensor:
- platform: season
type: astronomical

binary_sensor:
- platform: workday
name: Workday
country: GB
- platform: workday
name: Workday tomorrow
country: GB
days_offset: 1

automation:
- alias: "Set home temperature"
- alias: "Climate - Away"
trigger:
- platform: state
entity_id: binary_sensor.home_occupied
from: "off"
to: "on"
entity_id: group.people
to: "not_home"
for:
minutes: 15
action:
- service: climate.set_temperature
- service: climate.set_preset_mode
data:
entity_id: climate.house
preset_mode: "away"
- service: climate.set_preset_mode
data:
entity_id: climate.hot_water
preset_mode: "away"
- service: logbook.log
data_template:
name: EVENT
message: >
Setting heating and hot water thermostat to away mode
- alias: "Climate - Comfort"
trigger:
- platform: time
at: "19:00:00"
condition:
- condition: state
entity_id: group.people
state: "home"
- condition: template
value_template: '{{ states("sensor.season") != "summer" }}'
action:
- service: climate.set_preset_mode
data:
entity_id: climate.house
temperature: 19.5
preset_mode: "none"
- service: climate.set_preset_mode
data:
entity_id: climate.hot_water
preset_mode: "none"
- service: logbook.log
data_template:
name: EVENT
message: >
Setting heating and hot water thermostat to normal mode
- alias: "Set away temperature"
- alias: "Climate - home"
trigger:
- platform: state
entity_id: binary_sensor.home_occupied
from: "on"
to: "off"
for:
minutes: 5
entity_id: group.people
to: "home"
condition:
- condition: template
value_template: '{{ states("sensor.season") != "summer" }}'
- condition: time
after: "14:00:00"
action:
- service: climate.set_preset_mode
data:
entity_id: climate.house
preset_mode: "none"
- service: climate.set_preset_mode
data:
entity_id: climate.hot_water
preset_mode: "none"
- service: logbook.log
data_template:
name: EVENT
message: >
Setting heating and hot water thermostat to normal mode
- alias: "Climate - Sleep (tomorrow workday)"
trigger:
- platform: time
at: "21:00:00"
condition:
- condition: state
entity_id: binary_sensor.workday_tomorrow
state: "on"
action:
- service: climate.set_temperature
data:
entity_id: climate.house
temperature: 17
- service: logbook.log
data_template:
name: EVENT
message: >
Setting heating low for sleeping
- alias: "Climate - Sleep (tomorrow not workday)"
trigger:
- platform: time
at: "23:00:00"
condition:
- condition: state
entity_id: binary_sensor.workday_tomorrow
state: "off"
action:
- service: climate.set_temperature
data:
entity_id: climate.house
temperature: 17
- service: logbook.log
data_template:
name: EVENT
message: >
Setting heating low for sleeping
- alias: "Climate - Morning"
trigger:
- platform: time
at: "07:00:00"
condition:
- condition: state
entity_id: binary_sensor.workday_tomorrow
state: "on"
action:
- service: climate.set_temperature
data:
entity_id: climate.house
temperature: 12
temperature: 20
- service: logbook.log
data_template:
name: EVENT
message: >
Warming the house up for the morning.

0 comments on commit 44aa06a

Please sign in to comment.