From ba52e8b9c43900533a2aa198bca1688ede63cffa Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Mon, 16 Sep 2024 14:28:14 +0200 Subject: [PATCH] Added script to update all components --- .storage/lovelace | 182 +++++++++++++++++------ .storage/lovelace.lovelace_settings | 67 ++++++--- packages/BTicino/bticino_main.yaml | 2 +- packages/BTicino/bticino_operations.yaml | 4 +- packages/shelly/shelly_main.yaml | 2 +- packages/shelly/shelly_operations.yaml | 4 +- packages/update/update_engine.yaml | 51 +++---- packages/update/update_main.yaml | 6 +- 8 files changed, 220 insertions(+), 98 deletions(-) diff --git a/.storage/lovelace b/.storage/lovelace index 3334ef7b..de9034df 100644 --- a/.storage/lovelace +++ b/.storage/lovelace @@ -18,19 +18,58 @@ { "type": "custom:badge-card", "badges": [ - "person.giorgio", - "person.laura", - "device_tracker.ff590mr_device_tracker", - "sensor.time", - "binary_sensor.porta_casa_contact", - "binary_sensor.home_mode", - "binary_sensor.guard_mode", - "binary_sensor.speech_notifications", - "binary_sensor.alarms", - "binary_sensor.central_heating", - "sensor.shelly_em_channel_1_power", - "sensor.temperatura_balcone_temperature", - "sensor.temperatura_veranda_temperature" + { + "entity": "person.giorgio", + "show_entity_picture": true + }, + { + "entity": "person.laura", + "show_entity_picture": true + }, + { + "entity": "device_tracker.ff590mr_device_tracker", + "show_entity_picture": true + }, + { + "entity": "sensor.time" + }, + { + "entity": "binary_sensor.porta_casa_contact", + "display_type": "minimal" + }, + { + "entity": "binary_sensor.home_mode", + "display_type": "minimal" + }, + { + "entity": "binary_sensor.guard_mode", + "display_type": "minimal" + }, + { + "entity": "binary_sensor.speech_notifications", + "display_type": "minimal" + }, + { + "entity": "binary_sensor.alarms", + "display_type": "minimal" + }, + { + "entity": "binary_sensor.central_heating", + "display_type": "minimal" + }, + { + "entity": "sensor.shelly_em_channel_1_power" + }, + { + "entity": "sensor.temperatura_balcone_temperature", + "display_type": "complete", + "name": "Balcone" + }, + { + "entity": "sensor.temperatura_veranda_temperature", + "display_type": "complete", + "name": "Veranda" + } ] }, { @@ -483,37 +522,59 @@ "path": "lights", "badges": [ { - "entity": "light.luce_cucina" + "type": "entity", + "entity": "light.luce_cucina", + "display_type": "complete" }, { - "entity": "light.luce_corridoio" + "type": "entity", + "entity": "light.luce_corridoio", + "display_type": "complete" }, { - "entity": "light.luce_sala" + "type": "entity", + "entity": "light.luce_sala", + "display_type": "complete" }, { - "entity": "light.luce_divano" + "type": "entity", + "entity": "light.luce_divano", + "display_type": "complete" }, { - "entity": "light.luce_bagno" + "type": "entity", + "entity": "light.luce_bagno", + "display_type": "complete" }, { - "entity": "light.luce_specchio" + "type": "entity", + "entity": "light.luce_specchio", + "display_type": "complete" }, { - "entity": "light.luce_studio" + "type": "entity", + "entity": "light.luce_studio", + "display_type": "complete" }, { - "entity": "light.luce_camera" + "type": "entity", + "entity": "light.luce_camera", + "display_type": "complete" }, { - "entity": "light.luce_dispensa" + "type": "entity", + "entity": "light.luce_dispensa", + "display_type": "complete" }, { - "entity": "light.luce_balcone" + "type": "entity", + "entity": "light.luce_balcone", + "display_type": "complete" }, { - "entity": "light.luce_veranda" + "type": "entity", + "entity": "light.luce_veranda", + "display_type": "complete" } ], "cards": [ @@ -658,16 +719,24 @@ "path": "covers", "badges": [ { - "entity": "sensor.tapparella_cucina" + "type": "entity", + "entity": "cover.tapparella_cucina", + "display_type": "complete" }, { - "entity": "sensor.tapparella_sala" + "type": "entity", + "entity": "cover.tapparella_sala", + "display_type": "complete" }, { - "entity": "sensor.tapparella_studio" + "type": "entity", + "entity": "cover.tapparella_studio", + "display_type": "complete" }, { - "entity": "sensor.tapparella_camera" + "type": "entity", + "entity": "cover.tapparella_camera", + "display_type": "complete" } ], "cards": [ @@ -1460,16 +1529,24 @@ "path": "people", "badges": [ { - "entity": "person.giorgio" + "type": "entity", + "entity": "person.giorgio", + "show_entity_picture": true }, { - "entity": "person.laura" + "type": "entity", + "entity": "person.laura", + "show_entity_picture": true }, { - "entity": "person.anna" + "type": "entity", + "entity": "person.anna", + "show_entity_picture": true }, { - "entity": "person.assunta" + "type": "entity", + "entity": "person.assunta", + "show_entity_picture": true } ], "cards": [ @@ -1654,7 +1731,10 @@ "path": "alarms", "badges": [ { - "entity": "binary_sensor.alarms" + "type": "entity", + "entity": "binary_sensor.alarms", + "show_entity_picture": false, + "display_type": "minimal" } ], "cards": [ @@ -1693,31 +1773,49 @@ "entity": "sun.sun" }, { - "entity": "sensor.valvola_cucina_temperature" + "type": "entity", + "entity": "sensor.valvola_cucina_temperature", + "display_type": "complete" }, { - "entity": "sensor.valvola_sala_temperature" + "type": "entity", + "entity": "sensor.valvola_sala_temperature", + "display_type": "complete" }, { - "entity": "sensor.valvola_bagno_temperature" + "type": "entity", + "entity": "sensor.valvola_bagno_temperature", + "display_type": "complete" }, { - "entity": "sensor.valvola_studio_temperature" + "type": "entity", + "entity": "sensor.valvola_studio_temperature", + "display_type": "complete" }, { - "entity": "sensor.valvola_camera_temperature" + "type": "entity", + "entity": "sensor.valvola_camera_temperature", + "display_type": "complete" }, { - "entity": "sensor.temperatura_balcone_temperature" + "type": "entity", + "entity": "sensor.temperatura_balcone_temperature", + "display_type": "complete" }, { - "entity": "sensor.temperatura_veranda_temperature" + "type": "entity", + "entity": "sensor.temperatura_veranda_temperature", + "display_type": "complete" }, { - "entity": "sensor.temperatura_balcone_humidity" + "type": "entity", + "entity": "sensor.temperatura_balcone_humidity", + "display_type": "complete" }, { - "entity": "sensor.temperatura_veranda_humidity" + "type": "entity", + "entity": "sensor.temperatura_veranda_humidity", + "display_type": "complete" } ], "cards": [ diff --git a/.storage/lovelace.lovelace_settings b/.storage/lovelace.lovelace_settings index 36e0a823..76abbb27 100644 --- a/.storage/lovelace.lovelace_settings +++ b/.storage/lovelace.lovelace_settings @@ -12,19 +12,36 @@ "path": "config", "badges": [ { - "entity": "binary_sensor.home_mode" + "type": "entity", + "entity": "binary_sensor.home_mode", + "display_type": "minimal" }, { - "entity": "binary_sensor.guard_mode" + "type": "entity", + "entity": "binary_sensor.guard_mode", + "display_type": "minimal" }, { - "entity": "binary_sensor.speech_notifications" + "type": "entity", + "entity": "binary_sensor.speech_notifications", + "display_type": "minimal" }, { - "entity": "binary_sensor.text_notifications" + "type": "entity", + "entity": "binary_sensor.text_notifications", + "display_type": "minimal" }, { - "entity": "binary_sensor.home_assistant_error" + "type": "entity", + "entity": "binary_sensor.home_assistant_error", + "display_type": "minimal" + }, + { + "type": "entity", + "show_name": false, + "show_state": false, + "show_icon": true, + "entity": "group.update" } ], "cards": [ @@ -88,16 +105,37 @@ }, { "entity": "sensor.server_giorgioravera_it_scadenza_del_certificato" - }, + } + ], + "show_header_toggle": false, + "title": "Informazioni Varie", + "type": "entities" + } + ], + "type": "vertical-stack" + }, + { + "cards": [ + { + "entities": [ { "entity": "group.update" }, { - "entity": "sensor.hacs" + "entity": "script.update_all" + }, + { + "entity": "script.hacs_update" + }, + { + "entity": "script.shelly_update" + }, + { + "entity": "script.bticino_update" } ], "show_header_toggle": false, - "title": "Informazioni Varie", + "title": "Aggiornamenti", "type": "entities" } ], @@ -468,19 +506,6 @@ ] } ] - }, - { - "title": "History", - "path": "s", - "icon": "mdi:history", - "type": "panel", - "badges": [], - "cards": [ - { - "type": "custom:history-explorer-card", - "recordedEntitiesOnly": true - } - ] } ], "button_card_templates": { diff --git a/packages/BTicino/bticino_main.yaml b/packages/BTicino/bticino_main.yaml index f0fcd271..f4f36d7a 100644 --- a/packages/BTicino/bticino_main.yaml +++ b/packages/BTicino/bticino_main.yaml @@ -20,7 +20,7 @@ homeassistant: group.bticino: <<: *customize - script.bticino_upgrade: + script.bticino_update: <<: *customize icon: mdi:package-up automation.bticino_update_notification: diff --git a/packages/BTicino/bticino_operations.yaml b/packages/BTicino/bticino_operations.yaml index bef7dac4..b38b6268 100644 --- a/packages/BTicino/bticino_operations.yaml +++ b/packages/BTicino/bticino_operations.yaml @@ -4,9 +4,9 @@ script: ###################################################################### - # BTicino: Upgrade + # BTicino: Update ###################################################################### - bticino_upgrade: + bticino_update: alias: "BTicino: Aggiornamento Firmware Collettivo" variables: pending_update_list: > diff --git a/packages/shelly/shelly_main.yaml b/packages/shelly/shelly_main.yaml index 785d5074..85f19032 100644 --- a/packages/shelly/shelly_main.yaml +++ b/packages/shelly/shelly_main.yaml @@ -20,7 +20,7 @@ homeassistant: group.shelly: <<: *customize - script.shelly_upgrade: + script.shelly_update: <<: *customize icon: mdi:package-up script.shelly_reboot: diff --git a/packages/shelly/shelly_operations.yaml b/packages/shelly/shelly_operations.yaml index f85c34f2..e9fd681b 100644 --- a/packages/shelly/shelly_operations.yaml +++ b/packages/shelly/shelly_operations.yaml @@ -4,9 +4,9 @@ script: ###################################################################### - # Shelly: Upgrade + # Shelly: Update ###################################################################### - shelly_upgrade: + shelly_update: alias: "Shelly: Aggiornamento Firmware Collettivo" variables: pending_update_list: > diff --git a/packages/update/update_engine.yaml b/packages/update/update_engine.yaml index 0f0c937b..609f5aee 100644 --- a/packages/update/update_engine.yaml +++ b/packages/update/update_engine.yaml @@ -75,34 +75,31 @@ automation: data_template: notification_id: "update" -###################################################################### -# Update: Update HACS -# - update.install -###################################################################### - -# - alias: "Update: Aggiorna HACS" -# id: "update_aggiorna_hacs" -# -# trigger: -# - platform: state -# entity_id: input_button.update_hacs -# -# action: -# repeat: -# for_each: > -# {{ states.update -# | selectattr('state','eq','on') -# | selectattr('entity_id', 'in', states.group.hacs.attributes.entity_id) -# | map(attribute='entity_id') -# | list -# }} -# sequence: -# - service: update.install -# target: -# entity_id: "{{ repeat.item }}" - script: - hacs_upgrade: + + ###################################################################### + # Update: Update All + # - update.install + ###################################################################### + update_all: + alias: "Update: Aggiornamento Collettivo" + variables: + pending_update_list: > + {{ states.update + | selectattr('state','eq','on') + | map(attribute='entity_id') + | list + }} + sequence: + - service: update.install + target: + entity_id: '{{ pending_update_list }}' + + ###################################################################### + # Update: Update HACS + # - update.install + ###################################################################### + hacs_update: alias: "HACS: Aggiornamento Collettivo" variables: pending_update_list: > diff --git a/packages/update/update_main.yaml b/packages/update/update_main.yaml index 5ed5ab7a..1e39c9e4 100644 --- a/packages/update/update_main.yaml +++ b/packages/update/update_main.yaml @@ -30,5 +30,7 @@ homeassistant: <<: *customize automation.update_update_acknowledgment: <<: *customize - script.hacs_upgrade: - icon: mdi:package-up \ No newline at end of file + script.update_all: + icon: mdi:package-up + script.hacs_update: + icon: mdi:package-up -- 2.47.3