Hi, is this not possible? I tried to add a jinja template and it seems to fail:
trigger: state
entity_id: >-
{{ expand(states.binary_sensor)
| selectattr('attributes.device_class', 'defined')
| selectattr('attributes.device_class', 'in', ['motion', 'door', 'window'])
| map(attribute='entity_id')
| list }}
error: Message malformed: Entity {{ expand(states.binary_sensor) | selectattr('attributes.device_class' is neither a valid entity ID nor a valid UUID for dictionary value @ data['entity_id']