In the third step, map('state_attr', 'friendly_name'), you are left with a list of friendly names⌠just the plain strings, not a dictionary or state object. So when you get to map(attribute ='entity_id') they donât have entity_id attributes to extract.
You can think about what you did step-by-step kind of like:
{{ integration_entities('squeezebox') ---> List of entity IDs
| select('match', 'media') ---> Smaller list of entity IDs
| map('state_attr', 'friendly_name') ---> List of friendly names
| select('search', 'Bedroom speaker') ---> Smaller list of friendly names
| map(attribute ='entity_id') ---> List of Undefined values because friendly names don't have attributes
| list }} ---> Still a list of Undefined values
Is there another way to whittle the list down to the desired entities without the conversion to friendly names? Two good options might be to use Areas or Labels because both of those have related functions to list their entities.