Dashboard entities using device tracker

Hello I have sliding gate control using HA, but I want visible this entity in dashboards only if devices are in a defined locations/zones.
I have two zones HOME and EXPANDED HOME.

This work if I have only one device, but I want it for ALL devices or defined devices:

type: entities
  - type: conditional
      - condition: state
        entity: device_tracker.oneplus_a6013
        state: home
      entity: switch.hlavna_brana

You have to repeat same code for all devices.
Can create a decluttering card to reuse a code.
In case you had a clear relation between a switch & device_tracker - you could use auto-entities (google it). But it could be difficult for you.