Loop through areas

Hey guys,

i need your help. How can i loop through all areas in my HASS setup and create these auto-entities for all those areas? There is a lot of code duplication as you see in the following example for two areas:

# AREA 1
  - type: "custom:button-card"
    template: "card_title"
    label: "HWR"

  - type: "custom:auto-entities"
    card:
      type: "custom:layout-card"
      layout_type: "custom:grid-layout"
      layout:
        grid-template-rows: "min-content"
        grid-template-columns: "1fr 1fr 1fr"
        mediaquery:
              "(max-width: 1400px)":
                grid-template-columns: "1fr 1fr"
    card_param: "cards"
    filter:
      include:
        - domain: "switch"
          area: HWR
          options:
            type: "custom:button-card"
            template: "card_power_outlet"
      exclude:
        - state: "unavailable"
        - hidden_by: "*"

# AREA 2
  - type: "custom:button-card"
    template: "card_title"
    label: "Flur"

  - type: "custom:auto-entities"
    card:
      type: "custom:layout-card"
      layout_type: "custom:grid-layout"
      layout:
        grid-template-rows: "min-content"
        grid-template-columns: "1fr 1fr 1fr"
        mediaquery:
              "(max-width: 1400px)":
                grid-template-columns: "1fr 1fr"
    card_param: "cards"
    filter:
      include:
        - domain: "switch"
          area: Flur
          options:
            type: "custom:button-card"
            template: "card_power_outlet"
      exclude:
        - state: "unavailable"
        - hidden_by: "*"

Have you come up with a solution for this yet? I’ve been wanting to do something very similar but I’m having difficulties getting the auto-entities card to do anything with the areas list.

Nope, sorry :confused: