From: Giorgio Ravera Date: Wed, 3 Apr 2024 13:30:32 +0000 (+0200) Subject: Added 4411C and added BTIcino update notification X-Git-Url: http://git.giorgioravera.it/?a=commitdiff_plain;h=b1aa8f9d25e6a22b6d888748970c6a452d7cea53;p=homeassistant.git Added 4411C and added BTIcino update notification --- diff --git a/.storage/lovelace.lovelace_devices b/.storage/lovelace.lovelace_devices index d4807703..0a16a77e 100644 --- a/.storage/lovelace.lovelace_devices +++ b/.storage/lovelace.lovelace_devices @@ -4144,21 +4144,24 @@ }, { "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 } ] } @@ -4209,15 +4212,17 @@ }, { "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 } ] } @@ -4491,6 +4496,74 @@ ] } ] + }, + { + "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 + } + ] + } + ] + } + ] + } + ] } ] } diff --git a/packages/BTicino/bticino_customizations.yaml b/packages/BTicino/bticino_customizations.yaml index 133a1b63..33ff0580 100644 --- a/packages/BTicino/bticino_customizations.yaml +++ b/packages/BTicino/bticino_customizations.yaml @@ -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 index 00000000..2b71d507 --- /dev/null +++ b/packages/BTicino/bticino_groups.yaml @@ -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 diff --git a/packages/BTicino/bticino_log.yaml b/packages/BTicino/bticino_log.yaml index 92aeaa8a..6c0a236b 100644 --- a/packages/BTicino/bticino_log.yaml +++ b/packages/BTicino/bticino_log.yaml @@ -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 index 00000000..d54459f0 --- /dev/null +++ b/packages/BTicino/bticino_operations.yaml @@ -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 diff --git a/packages/update/update_engine.yaml b/packages/update/update_engine.yaml index ba436c82..79ee3c27 100644 --- a/packages/update/update_engine.yaml +++ b/packages/update/update_engine.yaml @@ -65,6 +65,7 @@ automation: entity_id: - input_boolean.update_hacs - input_boolean.update_shelly + - input_boolean.update_bticino to: 'off' action: diff --git a/packages/update/update_main.yaml b/packages/update/update_main.yaml index 2a3eb382..cbddce91 100644 --- a/packages/update/update_main.yaml +++ b/packages/update/update_main.yaml @@ -22,6 +22,8 @@ homeassistant: <<: *customize input_boolean.update_shelly: <<: *customize + input_boolean.update_bticino: + <<: *customize group.update: <<: *customize automation.update_hacs_notification: diff --git a/packages/update/update_types.yaml b/packages/update/update_types.yaml index b6e0da5f..bc118a8e 100644 --- a/packages/update/update_types.yaml +++ b/packages/update/update_types.yaml @@ -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 index 00000000..72f3839a Binary files /dev/null and b/www/images/devices/BTicino/BTI_4411C.png differ