HA Automation - multiply pattern for each device?

I have small pattern - ‘forget timer’ that make delay to switch off lamp if I forget to switch it off.
I’d like to use this pattern for all wall switches. I have saw an example and adopt it to my situation:

- id: forget timer for button
  alias: Таймер забывчивости для выключателя
  trigger:
  - entity_id:
    - switch.01005156bcddc26070bc_1
    - switch.01005156bcddc26070bc_2
    platform: state
    to: 'on'
  action:
  - delay: '[object Object]'
  - data_template:
      entity_id: '{{ trigger.entity_id }}'
    service: switch.turn_off

But problem is - here are one timer for all events and last event get priority - drop timer and use action only for last device.
How i can make separate timers and actions for each device with a smart and short code like above or I should make ‘hard style’ (multiply same code block for each device)?