- alias: "Update: HACS Notification"
id: "update_hacs_notification"
- trigger:
- - platform: numeric_state
- entity_id: sensor.hacs
- above: 0
+ variables:
+ pending_update_list: >
+ {{ states.update
+ | selectattr('state','eq','on')
+ | selectattr('entity_id', 'in', states.group.hacs.attributes.entity_id)
+ | map(attribute='entity_id')
+ | list
+ }}
+ trigger:
+ - platform: state
+ entity_id: group.hacs
+ to: 'on'
- platform: homeassistant
event: start
condition:
- condition: numeric_state
- entity_id: sensor.hacs
- above: 0
+ condition: state
+ entity_id: group.hacs
+ state: 'on'
action:
- - delay: '00:00:15'
+ - delay: '00:00:10'
- service: script.notify_text
data_template:
title: "HACS - Aggiornamento"
message: >
- {% set update_number = states('sensor.hacs') %}
- {% if is_state('sensor.hacs', '1') %}
- E' disponibile un aggiornamento per i moduli HACS:
- {% else %}
- Sono disponibili {{ update_number }} aggiornamenti per i moduli HACS:
- {% endif %}
- {% for update in states.sensor.hacs.attributes['repositories'] %}
- - {{ update['display_name'] }}: {{ update['available_version'] }}
- {%- endfor %}
+ Sono disponibili {{pending_update_list | count }} aggiornamenti per i moduli HACS:
+ {% for entity_id in pending_update_list %}
+ -> {{ state_attr(entity_id, 'friendly_name')|replace(" - Aggiornamento", "") }}: {{ state_attr(entity_id, 'latest_version') }}
+ {%- endfor -%}
notification_id: "update"
enable_persistent: true
-
- service: input_boolean.turn_on
entity_id: input_boolean.update_hacs
- service: persistent_notification.dismiss
data_template:
notification_id: "update"
+
+######################################################################
+# Update: Update all
+# - update.install
+######################################################################
+
+# - alias: "Update: Aggiorna Tutto"
+# id: "update_aggiorna_tutto"
+#
+# variables:
+# pending_update_list: >
+# {{ states.update
+# | selectattr('state','eq','on')
+# | selectattr('entity_id', 'in', states.group.hacs.attributes.entity_id)
+# | map(attribute='entity_id')
+# | list
+# }}
+#
+# trigger:
+#
+# action:
+# - service: update.install
######################################################################
update:
name: Aggiornamenti Disponibili
- icon: mdi:package-up
+ icon: mdi:package-check
entities:
- #- input_boolean.update_homeassistant
- input_boolean.update_hacs
- input_boolean.update_shelly
- input_boolean.update_bticino
+
+ hacs:
+ name: HACS modules
+ icon: mdi:alpha-h-box
+ entities:
+ - update.auto_entities_update
+ - update.badge_card_update
+ - update.bar_card_update
+ - update.battery_state_card_entity_row_update
+ - update.browser_mod_update
+ - update.button_card_update
+ - update.card_mod_update
+ - update.clock_weather_card_update
+ - update.darkish_theme_update
+ - update.electrolux_care_integration_v2_not_official_update
+ - update.fold_entity_row_update
+ - update.hacs_update
+ - update.home_assistant_swipe_navigation_update
+ - update.horizon_card_update
+ - update.hui_element_update
+ - update.layout_card_update
+ - update.mercedesme_2020_update
+ - update.mini_graph_card_update
+ - update.monitor_docker_update
+ - update.mushroom_themes_update
+ - update.mushroom_update
+ - update.paper_buttons_row_update
+ - update.plotly_graph_card_update
+ - update.reeder_dark_theme_update
+ - update.shelly_em_firmware_update
+ - update.shutter_card_update
+ - update.tabbed_card_update
+ - update.vertical_stack_in_card_update
+ - update.zigbee2mqtt_networkmap_card_update