From 45e9d724ddb0886a08574314750dcc8a4a942b43 Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Thu, 18 Mar 2021 21:19:56 +0100 Subject: [PATCH] Added shelly version notification with id device and version number --- automations/update_notifications.yaml | 13 ++++++++++-- groups/shelly.yaml | 30 +++++++++++++-------------- log/history.yaml | 28 ++++++++++++------------- log/logbook.yaml | 28 ++++++++++++------------- log/recorder.yaml | 28 ++++++++++++------------- scripts/shelly.yaml | 2 +- sensor/shelly.yaml | 28 ++++++++++++------------- 7 files changed, 83 insertions(+), 74 deletions(-) diff --git a/automations/update_notifications.yaml b/automations/update_notifications.yaml index 380e544a..fcb5e5f2 100644 --- a/automations/update_notifications.yaml +++ b/automations/update_notifications.yaml @@ -53,7 +53,13 @@ - service: script.notify_text data_template: title: "Shelly - Aggiornamento" - message: "Sono disponibili aggiornamenti per i dispositivi Shelly" + message: > + "Sono disponibili aggiornamenti per i dispositivi Shelly:" + {% for entity_id in states.group.shelly.attributes.entity_id %} + {% if is_state(entity_id, 'on') %} + -> {{ state_attr(entity_id, 'friendly_name') }}: {{ state_attr(entity_id, 'update').new_version }} + {% endif %} + {%- endfor %} notification_id: "update" enable_persistent: 1 @@ -110,7 +116,10 @@ trigger: platform: state - entity_id: input_boolean.update + entity_id: + - input_boolean.update_homeassistant + - input_boolean.update_shelly + - input_boolean.update_hacs to: 'off' action: diff --git a/groups/shelly.yaml b/groups/shelly.yaml index f50daf1d..646fb53c 100644 --- a/groups/shelly.yaml +++ b/groups/shelly.yaml @@ -4,19 +4,19 @@ shelly: name: Shelly Devices - #icon: mdi:thermometer + icon: mdi:alpha-s-box entities: - - sensor.shelly1_status - - sensor.shelly2_status - - sensor.shelly3_status - - sensor.shelly4_status - - sensor.shelly5_status - - sensor.shelly6_status - - sensor.shelly7_status - - sensor.shelly8_status - - sensor.shelly9_status - - sensor.shelly10_status - - sensor.shelly11_status - #- sensor.shellybulb_status - - sensor.shellyem_status - #- sensor.shellyplugs_status + - sensor.shelly1 + - sensor.shelly2 + - sensor.shelly3 + - sensor.shelly4 + - sensor.shelly5 + - sensor.shelly6 + - sensor.shelly7 + - sensor.shelly8 + - sensor.shelly9 + - sensor.shelly10 + - sensor.shelly11 + #- sensor.shellybulb + - sensor.shellyem + #- sensor.shellyplugs diff --git a/log/history.yaml b/log/history.yaml index b4a61e43..953174ab 100644 --- a/log/history.yaml +++ b/log/history.yaml @@ -28,20 +28,20 @@ exclude: - sensor.cert_expiry_server_giorgioravera_it - sensor.cert_expiry_timestamp_server_giorgioravera_it # Shelly - - sensor.shelly1_status - - sensor.shelly2_status - - sensor.shelly3_status - - sensor.shelly4_status - - sensor.shelly5_status - - sensor.shelly6_status - - sensor.shelly7_status - - sensor.shelly8_status - - sensor.shelly9_status - - sensor.shelly10_status - - sensor.shelly11_status - - sensor.shellybulb_status - - sensor.shellyem_status - - sensor.shellyplugs_status + - sensor.shelly1 + - sensor.shelly2 + - sensor.shelly3 + - sensor.shelly4 + - sensor.shelly5 + - sensor.shelly6 + - sensor.shelly7 + - sensor.shelly8 + - sensor.shelly9 + - sensor.shelly10 + - sensor.shelly11 + - sensor.shellybulb + - sensor.shellyem + - sensor.shellyplugs # Energy Sensors - sensor.potenza_reattiva - sensor.tensione diff --git a/log/logbook.yaml b/log/logbook.yaml index e1c30602..5b5396fb 100644 --- a/log/logbook.yaml +++ b/log/logbook.yaml @@ -28,20 +28,20 @@ exclude: - sensor.cert_expiry_server_giorgioravera_it - sensor.cert_expiry_timestamp_server_giorgioravera_it # Shelly - - sensor.shelly1_status - - sensor.shelly2_status - - sensor.shelly3_status - - sensor.shelly4_status - - sensor.shelly5_status - - sensor.shelly6_status - - sensor.shelly7_status - - sensor.shelly8_status - - sensor.shelly9_status - - sensor.shelly10_status - - sensor.shelly11_status - - sensor.shellybulb_status - - sensor.shellyem_status - - sensor.shellyplugs_status + - sensor.shelly1 + - sensor.shelly2 + - sensor.shelly3 + - sensor.shelly4 + - sensor.shelly5 + - sensor.shelly6 + - sensor.shelly7 + - sensor.shelly8 + - sensor.shelly9 + - sensor.shelly10 + - sensor.shelly11 + - sensor.shellybulb + - sensor.shellyem + - sensor.shellyplugs # Energy Sensors - sensor.potenza_reattiva - sensor.tensione diff --git a/log/recorder.yaml b/log/recorder.yaml index c5ae3902..d25e4c52 100644 --- a/log/recorder.yaml +++ b/log/recorder.yaml @@ -30,20 +30,20 @@ exclude: - sensor.cert_expiry_server_giorgioravera_it - sensor.cert_expiry_timestamp_server_giorgioravera_it # Shelly - - sensor.shelly1_status - - sensor.shelly2_status - - sensor.shelly3_status - - sensor.shelly4_status - - sensor.shelly5_status - - sensor.shelly6_status - - sensor.shelly7_status - - sensor.shelly8_status - - sensor.shelly9_status - - sensor.shelly10_status - - sensor.shelly11_status - - sensor.shellybulb_status - - sensor.shellyem_status - - sensor.shellyplugs_status + - sensor.shelly1 + - sensor.shelly2 + - sensor.shelly3 + - sensor.shelly4 + - sensor.shelly5 + - sensor.shelly6 + - sensor.shelly7 + - sensor.shelly8 + - sensor.shelly9 + - sensor.shelly10 + - sensor.shelly11 + - sensor.shellybulb + - sensor.shellyem + - sensor.shellyplugs # Energy Sensors - sensor.potenza_reattiva - sensor.tensione diff --git a/scripts/shelly.yaml b/scripts/shelly.yaml index a976e428..d3aca8e5 100644 --- a/scripts/shelly.yaml +++ b/scripts/shelly.yaml @@ -11,7 +11,7 @@ shelly_upgrade: data: topic: 'shellies/shellyswitch-55980F/command' payload: 'update_fw' - + # Shelly 2 Tapparella Sala - service: mqtt.publish data: diff --git a/sensor/shelly.yaml b/sensor/shelly.yaml index a6f53dec..741b62f1 100644 --- a/sensor/shelly.yaml +++ b/sensor/shelly.yaml @@ -6,7 +6,7 @@ scan_interval: 43200 resource: http://shelly1.giorgioravera.it/status method: GET - name: shelly1_status + name: shelly1 #value_template: '{{ value_json.has_update }}' value_template: >- {% if value_json.has_update == True %} @@ -34,7 +34,7 @@ scan_interval: 43200 resource: http://shelly2.giorgioravera.it/status method: GET - name: shelly2_status + name: shelly2 #value_template: '{{ value_json.has_update }}' value_template: >- {% if value_json.has_update == True %} @@ -62,7 +62,7 @@ scan_interval: 43200 resource: http://shelly3.giorgioravera.it/status method: GET - name: shelly3_status + name: shelly3 #value_template: '{{ value_json.has_update }}' value_template: >- {% if value_json.has_update == True %} @@ -90,7 +90,7 @@ scan_interval: 43200 resource: http://shelly4.giorgioravera.it/status method: GET - name: shelly4_status + name: shelly4 #value_template: '{{ value_json.has_update }}' value_template: >- {% if value_json.has_update == True %} @@ -118,7 +118,7 @@ scan_interval: 43200 resource: http://shelly5.giorgioravera.it/status method: GET - name: shelly5_status + name: shelly5 #value_template: '{{ value_json.has_update }}' value_template: >- {% if value_json.has_update == True %} @@ -146,7 +146,7 @@ scan_interval: 43200 resource: http://shelly6.giorgioravera.it/status method: GET - name: shelly6_status + name: shelly6 #value_template: '{{ value_json.has_update }}' value_template: >- {% if value_json.has_update == True %} @@ -174,7 +174,7 @@ scan_interval: 43200 resource: http://shelly7.giorgioravera.it/status method: GET - name: shelly7_status + name: shelly7 #value_template: '{{ value_json.has_update }}' value_template: >- {% if value_json.has_update == True %} @@ -202,7 +202,7 @@ scan_interval: 43200 resource: http://shelly8.giorgioravera.it/status method: GET - name: shelly8_status + name: shelly8 #value_template: '{{ value_json.has_update }}' value_template: >- {% if value_json.has_update == True %} @@ -230,7 +230,7 @@ scan_interval: 43200 resource: http://shelly9.giorgioravera.it/status method: GET - name: shelly9_status + name: shelly9 #value_template: '{{ value_json.has_update }}' value_template: >- {% if value_json.has_update == True %} @@ -258,7 +258,7 @@ scan_interval: 43200 resource: http://shelly10.giorgioravera.it/status method: GET - name: shelly10_status + name: shelly10 #value_template: '{{ value_json.has_update }}' value_template: >- {% if value_json.has_update == True %} @@ -286,7 +286,7 @@ scan_interval: 43200 resource: http://shelly11.giorgioravera.it/status method: GET - name: shelly11_status + name: shelly11 #value_template: '{{ value_json.has_update }}' value_template: >- {% if value_json.has_update == True %} @@ -314,7 +314,7 @@ # scan_interval: 43200 # resource: http://shellybulb.giorgioravera.it/status # method: GET -# name: shellybulb_status +# name: shellybulb # #value_template: '{{ value_json.has_update }}' # value_template: >- # {% if value_json.has_update == True %} @@ -342,7 +342,7 @@ scan_interval: 43200 resource: http://shellyem.giorgioravera.it/status method: GET - name: shellyem_status + name: shellyem #value_template: '{{ value_json.has_update }}' value_template: >- {% if value_json.has_update == True %} @@ -370,7 +370,7 @@ # scan_interval: 43200 # resource: http://shellyplugs.giorgioravera.it/status # method: GET -# name: shellyplugs_status +# name: shellyplugs # #value_template: '{{ value_json.has_update }}' # value_template: >- # {% if value_json.has_update == True %} -- 2.47.3