]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Created Netatmo Package
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Fri, 11 Dec 2020 09:29:52 +0000 (10:29 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Fri, 11 Dec 2020 09:29:52 +0000 (10:29 +0100)
12 files changed:
automations/climate.yaml [deleted file]
components/google_assistant/climate.yaml [deleted file]
customizations/climate.yaml [deleted file]
groups/climate.yaml [deleted file]
packages/netatmo/netatmo_automations.yaml [new file with mode: 0644]
packages/netatmo/netatmo_customizations.yaml [new file with mode: 0644]
packages/netatmo/netatmo_google_assistant.yaml [new file with mode: 0644]
packages/netatmo/netatmo_groups.yaml [new file with mode: 0644]
packages/netatmo/netatmo_scripts.yaml [new file with mode: 0644]
packages/netatmo/netatmo_sensor.yaml [new file with mode: 0644]
scripts/climate.yaml [deleted file]
sensor/climates.yaml [deleted file]

diff --git a/automations/climate.yaml b/automations/climate.yaml
deleted file mode 100644 (file)
index e525706..0000000
+++ /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 (file)
index e440f49..0000000
+++ /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 (file)
index 43f1344..0000000
+++ /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 (file)
index a2112f0..0000000
+++ /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 (file)
index 0000000..7be66af
--- /dev/null
@@ -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 (file)
index 0000000..8d6eb2c
--- /dev/null
@@ -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 (file)
index 0000000..a3e2948
--- /dev/null
@@ -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 (file)
index 0000000..db66f52
--- /dev/null
@@ -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 (file)
index 0000000..2838d63
--- /dev/null
@@ -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 (file)
index 0000000..5bf02db
--- /dev/null
@@ -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 (file)
index af5d447..0000000
+++ /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 (file)
index 36701b6..0000000
+++ /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 %}