Is it possible to consolidate one automation per person into one with conditions?

I have an automation that unlocks the front door when we ring the bell, but only if one of us has arrived home within the last two minutes or the car has arrived home in the last four (since it takes a bit of extra time from ESPresense picks us up until we have parked and get to the door). This only happens once during two minutes, so nobody can sneak in right after us. This is the one for me:

alias: Unlock the dor when Mastiff comes home
description: ""
triggers:
  - trigger: mqtt
    topic: eg/Doorbell 1
    enabled: true
  - trigger: mqtt
    topic: eg/Doorbell 2
    enabled: true
conditions:
  - condition: or
    conditions:
      - condition: and
        conditions:
          - condition: state
            entity_id: device_tracker.mastiff
            state: home
          - condition: template
            value_template: >-
              {{ now() - states.device_tracker.mastiff.last_changed <
              timedelta(minutes=2) }}
      - condition: template
        value_template: >-
          {{ now() - states.device_tracker.mastiffmobilen.last_changed <
          timedelta(minutes=4) }}
  - condition: template
    value_template: >-
      {{ now() - state_attr('automation.unlock_the_door_when_mastiff_comes_home',
      'last_triggered') > timedelta(minutes=2) }}
actions:
  - data:
      entity_id: lock.dor_nede
    action: lock.unlock
mode: single

I have similar for six other people (our kids and their spouses), and I’d like to consolidate them into one. Is that possible/easy/doable or all of the above?

Not about THIS particular case, just in general:
Assume you have some automation for sensor.xxx.
It works fine.
If you need similar automations for sensor.yyy & sensor.zzz - then you may try copy/paste to have 3 similar automations - same code but different sensors.
Then if you need to change smth in an automation - you will need to repeat same in other similar ones.
Not good.
So, create a BLUEPRINT and then use it for all your sensors. You will have 3 automations - based on same blueprint.

Could be a better solution is SOME cases than pasting all sensors into one common automation.

Yeah, it is of course a nice way of doing it. But I was hoping that I could consolidate the nine I have based on a template. Not sure if it’s doable, though, and in that case I might create a blueprint.