Entity_id as template in trigger - possible?

Hey gurus,

I’m building up basic security system on HA. I will be gradually adding new zigbee sensors and don’t want to change automations code by adding every new sensor into automation. I want to try using naming convention for my zigbee devices like:

binary_sensor.door_sensor_<roomname_here>

I have automation that need to have following logic:
If state of any binary_sensor which name matches to patter changed - fire the automation.

I tried to create new synthetic binary sensor that is a combo of my real sensors and use that one in automations, but it doesn’t give me what I need as being activated for the first time (one sensor is ON) it will not be reactivated again when another sensor will be ON. But I want event to get triggered on any sensor event.

So I’m looking for something like (pseudocode)

trigger:
- platform: state
  entity_id_template: "sensors.entity_id.endswith('_occupancy')"
  to: 'on'

Any suggestions or hints?

There’s all kinds of examples here…

You can match on ends/begins/contains/etc…