How to get the names of available HACS updates?

Hi all! I want to set up receiving notifications in telegram about the presence of HACS updates, I’m trying to write a template that receives the “display_name” parameter, and I just can’t figure out how to extract it from the available list of updates in the sensor.hacs.attributes

template:

{{ states.sensor.hacs.state }}

displays the number of available updates, in my case it is

2

template:

{{ states.sensor.hacs.attributes}}

outputs the following information:

{'repositories': [{'name': 'elax46/custom-brand-icons', 'display_name': 'Custom brand icons', 'installed_version': '2023.2.2', 'available_version': '2023.3.1'}, {'name': 'NemesisRE/kiosk-mode', 'display_name': 'Kiosk Mode', 'installed_version': '1.7.6', 'available_version': '1.7.7'}], 'unit_of_measurement': 'pending update(s)', 'icon': 'hacs:hacs', 'friendly_name': 'hacs'}

template:

{{ states.sensor.hacs.attributes.repositories}}

outputs the following information:

[{'name': 'elax46/custom-brand-icons', 'display_name': 'Custom brand icons', 'installed_version': '2023.2.2', 'available_version': '2023.3.1'}, {'name': 'NemesisRE/kiosk-mode', 'display_name': 'Kiosk Mode', 'installed_version': '1.7.6', 'available_version': '1.7.7'}]

please tell me how to get only ‘display_name’ attributes from this list of available updates?

I use the following as a notification message template

         Updates available via HACS.<br>
           Number of updates: {{ states('sensor.hacs') }}.<br>
           Repositories:<br>
           {%- for rep in state_attr('sensor.hacs', 'repositories') -%}
             - {{ rep.display_name }}: update to {{ rep.available_version }}<br>
           {%- endfor -%}
2 Likes

Thanks a lot for the tip!
A small addition, maybe it will be useful to someone:
for notifications in telegram to break the text into separate lines, instead of
<br> you need to use {{ '\n' }}

2 Likes