]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Replaced EQ3 Max with Netatmo Valves
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Fri, 11 Dec 2020 08:49:03 +0000 (09:49 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Fri, 11 Dec 2020 08:49:03 +0000 (09:49 +0100)
16 files changed:
.secrets_travis.yaml
.storage/lovelace
.storage/lovelace.lovelace_dispositivi
README.md
automations/climate.yaml
components/google_assistant/climate.yaml
components/netatmo.yaml [new file with mode: 0644]
configuration.yaml
customizations/climate.yaml
groups/climate.yaml
log/history.yaml
log/logbook.yaml
log/recorder.yaml
scripts/climate.yaml
sensor/climates.yaml
www/images/devices/netatmo_valve.png [new file with mode: 0644]

index fc80ad1638cbe42f9e5e5ddee126532753b1c3cb..0c3aec87d26a1c6efabe87d9720144965d4bcdcc 100644 (file)
@@ -47,3 +47,6 @@ docker_username: user
 darksky_key: 0
 
 hacs_token: 0
+
+netatmo_client_id: client_id
+netatmo_client_secret: password
index 1bd908cc8e3d462839e94dc7461be9ee32eb94ce..c841927f2bdae66b5c8371fe64af5fa88a05b57b 100644 (file)
@@ -55,7 +55,7 @@
                                     "entity": "cover.tapparella_cucina"
                                 },
                                 {
-                                    "entity": "climate.cucina_termostato_cucina"
+                                    "entity": "climate.netatmo_cucina"
                                 },
                                 {
                                     "entity": "media_player.google_home"
@@ -82,7 +82,7 @@
                                     "entity": "cover.tapparella_sala"
                                 },
                                 {
-                                    "entity": "climate.sala_termostato_sala"
+                                    "entity": "climate.netatmo_sala"
                                 },
                                 {
                                     "entity": "media_player.sony_bravia_tv"
                                     "entity": "light.luce_specchio"
                                 },
                                 {
-                                    "entity": "climate.bagno_termostato_bagno"
+                                    "entity": "climate.netatmo_bagno"
                                 }
                             ],
                             "entity": "light.luci_bagno",
                                     "entity": "cover.tapparella_studio"
                                 },
                                 {
-                                    "entity": "climate.studio_termostato_studio"
+                                    "entity": "climate.netatmo_studio"
                                 }
                             ],
                             "entity": "light.luce_studio",
                                     "entity": "cover.tapparella_camera"
                                 },
                                 {
-                                    "entity": "climate.camera_termostato_camera"
+                                    "entity": "climate.netatmo_camera_da_letto"
                                 }
                             ],
                             "entity": "light.luce_camera",
                     "title": "Tapparelle"
                 },
                 {
+                    "icon": "mdi:thermometer",
+                    "id": "climate",
+                    "title": "Termostato",
                     "badges": [
-                        "sensor.termostato_cucina",
-                        "sensor.termostato_sala",
-                        "sensor.termostato_bagno",
-                        "sensor.termostato_studio",
-                        "sensor.termostato_camera"
+                        {
+                            "entity": "sensor.valve_cucina_temperature"
+                        },
+                        {
+                            "entity": "sensor.valve_sala_temperature"
+                        },
+                        {
+                            "entity": "sensor.valve_bagno_temperature"
+                        },
+                        {
+                            "entity": "sensor.valve_studio_temperature"
+                        },
+                        {
+                            "entity": "sensor.valve_camera_da_letto_temperature"
+                        },
+                        {
+                            "entity": "sensor.front_balcony_temperature"
+                        },
+                        {
+                            "entity": "sensor.rear_balcony_temperature"
+                        },
+                        {
+                            "entity": "sensor.front_balcony_humidity"
+                        },
+                        {
+                            "entity": "sensor.rear_balcony_humidity"
+                        }
                     ],
                     "cards": [
                         {
-                            "entity": "climate.cucina_termostato_cucina",
+                            "entity": "climate.netatmo_cucina",
                             "type": "thermostat"
                         },
                         {
-                            "entity": "climate.sala_termostato_sala",
+                            "entity": "climate.netatmo_sala",
                             "type": "thermostat"
                         },
                         {
-                            "entity": "climate.bagno_termostato_bagno",
+                            "entity": "climate.netatmo_bagno",
                             "type": "thermostat"
                         },
                         {
-                            "entity": "climate.studio_termostato_studio",
+                            "entity": "climate.netatmo_studio",
                             "type": "thermostat"
                         },
                         {
-                            "entity": "climate.camera_termostato_camera",
+                            "entity": "climate.netatmo_camera_da_letto",
                             "type": "thermostat"
                         },
                         {
                                 {
                                     "action_name": "Attiva Boost",
                                     "name": "Cucina",
-                                    "service": "climate.set_preset_mode",
+                                    "service": "script.climate_valve_boost",
                                     "service_data": {
-                                        "entity_id": "climate.cucina_termostato_cucina",
-                                        "preset_mode": "boost"
+                                        "entity_id": "climate.netatmo_cucina"
                                     },
                                     "type": "call-service"
                                 },
                                 {
                                     "action_name": "Attiva Boost",
                                     "name": "Sala",
-                                    "service": "climate.set_preset_mode",
+                                    "service": "script.climate_valve_boost",
                                     "service_data": {
-                                        "entity_id": "climate.sala_termostato_sala",
-                                        "preset_mode": "boost"
+                                        "entity_id": "climate.netatmo_sala"
                                     },
                                     "type": "call-service"
                                 },
                                 {
                                     "action_name": "Attiva Boost",
                                     "name": "Bagno",
-                                    "service": "climate.set_preset_mode",
+                                    "service": "script.climate_valve_boost",
                                     "service_data": {
-                                        "entity_id": "climate.bagno_termostato_bagno",
-                                        "preset_mode": "boost"
+                                        "entity_id": "climate.netatmo_bagno"
                                     },
                                     "type": "call-service"
                                 },
                                 {
                                     "action_name": "Attiva Boost",
                                     "name": "Studio",
-                                    "service": "climate.set_preset_mode",
+                                    "service": "script.climate_valve_boost",
                                     "service_data": {
-                                        "entity_id": "climate.studio_termostato_studio",
-                                        "preset_mode": "boost"
+                                        "entity_id": "climate.netatmo_studio"
                                     },
                                     "type": "call-service"
                                 },
                                 {
                                     "action_name": "Attiva Boost",
                                     "name": "Camera",
-                                    "service": "climate.set_preset_mode",
+                                    "service": "script.climate_valve_boost",
                                     "service_data": {
-                                        "entity_id": "climate.camera_termostato_camera",
-                                        "preset_mode": "boost"
+                                        "entity_id": "climate.netatmo_camera_da_letto"
                                     },
                                     "type": "call-service"
                                 }
                             ],
                             "show_header_toggle": false,
-                            "title": "Operazione sui Dispositivi",
+                            "title": "Operazioni",
                             "type": "entities"
+                        },
+                        {
+                            "type": "history-graph",
+                            "entities": [
+                                {
+                                    "entity": "climate.netatmo_cucina"
+                                }
+                            ],
+                            "hours_to_show": 24,
+                            "refresh_interval": 0,
+                            "title": "Valvola Cucina"
+                        },
+                        {
+                            "type": "history-graph",
+                            "entities": [
+                                {
+                                    "entity": "climate.netatmo_sala"
+                                }
+                            ],
+                            "hours_to_show": 24,
+                            "refresh_interval": 0,
+                            "title": "Valvola Sala"
+                        },
+                        {
+                            "type": "history-graph",
+                            "entities": [
+                                {
+                                    "entity": "climate.netatmo_studio"
+                                }
+                            ],
+                            "hours_to_show": 24,
+                            "refresh_interval": 0,
+                            "title": "Valvola Studio"
+                        },
+                        {
+                            "type": "history-graph",
+                            "entities": [
+                                {
+                                    "entity": "climate.netatmo_bagno"
+                                }
+                            ],
+                            "hours_to_show": 24,
+                            "refresh_interval": 0,
+                            "title": "Valvola Bagno"
+                        },
+                        {
+                            "type": "history-graph",
+                            "entities": [
+                                {
+                                    "entity": "climate.netatmo_camera_da_letto"
+                                }
+                            ],
+                            "hours_to_show": 24,
+                            "refresh_interval": 0,
+                            "title": "Valvola Camera"
                         }
-                    ],
-                    "icon": "mdi:thermometer",
-                    "id": "climate",
-                    "title": "Termostato"
+                    ]
                 },
                 {
                     "badges": [
                     "badges": [
                         {
                             "entity": "sun.sun"
-                        },
-                        {
-                            "entity": "sensor.front_balcony_temperature"
-                        },
-                        {
-                            "entity": "sensor.rear_balcony_temperature"
                         }
                     ],
                     "cards": [
                         {
                             "entity": "weather.meteo_morgex",
                             "type": "weather-forecast"
-                        },
-                        {
-                            "entities": [
-                                {
-                                    "entity": "sensor.front_balcony_temperature"
-                                },
-                                {
-                                    "entity": "sensor.front_balcony_humidity"
-                                }
-                            ],
-                            "title": "Balcone",
-                            "type": "entities"
-                        },
-                        {
-                            "entities": [
-                                {
-                                    "entity": "sensor.rear_balcony_temperature"
-                                },
-                                {
-                                    "entity": "sensor.rear_balcony_humidity"
-                                }
-                            ],
-                            "title": "Veranda",
-                            "type": "entities"
                         }
                     ]
                 }
index 0833de3e4af54c989d525ca2f3fb905f8cffbb0e..99940b0455ec16b54cbf0fb2bdcdf503e38ad7f0 100644 (file)
                             ]
                         }
                     ]
+                },
+                {
+                    "title": "Netatmo",
+                    "path": "netatmo",
+                    "icon": "mdi:alpha-n-box",
+                    "badges": [],
+                    "cards": [
+                        {
+                            "type": "picture",
+                            "image": "/local/images/devices/netatmo_valve.png"
+                        },
+                        {
+                            "type": "custom:battery-state-card",
+                            "title": "Batteria Valvole Netatmo",
+                            "entities": [
+                                {
+                                    "entity": "sensor.valve_cucina_battery",
+                                    "name": "Cucina"
+                                },
+                                {
+                                    "entity": "sensor.valve_sala_battery",
+                                    "name": "Sala"
+                                },
+                                {
+                                    "entity": "sensor.valve_studio_battery",
+                                    "name": "Studio"
+                                },
+                                {
+                                    "entity": "sensor.valve_bagno_battery",
+                                    "name": "Bagno"
+                                },
+                                {
+                                    "entity": "sensor.valve_camera_da_letto_battery",
+                                    "name": "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"
+                                }
+                            ]
+                        }
+                    ]
                 }
             ],
             "title": "Dispositivi"
index 451b99a79e32a2957b0f814c57cabb336d598951..ba4df3fa1d6838717b0c1e9114813fff74cf05e9 100644 (file)
--- a/README.md
+++ b/README.md
@@ -15,7 +15,8 @@ My server is an Intel NUC (NUC5i5RYH) with [XCP-ng Hypervisor](https://xcp-ng.or
 * Google (Chromecast, Google Home Mini)
 * Shelly (Shelly1, Shelly2, Shelly2.5, ShellyEM, Shelly Dimmer)
 * Xiaomi (MiJia door & window contact sensor, MiJia temperature & humidity sensor)
-* MAX! eQ-3 (Thermostatic valve)
+* Netatmo Thermostatic valves
+* ~~MAX! eQ-3 (Thermostatic valve)~~
 * Sony Android TV (KD-55XF8596)
 * Canon Printer (TR8550)
 * QNAP NAS (TS-228A)
@@ -32,6 +33,7 @@ My server is an Intel NUC (NUC5i5RYH) with [XCP-ng Hypervisor](https://xcp-ng.or
 * Create Users/People
 * Configure the following integrations using UI:
   * Certificate Expiry
+  * Google Calendar
   * Google Cast
   * HACS
   * Internet Printing Protocol 
@@ -47,6 +49,7 @@ All files are edited with [Visual Studio Code](https://code.visualstudio.com/).
 All files are tested using the latest stable version of Home Assistant using [Travis](https://travis-ci.com/github/xraver/homeassistant).
 
 ## To Do List
+* Netatmo automations
 * Script review ([Native types support for templates](https://www.home-assistant.io/blog/2020/10/28/release-117/#native-types-support-for-templates-beta) after release 117)
 * NFC
 * Lovelace:
@@ -82,4 +85,4 @@ All files are tested using the latest stable version of Home Assistant using [Tr
 [last-commit-url]: https://github.com/xraver/homeassistant/commits/master
 [buymecoffee-img]: https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg
 [buymecoffee-button]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg
-[buymecoffee-url]: https://www.buymeacoffee.com/raverag
\ No newline at end of file
+[buymecoffee-url]: https://www.buymeacoffee.com/raverag
index fc8aa6a5c5aaac0fdf2cc08a12d8ad61f6cd404f..e525706a33f847683a529920da8e4b182f15853c 100644 (file)
 ######################################################################
-# Climate: Weekly Schedule
-# - script.climate_daily_schedule
+# Climate: Away Mode On
+# - script.turn_on
 ######################################################################
 
-- alias: "Termosifoni: Schedulazione giornaliera feriale"
-  initial_state: false
+- alias: "Termosifoni: Attiva Modalità vacanza"
 
   trigger:
-    - platform: time
-      at: '06:30:00'
-    - platform: time
-      at: '07:30:00'
-    - platform: time
-      at: '09:00:00'
-    - platform: time
-      at: '18:30:00'
-    - platform: time
-      at: '22:00:00'
-#    - platform: state
-#      entity_id: input_boolean.home_mode_away
-#      to: 'off'
-
-  condition:
-    condition: and
-    conditions:
-      - condition: state
-        entity_id: input_boolean.home_mode_away
-        state: 'off'
+    - platform: state
+      entity_id: input_boolean.home_mode_away
+      to: 'on'
 
-      - condition: time
-        weekday: [mon, tue, wed, thu, fri]
+  condition: []
 
   action:
-    - service: script.climate_daily_schedule
-      data_template:
-        entity_id: climate.cucina_termostato_cucina
-        temp1: 20
-        temp2: 18
-        temp3: 20
-        temp4: 20.5
-        temp5: 16
-
-    - service: script.climate_daily_schedule
-      data_template:
-        entity_id: climate.sala_termostato_sala
-        temp1: 18
-        temp2: 18
-        temp3: 19.5
-        temp4: 20
-        temp5: 16
-
-    - service: script.climate_daily_schedule
-      data_template:
-        entity_id: climate.bagno_termostato_bagno
-        temp1: 19
-        temp2: 18
-        temp3: 19
-        temp4: 19.5
-        temp5: 16
-
-    - service: script.climate_daily_schedule
-      data_template:
-        entity_id: climate.studio_termostato_studio
-        temp1: 18
-        temp2: 18
-        temp3: 19.5
-        temp4: 20
-        temp5: 16
-
-    - service: script.climate_daily_schedule
-      data_template:
-        entity_id: climate.camera_termostato_camera
-        temp1: 19
-        temp2: 18
-        temp3: 19
-        temp4: 19.5
-        temp5: 16
+    - service: script.turn_on
+      data:
+        entity_id: script.climate_away_mode_on
 
 ######################################################################
-# Climate: Away Mode
-# - climate.set_operation_mode
-# - climate.set_temperature
+# Climate: Away Mode Off
+# Note: in summer away mode off is disabled
+# - climate.set_hvac_mode
 ######################################################################
 
-- alias: "Termosifoni: Modalità vacanza"
-  initial_state: false
+- alias: "Termosifoni: Disattiva 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: []
+  condition: "{{ now().month > 10 or now().month < 5 }}"
 
   action:
-    - service: script.climate_away_mode
-      data_template:
-        entity_id: climate.cucina_termostato_cucina
+    - service: script.turn_on
+      data:
+        entity_id: script.climate_away_mode_off
 
-    - service: script.climate_away_mode
-      data_template:
-        entity_id: climate.sala_termostato_sala
-        mode: trigger.to_state.state
+######################################################################
+# Climate: Schedule according to Condominium
+# - script.turn_on
+######################################################################
 
-    - service: script.climate_away_mode
-      data_template:
-        entity_id: climate.bagno_termostato_bagno
-        mode: trigger.to_state.state
-          
-    - service: script.climate_away_mode
-      data_template:
-        entity_id: climate.studio_termostato_studio
-        mode: trigger.to_state.state
-          
-    - service: script.climate_away_mode
+- 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: climate.camera_termostato_camera
-        mode: trigger.to_state.state
+        entity_id: >- 
+          {% if now().month > 10 or now().month < 5 %}
+            script.climate_away_mode_off
+          {% else %}
+            script.climate_away_mode_on
+          {% endif %}
index 6fa3837fcc2633b6ec26a97837e4d269fd5c284e..e440f49641ea562eec13198004b13b39548935bb 100644 (file)
@@ -2,18 +2,18 @@
 # Google Assistant: Climate
 ######################################################################
 
-climate.bagno_termostato_bagno:
-  expose: true
-  room: Bagno
-climate.camera_termostato_camera:
-  expose: true
-  room: Camera
-climate.cucina_termostato_cucina:
+climate.netatmo_cucina:
   expose: true
   room: Cucina
-climate.sala_termostato_sala:
+climate.netatmo_sala:
   expose: true
   room: Sala
-climate.studio_termostato_studio:
+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/components/netatmo.yaml b/components/netatmo.yaml
new file mode 100644 (file)
index 0000000..bfccae5
--- /dev/null
@@ -0,0 +1,6 @@
+######################################################################
+# Component: Netatmo
+######################################################################
+
+client_id: !secret netatmo_client_id
+client_secret: !secret netatmo_client_secret
index adc338de75f8ae1a5208a5f0176590337fdf0d9b..636080bf4c0073ba76fa19d21812033e4980db22 100644 (file)
@@ -184,8 +184,8 @@ weather: !include components/weather.yaml
 # MQTT (moved to UI)
 #mqtt: !include components/mqtt.yaml
 
-# EQ3 Max Cube
-maxcube: !include components/eq3max.yaml
+# Netatmo
+netatmo: !include components/netatmo.yaml
 
 # Google Assistant
 google_assistant: !include components/google_assistant.yaml
index 90d013e8c5716352344db62a0f2f163d41ff1603..43f13440fb56e66ef9783ca56b99468d425233d7 100644 (file)
@@ -1,18 +1,18 @@
 ######################################################################
-# Customization: MAX EQ3 
+# Customization: Climate
 ######################################################################
 
-climate.cucina_termostato_cucina:
-  friendly_name: Termostato Cucina
+climate.netatmo_cucina:
+  friendly_name: Valvola Cucina
 
-climate.sala_termostato_sala:
-  friendly_name: Termostato Sala
+climate.netatmo_sala:
+  friendly_name: Valvola Sala
 
-climate.bagno_termostato_bagno:
-  friendly_name: Termostato Bagno
+climate.netatmo_bagno:
+  friendly_name: Valvola Bagno
 
-climate.studio_termostato_studio:
-  friendly_name: Termostato Studio
+climate.netatmo_studio:
+  friendly_name: Valvola Studio
 
-climate.camera_termostato_camera:
-  friendly_name: Termostato Camera
+climate.netatmo_camera_da_letto:
+  friendly_name: Valvola Camera
index 8f68f5da046d7560573826a1e4cb79f72d660d2c..a2112f024234e9a5809d0caf35a85223f8522701 100644 (file)
@@ -6,8 +6,8 @@ climate:
   name: Termostato
   icon: mdi:thermometer
   entities:
-    - sensor.termostato_cucina
-    - sensor.termostato_sala
-    - sensor.termostato_bagno
-    - sensor.termostato_studio
-    - sensor.termostato_camera
+    - climate.netatmo_cucina
+    - climate.netatmo_sala
+    - climate.netatmo_studio
+    - climate.netatmo_bagno
+    - climate.netatmo_camera_da_letto
index b4a61e43829713dcb450916c34082d26fd29bc2f..4e7ce5187970c9a7e9d43a8ff26eda459c98d7c2 100644 (file)
@@ -77,6 +77,17 @@ exclude:
     - sensor.canon_tr8500_series_cyan
     - sensor.canon_tr8500_series_magenta
     - sensor.canon_tr8500_series_yellow
+    # Netatmo
+    - sensor.valve_cucina_battery
+    - sensor.valve_sala_battery
+    - sensor.valve_studio_battery
+    - sensor.valve_bagno_battery
+    - sensor.valve_camera_da_letto_battery
+    - sensor.valve_cucina_state
+    - sensor.valve_sala_state
+    - sensor.valve_studio_state
+    - sensor.valve_bagno_state
+    - sensor.valve_camera_da_letto_state
   domains:
     - automation
     - calendar
index e1c30602111e465e3874026ee216e266ff9ca51e..5f79a03ca897264b771c07f6f4e04a07201096df 100644 (file)
@@ -77,6 +77,17 @@ exclude:
     - sensor.canon_tr8500_series_cyan
     - sensor.canon_tr8500_series_magenta
     - sensor.canon_tr8500_series_yellow
+    # Netatmo
+    - sensor.valve_cucina_battery
+    - sensor.valve_sala_battery
+    - sensor.valve_studio_battery
+    - sensor.valve_bagno_battery
+    - sensor.valve_camera_da_letto_battery
+    - sensor.valve_cucina_state
+    - sensor.valve_sala_state
+    - sensor.valve_studio_state
+    - sensor.valve_bagno_state
+    - sensor.valve_camera_da_letto_state
   domains:
     - automation
     - calendar
index c5ae390277e8187a50582487eb0e058cfedd5210..111b7671ac1f55935dd05d27b50ad06eb3db33db 100644 (file)
@@ -79,6 +79,17 @@ exclude:
     - sensor.canon_tr8500_series_cyan
     - sensor.canon_tr8500_series_magenta
     - sensor.canon_tr8500_series_yellow
+    # Netatmo
+    - sensor.valve_cucina_battery
+    - sensor.valve_sala_battery
+    - sensor.valve_studio_battery
+    - sensor.valve_bagno_battery
+    - sensor.valve_camera_da_letto_battery
+    - sensor.valve_cucina_state
+    - sensor.valve_sala_state
+    - sensor.valve_studio_state
+    - sensor.valve_bagno_state
+    - sensor.valve_camera_da_letto_state
   domains:
     - automation
     - calendar
index 704c5d7309f0cace62ecb40fe89fbe10d14cc707..af5d447dbe2a521ddcc0bde2b39600dd6ea2205e 100644 (file)
@@ -1,91 +1,55 @@
 ######################################################################
-# Climate: Daily Schedule
+# Climate: Valve Boost
 # Inputs:
 # - entity_id
-# - temp1
-# - temp2
-# - temp3
-# - temp4
-# - temp5
 #
 # Operations:
-# - climate.set_temperature
+# - climate.set_hvac_mode
 ######################################################################
-
-climate_daily_schedule:
-  alias: "Termosifoni: Schedulazione giornaliera"
+climate_valve_boost:
+  alias: "Valvole: Boost"
   sequence:
-    - service: climate.set_temperature
+    #- 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 }}"
-        temperature: >-
-          {% set current_date_string = now().strftime("%H%M") %}
-          {% set time1_string = "0630" %}
-          {% set time2_string = "0730" %}
-          {% set time3_string = "0900" %}
-          {% set time4_string = "1830" %}
-          {% set time5_string = "2200" %}
-          {% if ((current_date_string|int) >= (time1_string|int)) and ((current_date_string|int) < (time2_string|int)) %}
-            {{ temp1 }}
-          {% elif ((current_date_string|int) >= (time2_string|int)) and ((current_date_string|int) < (time3_string|int)) %}
-            {{ temp2 }}
-          {% elif ((current_date_string|int) >= (time3_string|int)) and ((current_date_string|int) < (time4_string|int)) %}
-            {{ temp3 }}
-          {% elif ((current_date_string|int) >= (time4_string|int)) and ((current_date_string|int) < (time5_string|int)) %}
-            {{ temp4 }}
-          {% else %}
-            {{ temp5 }}
-          {% endif %}
+        hvac_mode: auto
 
 ######################################################################
 # Climate: Away Mode On
-# Inputs:
-# - entity_id
-# - mode
-#
-# Operations:
-# - climate.set_operation_mode
-# - climate.set_temperature
+# - service: climate.set_preset_mode
 ######################################################################
-
 climate_away_mode_on:
-  alias: "Termosifoni: Attviva Modalità vacanza"
   sequence:
     - service: climate.set_preset_mode
-      data_template:
-        entity_id: "{{ entity_id }}"
-        preset_mode: manual
-    - delay: '00:00:5'
-    - service: climate.set_temperature
-      data_template:
-        entity_id: "{{ entity_id }}"
-        temperature: 5
-    - delay: '00:00:5'
-    - service: climate.set_preset_mode
-      data_template:
-        entity_id: "{{ entity_id }}"
-        preset_mode: vacation
-    - delay: '00:00:5'
-    - service: climate.set_preset_mode
-      data_template:
-        entity_id: "{{ entity_id }}"
-        preset_mode: vacation
+      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
-# Inputs:
-# - entity_id
-# - mode
-#
-# Operations:
-# - climate.set_operation_mode
-# - climate.set_temperature
+# Note: in summer away mode off is disabled
+# - climate.set_hvac_mode
 ######################################################################
-
 climate_away_mode_off:
-  alias: "Termosifoni: Disattiva Modalità vacanza"
   sequence:
-    - service: climate.set_preset_mode
-      data_template:
-        entity_id: "{{ entity_id }}"
-        preset_mode: auto
+    - 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
index 57548d28f36f460168c54acef7f96f08a926e675..36701b6a09e654268739152f6081e133b7e57675 100644 (file)
 ######################################################################
-# Sensor: Temperature from Radiator Thermostat
+# Sensor: Temperature from Radiator Valve
 ######################################################################
 
 - platform: template
   sensors:
-    termostato_cucina:
-      friendly_name: "Cucina"
-      value_template: "{{ state_attr('climate.cucina_termostato_cucina', 'current_temperature') }}" 
+    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:
-    termostato_sala:
-      friendly_name: "Sala"
-      value_template: "{{ state_attr('climate.sala_termostato_sala', 'current_temperature') }}"
+    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:
-    termostato_bagno:
-      friendly_name: "Bagno"
-      value_template: "{{ state_attr('climate.bagno_termostato_bagno', 'current_temperature') }}"
-      unit_of_measurement: '°C'
+    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:
-    termostato_studio:
-      friendly_name: "Studio"
-      value_template: "{{ state_attr('climate.studio_termostato_studio', 'current_temperature') }}"
+    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:
-    termostato_camera:
-      friendly_name: "Camera"
-      value_template: "{{ state_attr('climate.camera_termostato_camera', 'current_temperature') }}"
+    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/www/images/devices/netatmo_valve.png b/www/images/devices/netatmo_valve.png
new file mode 100644 (file)
index 0000000..2f73617
Binary files /dev/null and b/www/images/devices/netatmo_valve.png differ