Device IDs are driving me insane

Looking through my automations.yaml and scripts.yaml I see that HA has converted many of the Entity IDs to Device IDs.

This makes it extremely cumbersome to understand which automation is responsible for what.

  1. How can I generate a reference list of every device in my HA empire using the following format?
    <friendly name> <entity id> <device id>

  2. Perhaps I am not asking the best question. What workarounds are people using to overcome this challenge?

  3. Is it possible to force HA to stick with Entity IDs and to stop converting them to Device IDs in YAML files?

Hello Stevland Ambrose,

It will try to use them by default in the UI editor, but it to my knowledge never converts them in your existing code…

Specifically, in the green Tip box.

However, if you do prefer to see the entity ID in this drop down, you can enable it in your profile settings.

Screenshot showing the improved entity picker with the show entity ID in entity picker option enabled in my user profile.

To do so, select your profile picture in the bottom left corner of the Home Assistant UI, and under User settings enable the Display entity IDs in picker option.

Just turn them back on. It’s not converting them, (yet)

When I saw those cumbersome Device IDs in my automations.yaml I certainly didn’t think that I had been adding them, so I assumed HA was converting my code.

But now I understand that I have been adding them, through the UI, as Devices.

Best practice is to avoid Devices and add Entities.

As for all of my existing Automations and Scripts, it seems that the only solution is to manually go through each entry in the UI and replace Devices with Entities.

Not the easy solution that I had been hoping for, but I have learned something new and I thank you for your time.

I do not see that option in my Profile > User settings

Copy-paste the following template into the Template Editor. It will produce a sorted list containing the following information for every entity in your system:

friendly_name, entity_id, device name, device_id
{% for x in states | sort(attribute='name') -%}
{{ states[x.entity_id].attributes.friendly_name | default('') }}, {{ x.entity_id }}, {{ device_name(x.entity_id) }}, {{ device_id(x.entity_id) }}
{% endfor %}

Guess you are not on 2025.5.x then.

But you also mentioned that you realized that you have been using device IDs yourself. Looks like Taras has a solution for your list of device IDs and entities IDs.

You were correct. I was running 2025.1.4 I updated everything and now have the “Display entity IDs in picker” option available. Thank you for your help! :pray: