Attribute from list of entities

I’m trying to extract the friendly name of all persons present in a zone.
Can’t get it to work.
Here is what I have:

{% set present = state_attr('zone.home','persons') %} 
{{ present }} # correctly returns a list of entity_ids: ['person.guest', 'person.sven']
{{ present|map(attribute='friendly_name')|list }}  # returns [Undefined, Undefined]
{{ expand(present)|map(attribute='friendly_name')|list }}  # returns [Undefined, Undefined]

What am I doing wrong?

1 Like

Try name instead of friendly_name.

3 Likes

Man, this was driving me crazy. I was so close! Thank you!

1 Like

For future travelers who may find this but be confused like I was, you need to expand portion.

{{ expand(present) | map(attribute='friendly_name') | list }}