frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Selector gets confused when different entities have the same friendly name

Open calisro opened this issue 2 years ago • 7 comments

The problem

When searching through the logbook for debugging, if I filter on a particular entity and that entity has a group with the same name, the filtering shifts as soon as focus is moved away from the screen. Makes for clumbsy debugging.

For example:

I have a group of media players called: group.all_speakers

  all_speakers:
    name: All Speakers
    entities:
      - media_player.front_office_speaker
      - media_player.kitchen_display
      - media_player.living_room_speaker
      - media_player.back_office_speaker
      - media_player.master_speaker
      - media_player.loft_speaker

and I also have an entity called: media_player.all_speakers which is really a google group of speakers

If I filter on 'group.all_speakers' in the logbook, I correctly see the group. Then I shift focus of the window, it will immediately change to the entity 'media_play.all_speakers'.

https://user-images.githubusercontent.com/5018276/172055047-68710e63-8881-42fd-9c4b-2679b9e217ec.mp4

Hope this screen capture helps recreate the issue. I would expect the entity_id to be sticky to the filter rather than trying to swap the filter based on the friendly-name.

This happens with any domains that have the same friendly_name or the same name of hte entity after the domain.

THis happens even in the history tab AND the developers tab (state state dialog). It isn't JUST the logbook.. But I assume they both use the same filtering mechanism.

What version of Home Assistant Core has the issue?

core-2022.6.2

What was the last working version of Home Assistant Core?

2022.5.6

What type of installation are you running?

Home Assistant OS

Integration causing the issue

logbook

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

calisro avatar Jun 05 '22 14:06 calisro

This is a frontend issue with the selector, and not specifically related to logbook. I'm going transfer it there.

bdraco avatar Jun 06 '22 02:06 bdraco

Just came across this myself trying to create an automation using a state condition. My calendar has the same friendly name as my person entity and I was trying to select the calendar and couldn't work out why the condition was not working until I looked at the yaml and saw it was using the person entity instead.

SgtBatten avatar Jun 09 '22 02:06 SgtBatten

Very annoying when trying to use the visual UI to create automations for weather, as the server zone and weather entity are likely to use the same name (the name of the HASS installation).

stewartadam avatar Jul 11 '22 23:07 stewartadam

I've just discovered this also with a new automation not working... image I select the 2nd entity but the first one is what the UI enters. I have to use the YAML editor...

danielbrunt57 avatar Jul 16 '22 05:07 danielbrunt57

Seems same - https://github.com/home-assistant/frontend/issues/13211 Dev tools -> Set state

ildar170975 avatar Jul 18 '22 00:07 ildar170975

Seems same - #13211 Dev tools -> Set state

Yes, looks the same to me...

danielbrunt57 avatar Jul 18 '22 04:07 danielbrunt57

Having the same issue!

aguilaair avatar Aug 09 '22 09:08 aguilaair

This sure will cause issues for new people. The selector even gets confused when building automations and since the entire entity_name isn't shown, the user will think its what they selected when it is not. I really think this bug is something that should be prioritized. I apologize for not being able to PR it myself.

calisro avatar Aug 19 '22 12:08 calisro

It's bitten me numerous times since my post on July 17th! What do ya mean it didn't trigger? "Office" occupancy sensor triggered!
Switch to YAML and it shows "Office" media player. The new "feature" is nice but it needs to be fixed! And if it can't be fixed, we need a way to turn it off!

danielbrunt57 avatar Aug 19 '22 19:08 danielbrunt57

This sure will cause issues for new people.

Why only "new people"? It much more affected experienced people since they are using entity_ids.

  1. Using selectors in UI for automations became rather pointless since it usually selects wrong entities. More reasons to use yaml-mode.
  2. Using a selector in "Dev tools -> Set state" became uneasy too - so now I have to find an entity by entity_id in the table below, then select a required entity, then it is shown in the "Set state" panel.
  3. As for using Logbook panel, History panel - same silly behaviour.
  4. As for list of automations - to filter the list now I just cannot use an entity_id - I have to use a name!

ildar170975 avatar Aug 19 '22 19:08 ildar170975

This sure will cause issues for new people.

Why only "new people"? It much more affected experienced people since they are using entity_ids.

It's a severe problem for new people as they do not yet have a clue what's going on.
It's a royal PITA for more experienced people as now we have to revert to YAML-only since we can no longer rely on the GUI.

danielbrunt57 avatar Aug 19 '22 19:08 danielbrunt57

  1. Using selectors in UI for automations became rather pointless since it usually selects wrong entities. More reasons to use yaml-mode.
  2. Using a selector in "Dev tools -> Set state" became uneasy too - so now I have to find an entity by entity_id in the table below, then select a required entity, then it is shown in the "Set state" panel.
  3. As for using Logbook panel, History panel - same silly behaviour.
  4. As for list of automations - to filter the list now I just cannot use an entity_id - I have to use a name!
  1. Lovelace too is affected!

danielbrunt57 avatar Aug 19 '22 19:08 danielbrunt57

Yes I was just bitten by this implementing 'proximity' which uses the same name implicitly as the zone its monitoring. fun. :)

calisro avatar Aug 19 '22 20:08 calisro

I can't believe such a serious bug being ignored is still not fixed. switch.kitchen light.kitchen fun.kitchen When I click on fun.kitchen, it should select fun.kitchne, no the first one switch.kitchen.

X items in a list. The list is a collection of objects. An object contains parameters: identity_id(unique object identifier) friendly name(for the search function).

The search function search trough identity_id and frendly name and displays the results in the list. When you select a list item, the identity_id is returned. If the selector works only as a text collection, it must contain identity_id only and return identity_id. That's it. You know where the serious bug is and you know how to fix it. What more can we do to fix the error?

pyramidak avatar Sep 01 '22 06:09 pyramidak

I analyzed the issue and found the root cause. PR to fix will follow soon. Issue actually came from an upstream dependency.

spacegaier avatar Sep 05 '22 21:09 spacegaier