From a7f2c0de44a95e0771c87a51b70709ea108a0219 Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Fri, 11 Dec 2020 13:21:07 +0100 Subject: [PATCH] Added central heating management & netatmo automations --- .storage/lovelace | 29 +++++ .../away_mode_climate.yaml} | 42 ++----- packages/central_heating.yaml | 106 ++++++++++++++++++ packages/netatmo/netatmo_customizations.yaml | 2 +- ...tatmo_scripts.yaml => netatmo_engine.yaml} | 47 ++++++++ 5 files changed, 190 insertions(+), 36 deletions(-) rename packages/{netatmo/netatmo_automations.yaml => away_mode/away_mode_climate.yaml} (51%) create mode 100644 packages/central_heating.yaml rename packages/netatmo/{netatmo_scripts.yaml => netatmo_engine.yaml} (57%) diff --git a/.storage/lovelace b/.storage/lovelace index c841927f..ed6c350b 100644 --- a/.storage/lovelace +++ b/.storage/lovelace @@ -468,6 +468,9 @@ }, { "entity": "sensor.rear_balcony_humidity" + }, + { + "entity": "binary_sensor.central_heating" } ], "cards": [ @@ -597,6 +600,32 @@ "hours_to_show": 24, "refresh_interval": 0, "title": "Valvola Camera" + }, + { + "type": "entities", + "title": "Stato Valvole Netatmo", + "entities": [ + { + "entity": "sensor.valve_cucina_state", + "name": "Cucina" + }, + { + "entity": "sensor.valve_sala_state", + "name": "Sala" + }, + { + "entity": "sensor.valve_studio_state", + "name": "Studio" + }, + { + "entity": "sensor.valve_bagno_state", + "name": "Bagno" + }, + { + "entity": "sensor.valve_camera_da_letto_state", + "name": "Camera" + } + ] } ] }, diff --git a/packages/netatmo/netatmo_automations.yaml b/packages/away_mode/away_mode_climate.yaml similarity index 51% rename from packages/netatmo/netatmo_automations.yaml rename to packages/away_mode/away_mode_climate.yaml index 7be66aff..fc407e88 100644 --- a/packages/netatmo/netatmo_automations.yaml +++ b/packages/away_mode/away_mode_climate.yaml @@ -1,14 +1,13 @@ ###################################################################### -# Netatmo Package - Automations +# Away Mode - Climate Management ###################################################################### -automations: +automation: ###################################################################### - # Climate: Away Mode On - # - script.turn_on + # Automation to manage thermostatic valve in away mode ###################################################################### - - alias: "Termosifoni: Gestione Modalità vacanza" + - alias: "Modalità Vacanza: Gestione Termosifoni" trigger: - platform: state @@ -38,37 +37,10 @@ automations: - condition: state entity_id: input_boolean.home_mode_away state: "off" - - condition: template - value_template: "{{ now().month > 10 or now().month < 5 }}" + - condition: state + entity_id: input_boolean.central_heating + state: 'on' sequence: - service: script.turn_on data: entity_id: script.climate_away_mode_off - - ###################################################################### - # Climate: Schedule according to Condominium - # - script.turn_on - ###################################################################### - - alias: "Termosifoni: Gestione automatica riscaldamento" - - trigger: - - platform: homeassistant - event: start - - platform: time - at: '00:00:00' - - condition: - condition: or - conditions: - - '{{ now().month == 11 and now().day == 1}}' # Winter - - '{{ now().month == 4 and now().day == 15 }}' # Summer - - action: - - service: script.turn_on - data_template: - entity_id: >- - {% if now().month > 10 or now().month < 5 %} - script.climate_away_mode_off - {% else %} - script.climate_away_mode_on - {% endif %} diff --git a/packages/central_heating.yaml b/packages/central_heating.yaml new file mode 100644 index 00000000..335a31cc --- /dev/null +++ b/packages/central_heating.yaml @@ -0,0 +1,106 @@ +###################################################################### +# Central Heating Package - Binary Sensor +###################################################################### + +binary_sensor: + # Central Heating + - platform: template + sensors: + central_heating: + friendly_name: Riscaldamento Centralizzato + value_template: >- + {{ is_state('input_boolean.central_heating', 'on') }} + icon_template: >- + {% if is_state('input_boolean.central_heating', 'on') %} + mdi:radiator + {% else %} + mdi:radiator-disabled + {% endif %} + +###################################################################### +# Central Heating Package - Binary Sensor +###################################################################### + +input_boolean: + # Central Heating + central_heating: + name: Riscaldamento Centralizzato + icon: mdi:home-thermometer + +###################################################################### +# Central Heating +###################################################################### + +automation: + ###################################################################### + # Climate: Schedule according to Condominium + # - script.turn_on + ###################################################################### + - alias: "Riscaldamento Centralizzato" + + trigger: + - platform: homeassistant + event: start + - platform: time + at: '00:00:00' + - platform: state + entity_id: input_boolean.central_heating + to: 'on' + - platform: state + entity_id: input_boolean.central_heating + to: 'off' + + condition: [] + + action: + - choose: + # Switch on + - conditions: + - condition: template + value_template: "{{ now().month == 11 and now().day == 1 }}" + sequence: + - service: input_boolean.turn_on + data_template: + entity_id: input_boolean.central_heating + - service: script.notify_text + data_template: + title: "Home Assistant - Riscaldamento Centralizzato" + message: "Il riscaldamento centralizzato è stato acceso" + + # Switch off + - conditions: + - condition: template + value_template: "{{ now().month == 4 and now().day == 15 }}" + sequence: + - service: input_boolean.turn_on + data_template: + entity_id: input_boolean.central_heating + - service: script.notify_text + data_template: + title: "Home Assistant - Riscaldamento Centralizzato" + message: "Il riscaldamento centralizzato è stato spento" + +###################################################################### +# Netatmo Package - History +###################################################################### + +history: + exclude: + entities: + - binary_sensor.central_heating + +###################################################################### +# Netatmo Package - Logbook +###################################################################### +logbook: + exclude: + entities: + - binary_sensor.central_heating + +###################################################################### +# Netatmo Package - Recorder +###################################################################### +recorder: + exclude: + entities: + - binary_sensor.central_heating diff --git a/packages/netatmo/netatmo_customizations.yaml b/packages/netatmo/netatmo_customizations.yaml index 8d6eb2ce..15caa744 100644 --- a/packages/netatmo/netatmo_customizations.yaml +++ b/packages/netatmo/netatmo_customizations.yaml @@ -1,5 +1,5 @@ ###################################################################### -# Customization: Climate +# Netatmo Package - Customization ###################################################################### homeassistant: diff --git a/packages/netatmo/netatmo_scripts.yaml b/packages/netatmo/netatmo_engine.yaml similarity index 57% rename from packages/netatmo/netatmo_scripts.yaml rename to packages/netatmo/netatmo_engine.yaml index 2838d631..be338681 100644 --- a/packages/netatmo/netatmo_scripts.yaml +++ b/packages/netatmo/netatmo_engine.yaml @@ -56,3 +56,50 @@ script: - climate.netatmo_bagno - climate.netatmo_camera_da_letto hvac_mode: auto + +###################################################################### +# Netatmo Package - Script +###################################################################### + +automation: + ###################################################################### + # Climate: Central Away Mode + # - script.turn_on + ###################################################################### + - alias: "Termosifoni: Modalità vacanza centralizzata" + + trigger: + - platform: state + entity_id: input_boolean.central_heating + to: 'on' + - platform: state + entity_id: input_boolean.central_heating + to: 'off' + + condition: [] + + action: + - choose: + # Switch On + - conditions: + - condition: state + entity_id: input_boolean.central_heating + state: "on" + sequence: + - service: script.turn_on + data: + entity_id: script.climate_away_mode_on + # Switch Off + - conditions: + - condition: and + conditions: + - condition: state + entity_id: input_boolean.central_heating + state: "off" + - condition: state + entity_id: input_boolean.home_mode_away + state: 'off' + sequence: + - service: script.turn_on + data: + entity_id: script.climate_away_mode_off -- 2.47.3