frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Add `entity_id` to states panel in developer tools

Open TheHolyRoger opened this issue 3 years ago • 19 comments
trafficstars

Proposed change

This adds the entity_id to the states panel, as when using the entity picker it only shows the entity name in this panel.

Type of change

  • [ ] Dependency upgrade
  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [X] New feature (thank you!)
  • [ ] Breaking change (fix/feature causing existing functionality to break)
  • [ ] Code quality improvements to existing code or addition of tests

Additional information

  • This PR is related to issue or discussion:
  • https://community.home-assistant.io/t/2022-5-streamlining-settings/418477/95?u=theholyroger

As discussed on the forums. The alternative option would be to only use the entity_id when using the entiy picker of course, but think it's nicer to show the name there myself.

Checklist

  • [X] The code change is tested and works locally.
  • [X] There is no commented out code in this PR.
  • [ ] Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

TheHolyRoger avatar May 04 '22 22:05 TheHolyRoger

Really appreciated! Would bring back former workflow.

pedolsky avatar May 04 '22 22:05 pedolsky

Why not use the copy entity_id button, that is available on each entry in the table?

frenck avatar May 04 '22 22:05 frenck

Why not use the copy entity_id button, that is available on each entry in the table?

This isn't for copying the entity_id, it's to display the entity_id of the selected entity in the states panel, which is currently not displayed at all if you use the entity picker/selector

TheHolyRoger avatar May 04 '22 22:05 TheHolyRoger

@TheHolyRoger, could you clarify: may this added "entity_id" field be used to SELECT a required entity or this field is read-only and contains an ID of the already selected entity?

Actually, in any case this field will be useful. In the worst case my workflow will be:

  1. Type sensor.my_favourite_sensor_xyz in the upper "entity" field.
  2. This field contains a friendly_name of the selected sensor (or pseudo friendly_name like " My favourite sensor xyz").
  3. The new added "entity_id" field contains the inputted name (step 1).

ildar170975 avatar May 04 '22 22:05 ildar170975

@TheHolyRoger TheHolyRoger, could you clarify: may this added "entity_id" field be used to SELECT a required entity or this field is read-only and contains an ID of the already selected entity?

Actually, in any case this field will be useful. In the worst case my workflow will be:

  1. Type sensor.my_favourite_sensor_xyz in the upper "entity" field.
  2. This field contains a friendly_name of the selected sensor (or pseudo friendly_name like " My favourite sensor xyz").
  3. The new added "entity_id" field contains the inputted name (step 1).

It's a read-only field to display the selected entity

TheHolyRoger avatar May 04 '22 22:05 TheHolyRoger

I like this PR, but I would like to see an overall correction of this last changes, not only on dev tools state.

The displayed name is not unique, not here nor in many other areas of HA. So you don't know anymore, which entity is selected and have to double-check e.g. always yaml-more.

So in general, the should be an option (users choice) to display id and name or only name (or perhaps only entity id on top) in such fields.

emufan avatar May 05 '22 06:05 emufan

I like this PR, but I would like to see an overall correction of this last changes, not only on dev tools state.

The displayed name is not unique, not here nor in many other areas of HA. So you don't know anymore, which entity is selected and have to double-check e.g. always yaml-more.

So in general, the should be an option (users choice) to display id and name or only name (or perhaps only entity id on top) in such fields.

Can you give me some more examples of where you mean? The entity picker component would be one easy place to change it which is used on lots of pages, but would be great if you can show screens of other areas you mean

TheHolyRoger avatar May 05 '22 08:05 TheHolyRoger

Double-check with https://github.com/home-assistant/frontend/discussions/12304 or several other examples in https://github.com/home-assistant/frontend/issues/11938

emufan avatar May 05 '22 08:05 emufan

Appreciate this pull request - helps with identifying entity_id of an entity quickly when reviewing automations in the yaml, especially when using dev tools to quickly search for an entity.

eoura2 avatar May 05 '22 11:05 eoura2

We can just remove the select input at the top and replace it with this field. This page should use the table for sorting the entities and then click one can fill the above.

zsarnett avatar May 05 '22 12:05 zsarnett

We can just remove the select input at the top and replace it with this field. This page should use the table for sorting the entities and then click one can fill the above.

But those two options behave differently in terms of search logic. The dropdown / selector uses sequence matching (so "msonos" easily finds my Sonos media players) whereas the table requires me to input "m*sonos" to find those.

Plus the dropdown has the entity images for easy visual identification. So I personally always use the selector, never the table where is have to scroll potentially rather far to find what I am looking for (e.g. even with only two Sonos media players since they have a lot of attributes => lot of vertical space).

spacegaier avatar May 06 '22 19:05 spacegaier

Yes. It will come with a cahnge of search for some. But we can update the search in the table to use the same logic

The selector has no real purpose if you can use the table as well

zsarnett avatar May 06 '22 19:05 zsarnett

The selector has no real purpose if you can use the table as well

I rather disagree with that statement. It is much faster to find the entity you are looking for in the selector, since in a small list you see all potential matches whereas the table requires scrolling to find what you are looking for (plus no icons / entity images). Then once you clicked the entity in the table, you need to scroll up again to actually do something.

=> So I would consider that quite a big UX downgrade and not in line with our vision to streamline the UI 😜 this year.

spacegaier avatar May 06 '22 19:05 spacegaier

We can scroll you back up automatically 😉 UX fixed

zsarnett avatar May 06 '22 19:05 zsarnett

I rather disagree with that statement. It is much faster to find the entity you are looking for in the selector, since in a small list you see all potential matches whereas the table requires scrolling to find ...

This was/is my workflow as well. I'm using the top part of the page and only sometimes the table. And because of this I already didn't like that was hidden some versions ago. And would still like that my settings (open/close) is remembered.

emufan avatar May 06 '22 19:05 emufan

If it is just for finding an entity, the quick bar would be better maybe? (press e)

bramkragten avatar May 09 '22 15:05 bramkragten

If it is just for finding an entity, the quick bar would be better maybe? (press e)

No, I am still talking about finding an entity here in the context of the dev tools, so finding and then seeing and changing its state. So quick bar does not come into play here.

spacegaier avatar May 09 '22 15:05 spacegaier

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.

github-actions[bot] avatar Aug 11 '22 03:08 github-actions[bot]

Still valid anyhow. Having no entity_id but friendly twice is still not good.

emufan avatar Aug 11 '22 05:08 emufan

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.

github-actions[bot] avatar Nov 23 '22 09:11 github-actions[bot]

Still valid anyhow. Having no entity_id but friendly twice is still not good. But would even be better to have a general solution everywhere to distinguish, not only here.

emufan avatar Nov 23 '22 09:11 emufan

This has been fixed in the entity picker

bramkragten avatar Jun 21 '23 09:06 bramkragten