]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Added shelly version notification with id device and version number
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Thu, 18 Mar 2021 20:19:56 +0000 (21:19 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Thu, 18 Mar 2021 20:19:56 +0000 (21:19 +0100)
automations/update_notifications.yaml
groups/shelly.yaml
log/history.yaml
log/logbook.yaml
log/recorder.yaml
scripts/shelly.yaml
sensor/shelly.yaml

index 380e544a8b2d15327bf0d64ceaefc296572f5453..fcb5e5f2dd6041055d8e5bcee9fa615dabc8d7ef 100644 (file)
     - service: script.notify_text\r
       data_template:\r
         title: "Shelly - Aggiornamento"\r
-        message: "Sono disponibili aggiornamenti per i dispositivi Shelly"\r
+        message: >\r
+          "Sono disponibili aggiornamenti per i dispositivi Shelly:"\r
+          {% for entity_id in states.group.shelly.attributes.entity_id %}\r
+            {% if is_state(entity_id, 'on') %}\r
+              -> {{ state_attr(entity_id, 'friendly_name') }}: {{ state_attr(entity_id, 'update').new_version }}\r
+            {% endif %}\r
+          {%- endfor %}\r
         notification_id: "update"\r
         enable_persistent: 1\r
 \r
 \r
   trigger:\r
     platform: state\r
-    entity_id: input_boolean.update\r
+    entity_id:\r
+      - input_boolean.update_homeassistant\r
+      - input_boolean.update_shelly\r
+      - input_boolean.update_hacs\r
     to: 'off'\r
 \r
   action:\r
index f50daf1d3136123a8233e7d049842c2abaa12cf8..646fb53c70ad1bc325274111df2a67c7178523f4 100644 (file)
@@ -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
index b4a61e43829713dcb450916c34082d26fd29bc2f..953174ab8ba7acee5a04753e94f97084e06345d8 100644 (file)
@@ -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
index e1c30602111e465e3874026ee216e266ff9ca51e..5b5396fb8558d35f0ce16dcbf4e24eff8c195558 100644 (file)
@@ -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
index c5ae390277e8187a50582487eb0e058cfedd5210..d25e4c5260cb41a6863137e3c9f27e3e28e5327f 100644 (file)
@@ -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
index a976e428d1e51f2fd6ab1c9dc402244f0cc4aaf5..d3aca8e5fd31dabbdc22aee068ed3356f546b305 100644 (file)
@@ -11,7 +11,7 @@ shelly_upgrade:
       data:
         topic: 'shellies/shellyswitch-55980F/command'
         payload: 'update_fw'
-        
+
     # Shelly 2 Tapparella Sala
     - service: mqtt.publish
       data:
index a6f53decb7cbd23d40dc43bf6b7bf07d3a871032..741b62f1384cc3e2a1470116ed6973e957ecd1f8 100644 (file)
@@ -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 %}
   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 %}
   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 %}
   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 %}
   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 %}
   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 %}
   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 %}
   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 %}
 #  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 %}
   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 %}
 #  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 %}