I am not sure if I just missed something, or if it’s not (yet) possible to link an alias to an entity_id.
So in short, is there a way to relate voice aliases to their entity_id?
Here’s my story
I created a small custom sentence to join/unjoin my speakers using a script. The thing is that the variable name holds the alias I mention in the instruction instead of the entity_id where the alias refers to. Since the variables are sent to a script called script.sonos_group_manager, I could just “search” for the entity_id in the script and trigger the actions from that point forward. But I haven’t found a way to get from the alias to the entity_id.
I was hoping for an attribute to filter on or maybe a function, like you have at devices and areas, to trace back the entity_id or device_id.
Anyone an idea how to achieve the goal of linking an alias to an entity_id?
There are many ways to do this, but we’d need more information on what type of entity you’re trying to get. Multiple entities can have the same name, so you’d need to intellegently select the correct one based on the context.
In my particular case I want to find entities in the domain media_player and with manufacturer ‘Sonos’.
If I just have a starting point, I might be able to solve the puzzle.
Like if I can get all entities that match on the alias (not the friendly_name) ‘Kitchen’ I more or less know how to drill down using for example:
is_device_attr(<entity_id>, 'manufacturer', 'Sonos')
and
Yeah, I get that part, but it’s the link to/from the alias.
In the image below I have a media player the alias ‘Kitchen’, so now I can use a voice command that points to the name ‘Kitchen’.
Now I want to know the entity_id of the speaker that has the alias ‘Kitchen’.
What I hoped for is something like you can do with areas. There is no link in the attributes from an entity to the area, but you can do this for example: