]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Replaced REST sensor for shelly firmware update with native integration sensor
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Sun, 15 Aug 2021 18:59:29 +0000 (20:59 +0200)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Sun, 15 Aug 2021 18:59:29 +0000 (20:59 +0200)
.storage/lovelace.lovelace_dispositivi
automations/update_notifications.yaml
packages/shelly/shelly_groups.yaml
packages/shelly/shelly_sensor.yaml [deleted file]

index c64032eb4bf69b0877b6959ad007ce002eaebd41..4ef301df6419a30bfebebc92f91ab0559fa5f990 100644 (file)
                 },
                 {
                     "title": "Shelly",
-                    "type": "sidebar",
                     "layout": {
                         "grid-template-columns": "auto auto auto",
                         "grid-template-rows": "auto",
                             "type": "entities",
                             "entities": [
                                 {
-                                    "entity": "sensor.shelly1"
+                                    "entity": "binary_sensor.tapparella_sala_overheating"
                                 },
                                 {
-                                    "entity": "sensor.shelly2"
+                                    "entity": "binary_sensor.luce_sala_overheating"
                                 },
                                 {
-                                    "entity": "sensor.shelly3"
+                                    "entity": "binary_sensor.luci_bagno_overheating"
                                 },
                                 {
-                                    "entity": "sensor.shelly4"
+                                    "entity": "binary_sensor.luce_camera_overheating"
+                                }
+                            ],
+                            "title": "Surriscaldamento"
+                        },
+                        {
+                            "type": "entities",
+                            "entities": [
+                                {
+                                    "entity": "binary_sensor.tapparella_cucina_firmware_update"
                                 },
                                 {
-                                    "entity": "sensor.shelly5"
+                                    "entity": "binary_sensor.tapparella_sala_firmware_update"
                                 },
                                 {
-                                    "entity": "sensor.shelly6"
+                                    "entity": "binary_sensor.tapparella_studio_firmware_update"
                                 },
                                 {
-                                    "entity": "sensor.shelly7"
+                                    "entity": "binary_sensor.tapparella_camera_firmware_update"
                                 },
                                 {
-                                    "entity": "sensor.shelly8"
+                                    "entity": "binary_sensor.luce_corridoio_firmware_update"
                                 },
                                 {
-                                    "entity": "sensor.shelly9"
+                                    "entity": "binary_sensor.luce_cucina_firmware_update"
                                 },
                                 {
-                                    "entity": "sensor.shelly10"
+                                    "entity": "binary_sensor.luce_sala_firmware_update"
                                 },
                                 {
-                                    "entity": "sensor.shelly11"
+                                    "entity": "binary_sensor.luci_bagno_firmware_update"
                                 },
                                 {
-                                    "entity": "sensor.shellyem"
+                                    "entity": "binary_sensor.luce_studio_firmware_update"
+                                },
+                                {
+                                    "entity": "binary_sensor.luce_camera_firmware_update"
+                                },
+                                {
+                                    "entity": "binary_sensor.luce_balcone_firmware_update"
+                                },
+                                {
+                                    "entity": "binary_sensor.shelly_em_firmware_update"
                                 }
                             ],
-                            "title": "Aggiornamenti Disponibili",
-                            "view_layout": {
-                                "position": "sidebar"
-                            }
+                            "title": "Disponibilit\u00e0 Aggiornamenti"
+                        },
+                        {
+                            "type": "entities",
+                            "entities": [
+                                {
+                                    "entity": "binary_sensor.luce_sala_overpowering"
+                                },
+                                {
+                                    "entity": "binary_sensor.luce_bagno_overpowering"
+                                },
+                                {
+                                    "entity": "binary_sensor.luce_specchio_overpowering"
+                                },
+                                {
+                                    "entity": "binary_sensor.luce_camera_overpowering"
+                                },
+                                {
+                                    "entity": "binary_sensor.shelly_em_overpowering"
+                                }
+                            ],
+                            "title": "Sovraccarico"
                         }
                     ]
                 }
index fcb5e5f2dd6041055d8e5bcee9fa615dabc8d7ef..f261cb4e1833b77162c8b5ae7d145e992c020f01 100644 (file)
@@ -57,7 +57,7 @@
           "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
+              -> {{ state_attr(entity_id, 'friendly_name')|replace(" - Aggiornamento Firmware", "") }}: {{ state_attr(entity_id, 'latest_stable_version') }}\r
             {% endif %}\r
           {%- endfor %}\r
         notification_id: "update"\r
index 21580db7fc54dbb4fb300c0c1f18fff732f7b1fa..c0508f7c7b8a65b45bd4198b02d6e8cd6d157b1f 100644 (file)
@@ -7,17 +7,16 @@ group:
     name: Shelly Devices
     icon: mdi:alpha-s-box
     entities:
-      - 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
+      - binary_sensor.tapparella_cucina_firmware_update
+      - binary_sensor.tapparella_sala_firmware_update
+      - binary_sensor.tapparella_studio_firmware_update
+      - binary_sensor.tapparella_camera_firmware_update
+      - binary_sensor.luce_corridoio_firmware_update
+      - binary_sensor.luce_cucina_firmware_update
+      - binary_sensor.luce_sala_firmware_update
+      - binary_sensor.luci_bagno_firmware_update
+      - binary_sensor.luce_studio_firmware_update
+      - binary_sensor.luce_camera_firmware_update
+      - binary_sensor.luce_balcone_firmware_update
+      #- binary_sensor.luce_divano_firmware_update
+      - binary_sensor.shelly_em_firmware_update
diff --git a/packages/shelly/shelly_sensor.yaml b/packages/shelly/shelly_sensor.yaml
deleted file mode 100644 (file)
index 7e415cc..0000000
+++ /dev/null
@@ -1,382 +0,0 @@
-######################################################################
-# Shelly Package - Sensor
-######################################################################
-
-sensor:
-  ######################################################################
-  # Sensor: Shelly 1
-  ######################################################################
-  - platform: rest
-    scan_interval: 43200
-    resource: http://shelly1.giorgioravera.it/status
-    method: GET
-    name: shelly1
-    #value_template: '{{ value_json.has_update }}'
-    value_template: >-
-      {% if value_json.has_update == True %}
-        on
-      {% else %}
-        off
-      {% endif %}
-    authentication: basic
-    username: !secret shelly_user
-    password: !secret shelly_password
-    json_attributes:
-    #  - wifi_sta
-    #  - mqtt
-    #  - time
-    #  - has_update
-      - mac
-      - update
-      - uptime
-
-  ######################################################################
-  # Sensor: Shelly 2
-  ######################################################################
-  - platform: rest
-    scan_interval: 43200
-    resource: http://shelly2.giorgioravera.it/status
-    method: GET
-    name: shelly2
-    #value_template: '{{ value_json.has_update }}'
-    value_template: >-
-      {% if value_json.has_update == True %}
-        on
-      {% else %}
-        off
-      {% endif %}
-    authentication: basic
-    username: !secret shelly_user
-    password: !secret shelly_password
-    json_attributes:
-    #  - wifi_sta
-    #  - mqtt
-    #  - time
-    #  - has_update
-      - mac
-      - update
-      - uptime
-
-  ######################################################################
-  # Sensor: Shelly 3
-  ######################################################################
-  - platform: rest
-    scan_interval: 43200
-    resource: http://shelly3.giorgioravera.it/status
-    method: GET
-    name: shelly3
-    #value_template: '{{ value_json.has_update }}'
-    value_template: >-
-      {% if value_json.has_update == True %}
-        on
-      {% else %}
-        off
-      {% endif %}
-    authentication: basic
-    username: !secret shelly_user
-    password: !secret shelly_password
-    json_attributes:
-    #  - wifi_sta
-    #  - mqtt
-    #  - time
-    #  - has_update
-      - mac
-      - update
-      - uptime
-
-  ######################################################################
-  # Sensor: Shelly 4
-  ######################################################################
-  - platform: rest
-    scan_interval: 43200
-    resource: http://shelly4.giorgioravera.it/status
-    method: GET
-    name: shelly4
-    #value_template: '{{ value_json.has_update }}'
-    value_template: >-
-      {% if value_json.has_update == True %}
-        on
-      {% else %}
-        off
-      {% endif %}
-    authentication: basic
-    username: !secret shelly_user
-    password: !secret shelly_password
-    json_attributes:
-    #  - wifi_sta
-    #  - mqtt
-    #  - time
-    #  - has_update
-      - mac
-      - update
-      - uptime
-
-  ######################################################################
-  # Sensor: Shelly 5
-  ######################################################################
-  - platform: rest
-    scan_interval: 43200
-    resource: http://shelly5.giorgioravera.it/status
-    method: GET
-    name: shelly5
-    #value_template: '{{ value_json.has_update }}'
-    value_template: >-
-      {% if value_json.has_update == True %}
-        on
-      {% else %}
-        off
-      {% endif %}
-    authentication: basic
-    username: !secret shelly_user
-    password: !secret shelly_password
-    json_attributes:
-    #  - wifi_sta
-    #  - mqtt
-    #  - time
-    #  - has_update
-      - mac
-      - update
-      - uptime
-
-  ######################################################################
-  # Sensor: Shelly 6
-  ######################################################################
-  - platform: rest
-    scan_interval: 43200
-    resource: http://shelly6.giorgioravera.it/status
-    method: GET
-    name: shelly6
-    #value_template: '{{ value_json.has_update }}'
-    value_template: >-
-      {% if value_json.has_update == True %}
-        on
-      {% else %}
-        off
-      {% endif %}
-    authentication: basic
-    username: !secret shelly_user
-    password: !secret shelly_password
-    json_attributes:
-    #  - wifi_sta
-    #  - mqtt
-    #  - time
-    #  - has_update
-      - mac
-      - update
-      - uptime
-
-  ######################################################################
-  # Sensor: Shelly 7
-  ######################################################################
-  - platform: rest
-    scan_interval: 43200
-    resource: http://shelly7.giorgioravera.it/status
-    method: GET
-    name: shelly7
-    #value_template: '{{ value_json.has_update }}'
-    value_template: >-
-      {% if value_json.has_update == True %}
-        on
-      {% else %}
-        off
-      {% endif %}
-    authentication: basic
-    username: !secret shelly_user
-    password: !secret shelly_password
-    json_attributes:
-    #  - wifi_sta
-    #  - mqtt
-    #  - time
-    #  - has_update
-      - mac
-      - update
-      - uptime
-
-  ######################################################################
-  # Sensor: Shelly 8
-  ######################################################################
-  - platform: rest
-    scan_interval: 43200
-    resource: http://shelly8.giorgioravera.it/status
-    method: GET
-    name: shelly8
-    #value_template: '{{ value_json.has_update }}'
-    value_template: >-
-      {% if value_json.has_update == True %}
-        on
-      {% else %}
-        off
-      {% endif %}
-    authentication: basic
-    username: !secret shelly_user
-    password: !secret shelly_password
-    json_attributes:
-    #  - wifi_sta
-    #  - mqtt
-    #  - time
-    #  - has_update
-      - mac
-      - update
-      - uptime
-
-  ######################################################################
-  # Sensor: Shelly 9
-  ######################################################################
-  - platform: rest
-    scan_interval: 43200
-    resource: http://shelly9.giorgioravera.it/status
-    method: GET
-    name: shelly9
-    #value_template: '{{ value_json.has_update }}'
-    value_template: >-
-      {% if value_json.has_update == True %}
-        on
-      {% else %}
-        off
-      {% endif %}
-    authentication: basic
-    username: !secret shelly_user
-    password: !secret shelly_password
-    json_attributes:
-    #  - wifi_sta
-    #  - mqtt
-    #  - time
-    #  - has_update
-      - mac
-      - update
-      - uptime
-
-  ######################################################################
-  # Sensor: Shelly 10
-  ######################################################################
-  - platform: rest
-    scan_interval: 43200
-    resource: http://shelly10.giorgioravera.it/status
-    method: GET
-    name: shelly10
-    #value_template: '{{ value_json.has_update }}'
-    value_template: >-
-      {% if value_json.has_update == True %}
-        on
-      {% else %}
-        off
-      {% endif %}
-    authentication: basic
-    username: !secret shelly_user
-    password: !secret shelly_password
-    json_attributes:
-    #  - wifi_sta
-    #  - mqtt
-    #  - time
-    #  - has_update
-      - mac
-      - update
-      - uptime
-
-  ######################################################################
-  # Sensor: Shelly 11
-  ######################################################################
-  - platform: rest
-    scan_interval: 43200
-    resource: http://shelly11.giorgioravera.it/status
-    method: GET
-    name: shelly11
-    #value_template: '{{ value_json.has_update }}'
-    value_template: >-
-      {% if value_json.has_update == True %}
-        on
-      {% else %}
-        off
-      {% endif %}
-    authentication: basic
-    username: !secret shelly_user
-    password: !secret shelly_password
-    json_attributes:
-    #  - wifi_sta
-    #  - mqtt
-    #  - time
-    #  - has_update
-      - mac
-      - update
-      - uptime
-
-  ######################################################################
-  # Sensor: Shelly Bulb
-  ######################################################################
-  #- platform: rest
-  #  scan_interval: 43200
-  #  resource: http://shellybulb.giorgioravera.it/status
-  #  method: GET
-  #  name: shellybulb
-  #  #value_template: '{{ value_json.has_update }}'
-  #  value_template: >-
-  #    {% if value_json.has_update == True %}
-  #      on
-  #    {% else %}
-  #      off
-  #    {% endif %}
-  #  authentication: basic
-  #  username: !secret shelly_user
-  #  password: !secret shelly_password
-  #  json_attributes:
-  #  #  - wifi_sta
-  #  #  - mqtt
-  #  #  - time
-  #  #  - has_update
-  #    - mac
-  #    - update
-  #    - uptime
-
-  ######################################################################
-  # Sensor: Shelly EM
-  ######################################################################
-  - platform: rest
-    scan_interval: 43200
-    resource: http://shellyem.giorgioravera.it/status
-    method: GET
-    name: shellyem
-    #value_template: '{{ value_json.has_update }}'
-    value_template: >-
-      {% if value_json.has_update == True %}
-        on
-      {% else %}
-        off
-      {% endif %}
-    authentication: basic
-    username: !secret shelly_user
-    password: !secret shelly_password
-    json_attributes:
-    #  - wifi_sta
-    #  - mqtt
-    #  - time
-    #  - has_update
-      - mac
-      - update
-      - uptime
-
-  ######################################################################
-  # Sensor: Shelly Plug S
-  ######################################################################
-  #- platform: rest
-  #  scan_interval: 43200
-  #  resource: http://shellyplugs.giorgioravera.it/status
-  #  method: GET
-  #  name: shellyplugs
-  #  #value_template: '{{ value_json.has_update }}'
-  #  value_template: >-
-  #    {% if value_json.has_update == True %}
-  #      on
-  #    {% else %}
-  #      off
-  #    {% endif %}
-  #  authentication: basic
-  #  username: !secret shelly_user
-  #  password: !secret shelly_password
-  #  json_attributes:
-  #  #  - wifi_sta
-  #  #  - mqtt
-  #  #  - time
-  #  #  - has_update
-  #    - mac
-  #    - update
-  #    - uptime