Best way to use template now that group.all.xxx is not there

I have an automation that lets me know if one of my three locks did not lock as expected

        {% set unlocked = states | selectattr('entity_id', 'in', state_attr('group.all_locks','entity_id')) | selectattr('state','eq','unlocked') | map(attribute='name') | join(', ') %}
          The following locks failed to lock: {{ unlocked }}.  This was the second attempt.  Please lock using the app.

Any recommendations on best way to update this without creating a group.all_locks?

Have you searched the forum? There are multiple topics on this issue and some of them really helpful.

        {% set unlocked = states.lock | selectattr('state','eq','unlocked') | map(attribute='name') | join(', ') %}
          The following locks failed to lock: {{ unlocked }}.  This was the second attempt.  Please lock using the app.
1 Like

I did do a quick search but did not see anything specific to templates. I’ll admit I did not spend more than 10-15 minutes since this was a fairly new change. I’ll keep an eye out if I need more help in the future

Thanks, appreciate the help.