How to extract the “name_by_user” and “id” in templates

I recently updated from 2024.2 to 2024.3. 80+% of my automations no longer work because the device_id: for my devices in core.device_registry somehow changed. Can someone tell me what to put in developer tools\template to extract the “name_by_user” and “id”.

I thought I could restore the old version of HA, get this info, then compare this with the new version and make the necessary changes. Thanks…

If you are referring to the name of the device, this will return the name set by the user
{{ device_attr('cover.floris_links', 'name_by_user') }}

It will return none if no name is set, and the default device name set by the integration is used, which can be found with: {{ device_attr('cover.floris_links', 'name') }}

I hoping to be able to list all devices (name_by_user) with their corresponding ID.

For example in core.device_registry I’m looking at:

“name_by_user”: “(Aqara) Water Leak Sensor”,
“id”: “ecf546d569785c1dade42e2fb60aa383”,

“name_by_user”: “Neo Zigbee”,
“id”: “71b37ae04eaf5e4556cdc6b36597eb53”

Too late now, but for the future

Something like this?

{% set devices = states
  | map(attribute='entity_id')
  | map('device_id')
  | unique
  | select()
  | list
{% set ns = namespace(by_user=[], by_int=[]) %}
{% for d in devices %}
  {% if device_attr(d, 'name_by_user') is none %}
    {% set ns.by_int = ns.by_int + [dict(id=d, name=device_attr(d, 'name'))] %}
  {% else %}
    {% set ns.by_user = ns.by_user + [dict(id=d, name=device_attr(d, 'name_by_user'))] %}
  {% endif %}
{% endfor %}

{{ ns.by_user }}
1 Like

Thanks… I wish I saw that earlier…

Exactly what I was looking for. Many Thanks…