Can I create a parametrized dashboard where I set a variable at the top of the dashboard and the rest of the definition refers to it?

My goal is to create my own standardized dashboard for a room and I want to parametrize it on the room name.
So ideally something like this

  • set a variable in the beginning called ‘room-name-fragment’
  • then the rest of the dashboard will have a bunch of templates for various sensors that will be constructed using the room-name-fragment to e.g. have light toggling, light scenes, humidty and temperature displays, etc etc. All my sensors and lights are named in a standard pattern so this would work great.

This would be incredibly useful to avoid duplication and to also allow me to quickly make a single change that will ‘ripple’ through all the rooms. Eg if I decide to set up my mini graph cards in a specific way and change a few parameters now I need to udpate 7 more cards. Ideally I should make a single change and it will all propagate through the rest.

Basically I kind of need a dashboard template :slight_smile: in HA terms I guess.

Dwain’s Dashboard is based on areas.

It is somewhat possible, but I am not sure it is worth it.

You can make a card where you can select the room name and then store it in a helper variable and then refresh the page.
The page can then read the variable and use that for the cards, but there are things to be aware of.

First the variable will be global, so if one user looks at a page and another use change the variable, then the view will change for user one too.
a solution could be to have a different view for each user, but if a user might use multiple devices simultaneously, then each of these devices will then have to have a separate user.

Secondly you can autogenerate the values in a card, but not the entire card, which means you will have to the same number of entities in the room or make some cards with conditional cards that take this into account. It is possible, but it will be hard and probably end up in a nightmare administrative mess.

There is a solution extra, but it is only for really advanced user.
That solution is the Lovelace_gen integration, but this integration requires that all dashboards will have to be made directly in YAML.

1 Like
  1. Input select to keep a room’s name.
  2. state-switch shows a particiular card (set of cards) based on that helper. Each card - decluttering template with a “ROOM” variable. Related entities are composed based on this variable.


  1. same
  2. A card (set of cards) placed inside config-template-card; a variable “state of that helper” is used to compose a room’s name (as well as names for related entities).
1 Like

You would still have to deal with the issues I listed.

Frankly speaking, I have not read your post, just listed SOME possible variants.
Other alternatives are auto-entities with swipe and probably lovelace_gen (which you mentioned but I never tried).

this in fact what you can do with decluttering templates and even build on that using auto-entities. Unless you go hugely complex, I suggest to have a look at that card.

Using this myself:

  type: custom:fold-entity-row
#   card_mod: &toggle #!secret style_toggle_icon
#   style:
#     ha-icon:
#       $: |
#         ha-svg-icon {
#           color: var(--primary-color);
#           width: 24px;
#         }
    type: section
    label: '[[area_name]]'
  padding: 0
    - type: custom:hui-element
      card_type: area
      area: '[[area_id]]'
        style: |
          ha-card {
            box-shadow: none;
            margin: 0px 0px -16px 0px;

    - type: custom:fold-entity-row
#       card_mod: *toggle
        type: section
        label: Entities in [[area_name]]
        card_mod: #!secret style_label_margin
          style: |
            .label {
              margin-left: 0px !important;
      padding: 0
        - type: custom:auto-entities
            type: entities
              style: |
                ha-card {
                  box-shadow: none;
                  margin: 0px -16px;
            show_header_toggle: false
            template: >
            method: domain
            reverse: true

and frontend is only requiring the area_id

other example:

  type: vertical-stack

      - type: custom:button-card
        template: button_default_title
        name: '[[title]]'

      - type: custom:auto-entities
          type: custom:layout-card
          layout_type: masonry
            - domain: '[[domain]]'
              area: '[[area]]'
                type: tile
1 Like

Just to revisit an old topic.
The thing I had in mind is exactly

I’m going to slowly replace a ton of duplication with it. I wish the native dashboard in HA supported this as it’s quite a natural thing to want once you start building out your rooms (you tend to follow the same pattern).

I’ve also started using auto-entities for a slightly different use case but they are absolutely incredible and should 100% be folded into the native HA core cards.

The folding card is super interesting and I’ll look into it as well but for now I do not need it.