]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Added 4411C and added BTIcino update notification
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Wed, 3 Apr 2024 13:30:32 +0000 (15:30 +0200)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Wed, 3 Apr 2024 13:30:32 +0000 (15:30 +0200)
.storage/lovelace.lovelace_devices
packages/BTicino/bticino_customizations.yaml
packages/BTicino/bticino_groups.yaml [new file with mode: 0644]
packages/BTicino/bticino_log.yaml
packages/BTicino/bticino_operations.yaml [new file with mode: 0644]
packages/update/update_engine.yaml
packages/update/update_main.yaml
packages/update/update_types.yaml
www/images/devices/BTicino/BTI_4411C.png [new file with mode: 0644]

index d480770324917da5e2cce02a9158a8180ede8404..0a16a77e5dd121796d156cf5e7c1d7ad7bf35dc6 100644 (file)
                             },
                             {
                               "type": "custom:button-card",
-                              "template": "template_device_generic_button",
+                              "template": "template_device_generic_state",
                               "entity": "switch.0x0004740001583a4a_device_mode",
-                              "icon": "mdi:lightbulb-on-50"
+                              "icon": "mdi:lightbulb-on-50",
+                              "show_state": false
                             },
                             {
                               "type": "custom:button-card",
-                              "template": "template_device_generic_button",
+                              "template": "template_device_generic_state",
                               "entity": "switch.0x0004740001583a4a_led_in_dark",
-                              "icon": "mdi:led-outline"
+                              "icon": "mdi:led-outline",
+                              "show_state": false
                             },
                             {
                               "type": "custom:button-card",
-                              "template": "template_device_generic_button",
+                              "template": "template_device_generic_state",
                               "entity": "switch.0x0004740001583a4a_led_if_on",
-                              "icon": "mdi:led-outline"
+                              "icon": "mdi:led-outline",
+                              "show_state": false
                             }
                           ]
                         }
                             },
                             {
                               "type": "custom:button-card",
-                              "template": "template_device_generic_button",
+                              "template": "template_device_generic_state",
                               "entity": "switch.0x000474000159053e_led_in_dark",
-                              "icon": "mdi:led-outline"
+                              "icon": "mdi:led-outline",
+                              "show_state": false
                             },
                             {
                               "type": "custom:button-card",
-                              "template": "template_device_generic_button",
+                              "template": "template_device_generic_state",
                               "entity": "switch.0x000474000159053e_led_if_on",
-                              "icon": "mdi:led-outline"
+                              "icon": "mdi:led-outline",
+                              "show_state": false
                             }
                           ]
                         }
                   ]
                 }
               ]
+            },
+            {
+              "type": "entities",
+              "show_header_toggle": "off",
+              "style": ".card-header {\n  padding: 0px 0px 0px 0px !important;\n}\n",
+              "entities": [
+                {
+                  "type": "section",
+                  "label": "4411C - Dimmer 0x0004740000254d99"
+                },
+                {
+                  "type": "custom:hui-element",
+                  "card_type": "vertical-stack",
+                  "cards": [
+                    {
+                      "type": "horizontal-stack",
+                      "cards": [
+                        {
+                          "type": "picture",
+                          "style": "ha-card { \n    --paper-card-background-color: 'rgba(0, 0, 0, 0.0)';\n    --ha-card-background: \"rgba(0, 0, 0, 0)\";\n    --ha-card-box-shadow: 'none';\n}\n",
+                          "image": "/local/images/devices/BTicino/BTI_4411C.png",
+                          "tap_action": {
+                            "action": "none"
+                          }
+                        },
+                        {
+                          "type": "vertical-stack",
+                          "cards": [
+                            {
+                              "type": "custom:button-card",
+                              "template": "template_device_generic_state",
+                              "entity": "light.0x0004740000254d99",
+                              "name": "Stato"
+                            },
+                            {
+                              "type": "custom:button-card",
+                              "template": "template_device_firmware",
+                              "entity": "update.0x0004740000254d99",
+                              "name": "Firmare"
+                            },
+                            {
+                              "type": "custom:button-card",
+                              "template": "template_device_generic_state",
+                              "entity": "switch.0x0004740000254d99_device_mode",
+                              "icon": "mdi:lightbulb-on-50",
+                              "show_state": false
+                            },
+                            {
+                              "type": "custom:button-card",
+                              "template": "template_device_generic_state",
+                              "entity": "switch.0x0004740000254d99_led_in_dark",
+                              "icon": "mdi:led-outline",
+                              "show_state": false
+                            },
+                            {
+                              "type": "custom:button-card",
+                              "template": "template_device_generic_state",
+                              "entity": "switch.0x0004740000254d99_led_if_on",
+                              "icon": "mdi:led-outline",
+                              "show_state": false
+                            }
+                          ]
+                        }
+                      ]
+                    }
+                  ]
+                }
+              ]
             }
           ]
         }
index 133a1b6325b408b87c12db8f96cfc0728d1cf90b..33ff0580068ccb9793a23bead9383cb3bc437166 100644 (file)
@@ -6,9 +6,9 @@ homeassistant:
   customize:
 
     # BTI-NT4411C - Dimmer 0x0004740001583a4a
-    light.0x0004740001583a4a:
-      supported_color_modes: null
-      supported_features: 0
+    #light.0x0004740001583a4a:
+    #  supported_color_modes: null
+    #  supported_features: 0
     switch.0x0004740001583a4a_device_mode:
       friendly_name: "Funzione Dimmer"
     switch.0x0004740001583a4a_led_if_on:
@@ -20,6 +20,21 @@ homeassistant:
     number.0x0004740001583a4a_ballast_minimum_level:
       friendly_name: "Illuminazione minima"
 
+    # BTI-4411C - Dimmer 0x0004740000254d99
+    #light.0x0004740000254d99:
+    #  supported_color_modes: null
+    #  supported_features: 0
+    switch.0x0004740000254d99_device_mode:
+      friendly_name: "Funzione Dimmer"
+    switch.0x0004740000254d99_led_if_on:
+      friendly_name: "LED se acceso"
+    switch.0x0004740000254d99_led_in_dark:
+      friendly_name: "LED se spento"
+    number.0x0004740000254d99_ballast_maximum_level:
+      friendly_name: "Illuminazione massima"
+    number.0x0004740000254d99_ballast_minimum_level:
+      friendly_name: "Illuminazione minima"
+
     # BTI-NT4027C - Tapparella 0x000474000159053e
     cover.0x000474000159053e:
       supported_features: 15
diff --git a/packages/BTicino/bticino_groups.yaml b/packages/BTicino/bticino_groups.yaml
new file mode 100644 (file)
index 0000000..2b71d50
--- /dev/null
@@ -0,0 +1,17 @@
+######################################################################
+# BTicino Package - Group
+######################################################################
+
+group:
+  bticino:
+    name: BTicino Devices
+    icon: mdi:alpha-b-box
+    entities:
+      - update.0x0004740001583a4a
+      - update.0x0004740000254d99
+      - update.0x000474000159053e
+      - update.0x000474000025912a
+      - update.0x00047400002599cf
+      - update.0x0004740000249a4e
+      - update.0x000474000015be6b
+      - update.0x0004740000249aad
index 92aeaa8a0d2bd8899906eb5d15008cc7e21b7ad9..6c0a236bbd3977b698128cfcc6a6ba78de3cc508 100644 (file)
@@ -13,6 +13,14 @@ logbook:
       - switch.0x0004740001583a4a_led_if_on
       - switch.0x0004740001583a4a_led_in_dark
 
+      # BTI-4411C - Dimmer 0x0004740000254d99
+      - select.0x0004740000254d99_identify
+      - number.0x0004740000254d99_ballast_maximum_level
+      - number.0x0004740000254d99_ballast_minimum_level
+      - switch.0x0004740000254d99_device_mode
+      - switch.0x0004740000254d99_led_if_on
+      - switch.0x0004740000254d99_led_in_dark
+
       # BTI-NT4027C - Tapparella 0x000474000159053e
       - select.0x000474000159053e_identify
       - select.0x000474000159053e_calibration_mode
@@ -49,6 +57,14 @@ recorder:
       - switch.0x0004740001583a4a_led_if_on
       - switch.0x0004740001583a4a_led_in_dark
 
+      # BTI-4411C - Dimmer 0x0004740000254d99
+      - select.0x0004740000254d99_identify
+      - number.0x0004740000254d99_ballast_maximum_level
+      - number.0x0004740000254d99_ballast_minimum_level
+      - switch.0x0004740000254d99_device_mode
+      - switch.0x0004740000254d99_led_if_on
+      - switch.0x0004740000254d99_led_in_dark
+
       # BTI-NT4027C - Tapparella 0x000474000159053e
       - select.0x000474000159053e_identify
       - select.0x000474000159053e_calibration_mode
diff --git a/packages/BTicino/bticino_operations.yaml b/packages/BTicino/bticino_operations.yaml
new file mode 100644 (file)
index 0000000..d54459f
--- /dev/null
@@ -0,0 +1,44 @@
+
+######################################################################
+# BTicino Package - Operations Script
+######################################################################
+
+automation:
+  ######################################################################
+  # BTicino: Update Notification
+  ######################################################################
+  - alias: "BTicino: Update Notification"
+    variables:
+      pending_update_list: >
+        {{ states.update
+          | selectattr('state','eq','on')
+          | selectattr('entity_id', 'in', states.group.bticino.attributes.entity_id)
+          | map(attribute='entity_id')
+          | list
+        }}
+    trigger:
+      - platform: state
+        entity_id: group.bticino
+        to: 'on'
+      - platform: homeassistant
+        event: start
+
+    condition:
+      condition: state
+      entity_id: group.bticino
+      state: 'on'
+
+    action:
+      - delay: '00:00:10'
+      - service: script.notify_text
+        data_template:
+          title: "BTicino - Aggiornamento"
+          message: >
+            Sono disponibili {{pending_update_list | count }} aggiornamenti per i dispositivi BTicino:
+            {% for entity_id in pending_update_list %}
+                -> {{ state_attr(entity_id, 'friendly_name')|replace(" - Aggiornamento Firmware", "") }}: {{ state_attr(entity_id, 'latest_version') }}
+            {%- endfor -%}
+          notification_id: "update"
+          enable_persistent: true
+      - service: input_boolean.turn_on
+        entity_id: input_boolean.update_bticino
\ No newline at end of file
index ba436c823e224975fef13c2f3db6f54c3c92e9ad..79ee3c27aec9cbfc0d4ff9b0b312e6ef62dbabbe 100644 (file)
@@ -65,6 +65,7 @@ automation:
       entity_id:
         - input_boolean.update_hacs
         - input_boolean.update_shelly
+        - input_boolean.update_bticino
       to: 'off'
 
     action:
index 2a3eb382bb26fb57acd9012163c5627dab7c6d4f..cbddce9148975f8a6329a2e3b9bdfe624115cd9c 100644 (file)
@@ -22,6 +22,8 @@ homeassistant:
       <<: *customize
     input_boolean.update_shelly:
       <<: *customize
+    input_boolean.update_bticino:
+      <<: *customize
     group.update:
       <<: *customize
     automation.update_hacs_notification:
index b6e0da5f298247d18ee9e664b909439187226e83..bc118a8e9d4d3196b7f62b4fcf9fcbe8034ce85c 100644 (file)
@@ -17,7 +17,13 @@ input_boolean:
 
   # Shelly
   update_shelly:
-    name: Aggiornamento Shelly
+    name: Aggiornamenti Shelly
+    initial: off
+    icon: mdi:package-up
+
+  # BTicino
+  update_bticino:
+    name: Aggiornamenti BTicino
     initial: off
     icon: mdi:package-up
 
@@ -37,3 +43,4 @@ group:
       #- input_boolean.update_homeassistant
       - input_boolean.update_hacs
       - input_boolean.update_shelly
+      - input_boolean.update_bticino
diff --git a/www/images/devices/BTicino/BTI_4411C.png b/www/images/devices/BTicino/BTI_4411C.png
new file mode 100644 (file)
index 0000000..72f3839
Binary files /dev/null and b/www/images/devices/BTicino/BTI_4411C.png differ