Variable Dashboard

Somthing that I really surprised is not yet a thing is to create a view lovelace dashboard that builds according a variable (that then can be used in cards as filters for example)

In my use case, I would like to create a standarized dashboard for rooms (Area). So it just lists all devices in the room, in the templated dashboard that I created. The issues comes primarly when I like to change this “default” view as now copy pasting is not very helpfull anymore.

Here some examples:

Overview Dashboard loading the different room:

First room as example


Second room in comparison

All I would need is a variable filter for the Area for this to be fully dynamic:

I have also created a second dashboard build on a Dropdown, but here its the issue that is global for all users and also very limited cards do support it:

  - theme: Backend-selected
    title: lander
    path: lander
    badges: []
    cards:
      - type: entities
        entities:
          - input_select.dash_area_selector
      - type: custom:auto-entities
        filter:
          template: >-
            {{ expand(states.light) |selectattr('entity_id', 'in',
            area_entities(states('input_select.dash_area_selector')))|map(attribute='entity_id')|list}}
        show_empty: true
        card:
          type: entities
          title: Lichter
      - type: custom:auto-entities
        filter:
          template: >-
            {{ expand(states.cover) |selectattr('entity_id', 'in',
            area_entities(states('input_select.dash_area_selector')))|map(attribute='entity_id')|list}}
        show_empty: true
        card:
          type: entities
          title: Storen
      - type: custom:auto-entities
        filter:
          template: >-
            {{ expand(states.switch) |selectattr('entity_id', 'in',
            area_entities(states('input_select.dash_area_selector')))|map(attribute='entity_id')|list}}
        show_empty: true
        card:
          type: entities
          title: Schalter
      - type: custom:auto-entities
        filter:
          template: >-
            {{ expand(states.input_button) |selectattr('entity_id', 'in',
            area_entities(states('input_select.dash_area_selector')))|map(attribute='entity_id')|list}}
        show_empty: true
        card:
          type: entities
          title: Trigger
      - type: custom:auto-entities
        filter:
          template: >-
            {{ expand(states.media_player) |selectattr('entity_id', 'in',
            area_entities(states('input_select.dash_area_selector')))|map(attribute='entity_id')|list}}
        show_empty: false
        card:
          type: entities
          title: Mediaplayer


Finally found a way to do this:

Absolutly loving it. Am now able to create a template for an area.

1 Like