From e2f948da8d5ff8d34c690ad801305eb95eb1c243 Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Fri, 11 Dec 2020 10:29:52 +0100 Subject: [PATCH] Created Netatmo Package --- automations/climate.yaml | 67 -------- components/google_assistant/climate.yaml | 19 --- customizations/climate.yaml | 18 --- groups/climate.yaml | 13 -- packages/netatmo/netatmo_automations.yaml | 74 +++++++++ packages/netatmo/netatmo_customizations.yaml | 20 +++ .../netatmo/netatmo_google_assistant.yaml | 21 +++ packages/netatmo/netatmo_groups.yaml | 14 ++ packages/netatmo/netatmo_scripts.yaml | 58 +++++++ packages/netatmo/netatmo_sensor.yaml | 153 ++++++++++++++++++ scripts/climate.yaml | 55 ------- sensor/climates.yaml | 151 ----------------- 12 files changed, 340 insertions(+), 323 deletions(-) delete mode 100644 automations/climate.yaml delete mode 100644 components/google_assistant/climate.yaml delete mode 100644 customizations/climate.yaml delete mode 100644 groups/climate.yaml create mode 100644 packages/netatmo/netatmo_automations.yaml create mode 100644 packages/netatmo/netatmo_customizations.yaml create mode 100644 packages/netatmo/netatmo_google_assistant.yaml create mode 100644 packages/netatmo/netatmo_groups.yaml create mode 100644 packages/netatmo/netatmo_scripts.yaml create mode 100644 packages/netatmo/netatmo_sensor.yaml delete mode 100644 scripts/climate.yaml delete mode 100644 sensor/climates.yaml diff --git a/automations/climate.yaml b/automations/climate.yaml deleted file mode 100644 index e525706a..00000000 --- a/automations/climate.yaml +++ /dev/null @@ -1,67 +0,0 @@ -###################################################################### -# Climate: Away Mode On -# - script.turn_on -###################################################################### - -- alias: "Termosifoni: Attiva Modalità vacanza" - - trigger: - - platform: state - entity_id: input_boolean.home_mode_away - to: 'on' - - condition: [] - - action: - - service: script.turn_on - data: - entity_id: script.climate_away_mode_on - -###################################################################### -# Climate: Away Mode Off -# Note: in summer away mode off is disabled -# - climate.set_hvac_mode -###################################################################### - -- alias: "Termosifoni: Disattiva Modalità vacanza" - - trigger: - - platform: state - entity_id: input_boolean.home_mode_away - to: 'off' - - condition: "{{ now().month > 10 or now().month < 5 }}" - - action: - - 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/components/google_assistant/climate.yaml b/components/google_assistant/climate.yaml deleted file mode 100644 index e440f496..00000000 --- a/components/google_assistant/climate.yaml +++ /dev/null @@ -1,19 +0,0 @@ -###################################################################### -# Google Assistant: Climate -###################################################################### - -climate.netatmo_cucina: - expose: true - room: Cucina -climate.netatmo_sala: - expose: true - room: Sala -climate.netatmo_studio: - expose: true - room: Studio -climate.netatmo_bagno: - expose: true - room: Bagno -climate.netatmo_camera_da_letto: - expose: true - room: Camera diff --git a/customizations/climate.yaml b/customizations/climate.yaml deleted file mode 100644 index 43f13440..00000000 --- a/customizations/climate.yaml +++ /dev/null @@ -1,18 +0,0 @@ -###################################################################### -# Customization: Climate -###################################################################### - -climate.netatmo_cucina: - friendly_name: Valvola Cucina - -climate.netatmo_sala: - friendly_name: Valvola Sala - -climate.netatmo_bagno: - friendly_name: Valvola Bagno - -climate.netatmo_studio: - friendly_name: Valvola Studio - -climate.netatmo_camera_da_letto: - friendly_name: Valvola Camera diff --git a/groups/climate.yaml b/groups/climate.yaml deleted file mode 100644 index a2112f02..00000000 --- a/groups/climate.yaml +++ /dev/null @@ -1,13 +0,0 @@ -###################################################################### -# Group Climate -###################################################################### - -climate: - name: Termostato - icon: mdi:thermometer - entities: - - climate.netatmo_cucina - - climate.netatmo_sala - - climate.netatmo_studio - - climate.netatmo_bagno - - climate.netatmo_camera_da_letto diff --git a/packages/netatmo/netatmo_automations.yaml b/packages/netatmo/netatmo_automations.yaml new file mode 100644 index 00000000..7be66aff --- /dev/null +++ b/packages/netatmo/netatmo_automations.yaml @@ -0,0 +1,74 @@ +###################################################################### +# Netatmo Package - Automations +###################################################################### + +automations: + + ###################################################################### + # Climate: Away Mode On + # - script.turn_on + ###################################################################### + - alias: "Termosifoni: Gestione Modalità vacanza" + + trigger: + - platform: state + entity_id: input_boolean.home_mode_away + to: 'on' + - platform: state + entity_id: input_boolean.home_mode_away + to: 'off' + + condition: [] + + action: + - choose: + # Switch On + - conditions: + - condition: state + entity_id: input_boolean.home_mode_away + 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.home_mode_away + state: "off" + - condition: template + value_template: "{{ now().month > 10 or now().month < 5 }}" + 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/netatmo/netatmo_customizations.yaml b/packages/netatmo/netatmo_customizations.yaml new file mode 100644 index 00000000..8d6eb2ce --- /dev/null +++ b/packages/netatmo/netatmo_customizations.yaml @@ -0,0 +1,20 @@ +###################################################################### +# Customization: Climate +###################################################################### + +homeassistant: + customize: + climate.netatmo_cucina: + friendly_name: Valvola Cucina + + climate.netatmo_sala: + friendly_name: Valvola Sala + + climate.netatmo_bagno: + friendly_name: Valvola Bagno + + climate.netatmo_studio: + friendly_name: Valvola Studio + + climate.netatmo_camera_da_letto: + friendly_name: Valvola Camera diff --git a/packages/netatmo/netatmo_google_assistant.yaml b/packages/netatmo/netatmo_google_assistant.yaml new file mode 100644 index 00000000..a3e29487 --- /dev/null +++ b/packages/netatmo/netatmo_google_assistant.yaml @@ -0,0 +1,21 @@ +###################################################################### +# Netatmo Package - Google Assistant +###################################################################### + +google_assistant: + entity_config: + climate.netatmo_cucina: + expose: true + room: Cucina + climate.netatmo_sala: + expose: true + room: Sala + climate.netatmo_studio: + expose: true + room: Studio + climate.netatmo_bagno: + expose: true + room: Bagno + climate.netatmo_camera_da_letto: + expose: true + room: Camera diff --git a/packages/netatmo/netatmo_groups.yaml b/packages/netatmo/netatmo_groups.yaml new file mode 100644 index 00000000..db66f52f --- /dev/null +++ b/packages/netatmo/netatmo_groups.yaml @@ -0,0 +1,14 @@ +###################################################################### +# Netatmo Package - Group +###################################################################### + +group: + climate: + name: Termostato + icon: mdi:thermometer + entities: + - climate.netatmo_cucina + - climate.netatmo_sala + - climate.netatmo_studio + - climate.netatmo_bagno + - climate.netatmo_camera_da_letto diff --git a/packages/netatmo/netatmo_scripts.yaml b/packages/netatmo/netatmo_scripts.yaml new file mode 100644 index 00000000..2838d631 --- /dev/null +++ b/packages/netatmo/netatmo_scripts.yaml @@ -0,0 +1,58 @@ +###################################################################### +# Netatmo Package - Script +###################################################################### + +script: + ###################################################################### + # Climate: Valve Boost + # Inputs: + # - entity_id + # + # Operations: + # - climate.set_hvac_mode + ###################################################################### + climate_valve_boost: + alias: "Valvole: Boost" + sequence: + - service: climate.set_preset_mode + data_template: + entity_id: "{{ entity_id }}" + preset_mode: boost + - delay: 300 + - service: climate.set_hvac_mode + data_template: + entity_id: "{{ entity_id }}" + hvac_mode: auto + + ###################################################################### + # Climate: Away Mode On + # - service: climate.set_preset_mode + ###################################################################### + climate_away_mode_on: + sequence: + - service: climate.set_preset_mode + data: + entity_id: + - climate.netatmo_cucina + - climate.netatmo_sala + - climate.netatmo_studio + - climate.netatmo_bagno + - climate.netatmo_camera_da_letto + preset_mode: away + + ###################################################################### + # Climate: Away Mode Off + # Note: in summer away mode off is disabled + # - climate.set_hvac_mode + ###################################################################### + climate_away_mode_off: + sequence: + - service: climate.set_hvac_mode + data: + entity_id: + - climate.netatmo_cucina + - climate.netatmo_sala + - climate.netatmo_studio + - climate.netatmo_bagno + - climate.netatmo_camera_da_letto + hvac_mode: auto diff --git a/packages/netatmo/netatmo_sensor.yaml b/packages/netatmo/netatmo_sensor.yaml new file mode 100644 index 00000000..5bf02dbd --- /dev/null +++ b/packages/netatmo/netatmo_sensor.yaml @@ -0,0 +1,153 @@ +###################################################################### +# Netatmo Package - Sensor +###################################################################### + +sensor: + ###################################################################### + # Sensor: Temperature from Radiator Valve + ###################################################################### + - platform: template + sensors: + valve_cucina_temperature: + friendly_name: "Temperatura Cucina" + value_template: "{{ state_attr('climate.netatmo_cucina', 'current_temperature') }}" + unit_of_measurement: '°C' + device_class: temperature + + - platform: template + sensors: + valve_sala_temperature: + friendly_name: "Temperatura Sala" + value_template: "{{ state_attr('climate.netatmo_sala', 'current_temperature') }}" + unit_of_measurement: '°C' + device_class: temperature + + - platform: template + sensors: + valve_studio_temperature: + friendly_name: "Temperatura Studio" + value_template: "{{ state_attr('climate.netatmo_studio', 'current_temperature') }}" + unit_of_measurement: '°C' + device_class: temperature + + - platform: template + sensors: + valve_bagno_temperature: + friendly_name: "Temperatura Bagno" + value_template: "{{ state_attr('climate.netatmo_bagno', 'current_temperature') }}" + unit_of_measurement: '°C' + device_class: temperature + + - platform: template + sensors: + valve_camera_da_letto_temperature: + friendly_name: "Temperatura Camera" + value_template: "{{ state_attr('climate.netatmo_camera_da_letto', 'current_temperature') }}" + unit_of_measurement: '°C' + device_class: temperature + + ###################################################################### + # Sensor: Battery from Radiator Valve + ###################################################################### + - platform: template + sensors: + valve_cucina_battery: + friendly_name: "Batteria Valvola Cucina" + value_template: "{{ state_attr('climate.netatmo_cucina', 'battery_level') }}" + unit_of_measurement: '%' + device_class: battery + + - platform: template + sensors: + valve_sala_battery: + friendly_name: "Batteria Valvola Sala" + value_template: "{{ state_attr('climate.netatmo_sala', 'battery_level') }}" + unit_of_measurement: '%' + device_class: battery + + - platform: template + sensors: + valve_studio_battery: + friendly_name: "Batteria Valvola Studio" + value_template: "{{ state_attr('climate.netatmo_studio', 'battery_level') }}" + unit_of_measurement: '%' + device_class: battery + + - platform: template + sensors: + valve_bagno_battery: + friendly_name: "Batteria Valvola Bagno" + value_template: "{{ state_attr('climate.netatmo_bagno', 'battery_level') }}" + unit_of_measurement: '%' + device_class: battery + + - platform: template + sensors: + valve_camera_da_letto_battery: + friendly_name: "Batteria Valvola Camera" + value_template: "{{ state_attr('climate.netatmo_camera_da_letto', 'battery_level') }}" + unit_of_measurement: '%' + device_class: battery + + ###################################################################### + # Sensor: State from Radiator Valve + ###################################################################### + - platform: template + sensors: + valve_cucina_state: + friendly_name: "Stato Valvola Cucina" + value_template: "{{ state_attr('climate.netatmo_cucina', 'hvac_action') }}" + icon_template: >- + {% if is_state_attr('climate.netatmo_cucina', 'hvac_action', 'idle') %} + mdi:radiator-disabled + {% else %} + mdi:radiator + {% endif %} + + - platform: template + sensors: + valve_sala_state: + friendly_name: "Stato Valvola Sala" + value_template: "{{ state_attr('climate.netatmo_sala', 'hvac_action') }}" + icon_template: >- + {% if is_state_attr('climate.netatmo_sala', 'hvac_action', 'idle') %} + mdi:radiator-disabled + {% else %} + mdi:radiator + {% endif %} + + - platform: template + sensors: + valve_studio_state: + friendly_name: "Stato Valvola Studio" + value_template: "{{ state_attr('climate.netatmo_studio', 'hvac_action') }}" + icon_template: >- + {% if is_state_attr('climate.netatmo_studio', 'hvac_action', 'idle') %} + mdi:radiator-disabled + {% else %} + mdi:radiator + {% endif %} + + - platform: template + sensors: + valve_bagno_state: + friendly_name: "Stato Valvola Bagno" + value_template: "{{ state_attr('climate.netatmo_bagno', 'hvac_action') }}" + icon_template: >- + {% if is_state_attr('climate.netatmo_bagno', 'hvac_action', 'idle') %} + mdi:radiator-disabled + {% else %} + mdi:radiator + {% endif %} + + - platform: template + sensors: + valve_camera_da_letto_state: + friendly_name: "Stato Valvola Camera" + value_template: "{{ state_attr('climate.netatmo_camera_da_letto', 'hvac_action') }}" + icon_template: >- + {% if is_state_attr('climate.netatmo_camera_da_letto', 'hvac_action', 'idle') %} + mdi:radiator-disabled + {% else %} + mdi:radiator + {% endif %} diff --git a/scripts/climate.yaml b/scripts/climate.yaml deleted file mode 100644 index af5d447d..00000000 --- a/scripts/climate.yaml +++ /dev/null @@ -1,55 +0,0 @@ -###################################################################### -# Climate: Valve Boost -# Inputs: -# - entity_id -# -# Operations: -# - climate.set_hvac_mode -###################################################################### -climate_valve_boost: - alias: "Valvole: Boost" - sequence: - #- service: climate.set_hvac_mode - - service: climate.set_preset_mode - data_template: - entity_id: "{{ entity_id }}" - #hvac_mode: heat - preset_mode: boost - - delay: 300 - - service: climate.set_hvac_mode - data_template: - entity_id: "{{ entity_id }}" - hvac_mode: auto - -###################################################################### -# Climate: Away Mode On -# - service: climate.set_preset_mode -###################################################################### -climate_away_mode_on: - sequence: - - service: climate.set_preset_mode - data: - entity_id: - - climate.netatmo_cucina - - climate.netatmo_sala - - climate.netatmo_studio - - climate.netatmo_bagno - - climate.netatmo_camera_da_letto - preset_mode: away - -###################################################################### -# Climate: Away Mode Off -# Note: in summer away mode off is disabled -# - climate.set_hvac_mode -###################################################################### -climate_away_mode_off: - sequence: - - service: climate.set_hvac_mode - data: - entity_id: - - climate.netatmo_cucina - - climate.netatmo_sala - - climate.netatmo_studio - - climate.netatmo_bagno - - climate.netatmo_camera_da_letto - hvac_mode: auto diff --git a/sensor/climates.yaml b/sensor/climates.yaml deleted file mode 100644 index 36701b6a..00000000 --- a/sensor/climates.yaml +++ /dev/null @@ -1,151 +0,0 @@ -###################################################################### -# Sensor: Temperature from Radiator Valve -###################################################################### - -- platform: template - sensors: - valve_cucina_temperature: - friendly_name: "Temperatura Cucina" - value_template: "{{ state_attr('climate.netatmo_cucina', 'current_temperature') }}" - unit_of_measurement: '°C' - device_class: temperature - -- platform: template - sensors: - valve_sala_temperature: - friendly_name: "Temperatura Sala" - value_template: "{{ state_attr('climate.netatmo_sala', 'current_temperature') }}" - unit_of_measurement: '°C' - device_class: temperature - -- platform: template - sensors: - valve_studio_temperature: - friendly_name: "Temperatura Studio" - value_template: "{{ state_attr('climate.netatmo_studio', 'current_temperature') }}" - unit_of_measurement: '°C' - device_class: temperature - -- platform: template - sensors: - valve_bagno_temperature: - friendly_name: "Temperatura Bagno" - value_template: "{{ state_attr('climate.netatmo_bagno', 'current_temperature') }}" - unit_of_measurement: '°C' - device_class: temperature - -- platform: template - sensors: - valve_camera_da_letto_temperature: - friendly_name: "Temperatura Camera" - value_template: "{{ state_attr('climate.netatmo_camera_da_letto', 'current_temperature') }}" - unit_of_measurement: '°C' - device_class: temperature - -###################################################################### -# Sensor: Battery from Radiator Valve -###################################################################### - -- platform: template - sensors: - valve_cucina_battery: - friendly_name: "Batteria Valvola Cucina" - value_template: "{{ state_attr('climate.netatmo_cucina', 'battery_level') }}" - unit_of_measurement: '%' - device_class: battery - -- platform: template - sensors: - valve_sala_battery: - friendly_name: "Batteria Valvola Sala" - value_template: "{{ state_attr('climate.netatmo_sala', 'battery_level') }}" - unit_of_measurement: '%' - device_class: battery - -- platform: template - sensors: - valve_studio_battery: - friendly_name: "Batteria Valvola Studio" - value_template: "{{ state_attr('climate.netatmo_studio', 'battery_level') }}" - unit_of_measurement: '%' - device_class: battery - -- platform: template - sensors: - valve_bagno_battery: - friendly_name: "Batteria Valvola Bagno" - value_template: "{{ state_attr('climate.netatmo_bagno', 'battery_level') }}" - unit_of_measurement: '%' - device_class: battery - -- platform: template - sensors: - valve_camera_da_letto_battery: - friendly_name: "Batteria Valvola Camera" - value_template: "{{ state_attr('climate.netatmo_camera_da_letto', 'battery_level') }}" - unit_of_measurement: '%' - device_class: battery - -###################################################################### -# Sensor: State from Radiator Valve -###################################################################### - -- platform: template - sensors: - valve_cucina_state: - friendly_name: "Stato Valvola Cucina" - value_template: "{{ state_attr('climate.netatmo_cucina', 'hvac_action') }}" - icon_template: >- - {% if is_state_attr('climate.netatmo_cucina', 'hvac_action', 'idle') %} - mdi:radiator-disabled - {% else %} - mdi:radiator - {% endif %} - -- platform: template - sensors: - valve_sala_state: - friendly_name: "Stato Valvola Sala" - value_template: "{{ state_attr('climate.netatmo_sala', 'hvac_action') }}" - icon_template: >- - {% if is_state_attr('climate.netatmo_sala', 'hvac_action', 'idle') %} - mdi:radiator-disabled - {% else %} - mdi:radiator - {% endif %} - -- platform: template - sensors: - valve_studio_state: - friendly_name: "Stato Valvola Studio" - value_template: "{{ state_attr('climate.netatmo_studio', 'hvac_action') }}" - icon_template: >- - {% if is_state_attr('climate.netatmo_studio', 'hvac_action', 'idle') %} - mdi:radiator-disabled - {% else %} - mdi:radiator - {% endif %} - -- platform: template - sensors: - valve_bagno_state: - friendly_name: "Stato Valvola Bagno" - value_template: "{{ state_attr('climate.netatmo_bagno', 'hvac_action') }}" - icon_template: >- - {% if is_state_attr('climate.netatmo_bagno', 'hvac_action', 'idle') %} - mdi:radiator-disabled - {% else %} - mdi:radiator - {% endif %} - -- platform: template - sensors: - valve_camera_da_letto_state: - friendly_name: "Stato Valvola Camera" - value_template: "{{ state_attr('climate.netatmo_camera_da_letto', 'hvac_action') }}" - icon_template: >- - {% if is_state_attr('climate.netatmo_camera_da_letto', 'hvac_action', 'idle') %} - mdi:radiator-disabled - {% else %} - mdi:radiator - {% endif %} -- 2.47.3