I am trying to control my blinds via a double tap of my light switch, I have lights switches and blinds in lots of rooms so I want one automation to do this throughout the house. The light switch stores the number of taps in an event entity. If I set the automations to trigger based on a change to that entity I can then run a query to get the area of that entity and control the blind in that area.
What I am stuck on is the entity is passed into the variable trigger.entity_id but I don't want to query trigger.entity_id I want to query the entity it contains.
I am using {{ expand('{{ trigger.entity_id }}')|map(attribute='entity_id')|map('area_name')|unique|join(', ') }}
It works if I replace trigger.entity_id with the actual entity name but what do I need to do to run the query on the entity within the trigger entity?