Hi, all!
Till the new HACS version, I was using an automation, in order to get notified of new updates for HACS addons:
alias: Notify - New HACS Updates (Persistent Notification)
description: ""
trigger:
- platform: state
entity_id:
- sensor.hacs
condition: []
action:
- if:
- condition: template
value_template: "{{ states(\"sensor.hacs\") | int != 0 }}"
then:
- data:
message: >
{% set ns = namespace(value="New HACS Updates - " ~
now().strftime('%-d %b, %H:%M') ~ "\n") %} {% for rep in
state_attr('sensor.hacs','repositories') %}
{% set ns.value = ns.value + "\n- " ~ rep.display_name | title %}
{% set ns.value = ns.value + "\n Current: " ~ rep.installed_version %}
{% set ns.value = ns.value + "\n Latest: " ~ rep.available_version %}
{% set ns.value = ns.value + "\n" %}
{% endfor %} {{ ns.value }}
notification_id: "0001"
action: persistent_notification.create
- data:
attributes:
updates_list: >
{% set ns = namespace(value="New HACS Updates - " ~
now().strftime('%-d %b, %H:%M') ~ "\n") %} {% for rep in
state_attr('sensor.hacs','repositories') %}
{% set ns.value = ns.value + "\n - " ~ rep.display_name %}
{% set ns.value = ns.value + "\n Current: " ~ rep.installed_version %}
{% set ns.value = ns.value + "\n Latest: " ~ rep.available_version %}
{% set ns.value = ns.value + "\n" %}
{% endfor %}
{% set ns.value = ns.value + "\n--------------------------------\n\n" %}
{% set ns.value = ns.value + state_attr("sensor.variable_history_hacs_updates","updates_list") %}
{% set text = ns.value.split('\n--------------------------------\n\n') %}
{{ (text[:6]) | join("\n--------------------------------\n\n") }}
replace_attributes: true
target:
entity_id: sensor.variable_history_hacs_updates
action: variable.update_sensor
else:
- data:
notification_id: "0001"
action: persistent_notification.dismiss
mode: single
Now, with the new HACS version, there is no sensor for this. Any alternative to achieve this?
Thanks in advance.