From b8517462c25be0649c89191ba33a4e1b5604e711 Mon Sep 17 00:00:00 2001 From: Kyle Gordon Date: Sat, 26 Dec 2020 23:04:46 +0000 Subject: [PATCH 1/5] Some heating and hot water schedules --- packages/climate.yaml | 150 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 136 insertions(+), 14 deletions(-) diff --git a/packages/climate.yaml b/packages/climate.yaml index 4cd3e58a..9bc54841 100644 --- a/packages/climate.yaml +++ b/packages/climate.yaml @@ -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_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_temperature + - 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_temperature + - service: climate.set_preset_mode data: entity_id: climate.house - temperature: 12 \ No newline at end of file + 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 weekday)" + trigger: + - platform: time + at: "21:00:00" + condition: + - condition: state + entity_id: binary_sensor.workday_tomorrow + state: "on" + action: + - service: climate.set_preset_mode + data: + entity_id: climate.heating + temperature: 17 + - service: logbook.log + data_template: + name: EVENT + message: > + Setting heating low for sleeping + + - alias: "Climate - Sleep (tomorrow not weekday)" + trigger: + - platform: time + at: "23:00:00" + condition: + - condition: state + entity_id: binary_sensor.workday_tomorrow + state: "off" + action: + - service: climate.set_preset_mode + 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_preset_mode + data: + entity_id: climate.heating + temperature: 20 + - service: logbook.log + data_template: + name: EVENT + message: > + Warming the house up for the morning. \ No newline at end of file From 0b2522e1a42c317457518bc3fc74905f55095d1c Mon Sep 17 00:00:00 2001 From: Kyle Gordon Date: Mon, 28 Dec 2020 09:23:02 +0000 Subject: [PATCH 2/5] Use the right action --- packages/climate.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/climate.yaml b/packages/climate.yaml index 9bc54841..101faac0 100644 --- a/packages/climate.yaml +++ b/packages/climate.yaml @@ -99,7 +99,7 @@ automation: entity_id: binary_sensor.workday_tomorrow state: "on" action: - - service: climate.set_preset_mode + - service: climate.set_temperature data: entity_id: climate.heating temperature: 17 @@ -118,7 +118,7 @@ automation: entity_id: binary_sensor.workday_tomorrow state: "off" action: - - service: climate.set_preset_mode + - service: climate.set_temperature data: entity_id: climate.house temperature: 17 @@ -137,7 +137,7 @@ automation: entity_id: binary_sensor.workday_tomorrow state: "on" action: - - service: climate.set_preset_mode + - service: climate.set_temperature data: entity_id: climate.heating temperature: 20 From e700486c80d173cfede7fdbc70df4f1e1d4096ad Mon Sep 17 00:00:00 2001 From: Kyle Gordon Date: Mon, 28 Dec 2020 09:27:21 +0000 Subject: [PATCH 3/5] Use the right service --- packages/climate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/climate.yaml b/packages/climate.yaml index 101faac0..ea1bbecf 100644 --- a/packages/climate.yaml +++ b/packages/climate.yaml @@ -139,7 +139,7 @@ automation: action: - service: climate.set_temperature data: - entity_id: climate.heating + entity_id: climate.house temperature: 20 - service: logbook.log data_template: From fce90276888b8e6083d9a13bf30365cf1e6714d1 Mon Sep 17 00:00:00 2001 From: Kyle Gordon Date: Mon, 28 Dec 2020 09:27:44 +0000 Subject: [PATCH 4/5] Rename to workday --- packages/climate.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/climate.yaml b/packages/climate.yaml index ea1bbecf..0f7972e4 100644 --- a/packages/climate.yaml +++ b/packages/climate.yaml @@ -90,7 +90,7 @@ automation: Setting heating and hot water thermostat to normal mode - - alias: "Climate - Sleep (tomorrow weekday)" + - alias: "Climate - Sleep (tomorrow workday)" trigger: - platform: time at: "21:00:00" @@ -109,7 +109,7 @@ automation: message: > Setting heating low for sleeping - - alias: "Climate - Sleep (tomorrow not weekday)" + - alias: "Climate - Sleep (tomorrow not workday)" trigger: - platform: time at: "23:00:00" From f927f6ce9d269c9a67cfcad88fb8296691bab859 Mon Sep 17 00:00:00 2001 From: Kyle Gordon Date: Mon, 28 Dec 2020 09:30:08 +0000 Subject: [PATCH 5/5] Fix another one --- packages/climate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/climate.yaml b/packages/climate.yaml index 0f7972e4..59849442 100644 --- a/packages/climate.yaml +++ b/packages/climate.yaml @@ -101,7 +101,7 @@ automation: action: - service: climate.set_temperature data: - entity_id: climate.heating + entity_id: climate.house temperature: 17 - service: logbook.log data_template: