+++ /dev/null
-######################################################################
-# Update Notification: HACS
-######################################################################
-
-- alias: "Update Notification: HACS"
-
- trigger:
- - platform: numeric_state
- entity_id: sensor.hacs
- above: 0
-
- - platform: homeassistant
- event: start
-
- condition:
- condition: numeric_state
- entity_id: sensor.hacs
- above: 0
-
- action:
- - delay: '00:00:15'
- - 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 %}
- notification_id: "update"
- enable_persistent: true
-
- - service: input_boolean.turn_on
- entity_id: input_boolean.update_hacs
-
-######################################################################
-# Update: Aknowledge update
-#
-# Actions:
-# - persistent_notification.dismiss
-######################################################################
-- alias: "Update: Riconoscimento Aggiornamenti"
-
- trigger:
- platform: state
- entity_id:
- - input_boolean.update_homeassistant
- - input_boolean.update_shelly
- - input_boolean.update_hacs
- to: 'off'
-
- action:
- - service: persistent_notification.dismiss
- data_template:
- notification_id: "update"
+++ /dev/null
-######################################################################
-# Group Update Availability
-######################################################################
-
-update:
- name: Aggiornamenti Disponibili
- icon: mdi:cellphone-arrow-down
- entities:
- - input_boolean.update_homeassistant
- - input_boolean.update_shelly
- - input_boolean.update_hacs
+++ /dev/null
-######################################################################
-# Update: Home Assistant
-######################################################################
-
-update_homeassistant:
- name: Aggiornamento Home Assistant
- initial: off
- icon: mdi:cellphone-arrow-down
-
-######################################################################
-# Update: Shelly
-######################################################################
-
-update_shelly:
- name: Aggiornamento Shelly
- initial: off
- icon: mdi:cellphone-arrow-down
-
-######################################################################
-# Update: HACS
-######################################################################
-
-update_hacs:
- name: Aggiornamenti HACS
- initial: off
- icon: mdi:cellphone-arrow-down
--- /dev/null
+######################################################################
+# Update Package - Template - Sensor
+######################################################################
+
+#template:
+# - sensor:
+# # Pending Update
+# - name: pending_update
+# state: >
+# {{ states.update | default([]) | selectattr('state','eq','on') | list | count | int(0) }}
+
+automation:
+
+ ######################################################################
+ # Update Notification: HACS
+ ######################################################################
+ - alias: "Update: HACS Notification"
+
+ trigger:
+ - platform: numeric_state
+ entity_id: sensor.hacs
+ above: 0
+
+ - platform: homeassistant
+ event: start
+
+ condition:
+ condition: numeric_state
+ entity_id: sensor.hacs
+ above: 0
+
+ action:
+ - delay: '00:00:15'
+ - 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 %}
+ notification_id: "update"
+ enable_persistent: true
+
+ - service: input_boolean.turn_on
+ entity_id: input_boolean.update_hacs
+
+ ######################################################################
+ # Update: Aknowledge update
+ #
+ # Actions:
+ # - persistent_notification.dismiss
+ ######################################################################
+ - alias: "Update: Riconoscimento Aggiornamenti"
+
+ trigger:
+ platform: state
+ entity_id:
+ #- input_boolean.update_homeassistant
+ - input_boolean.update_hacs
+ - input_boolean.update_shelly
+ to: 'off'
+
+ action:
+ - service: persistent_notification.dismiss
+ data_template:
+ notification_id: "update"
--- /dev/null
+######################################################################
+# Update Package - Types - Input Booleans
+######################################################################
+
+input_boolean:
+ # Home Assistant
+ #update_homeassistant:
+ # name: Aggiornamento Home Assistant
+ # initial: off
+ # icon: mdi:cellphone-arrow-down
+
+ # HACS
+ update_hacs:
+ name: Aggiornamenti HACS
+ initial: off
+ icon: mdi:cellphone-arrow-down
+
+ # Shelly
+ update_shelly:
+ name: Aggiornamento Shelly
+ initial: off
+ icon: mdi:cellphone-arrow-down
+
+######################################################################
+# Update Package - Types - Group
+######################################################################
+
+group:
+
+ ######################################################################
+ # Group Update Availability
+ ######################################################################
+ update:
+ name: Aggiornamenti Disponibili
+ icon: mdi:cellphone-arrow-down
+ entities:
+ #- input_boolean.update_homeassistant
+ - input_boolean.update_hacs
+ - input_boolean.update_shelly