Decluttering Card Plus Contents ↓ GitHub ↗

Quick Start

Five minutes, one template, three cards. By the end you will have a reusable room card and will know how to add a fourth room with two lines.

You will need the card installed and a couple of entities to point at. Swap in your own entity IDs as you go.


Step 1 — open the raw configuration editor

Templates live at the root of a dashboard’s configuration, alongside views:. The easiest way to get there is the raw editor.

  1. Open the dashboard you want to work on.
  2. Click the pencil (top right) to start editing.
  3. Click the ⋮ menu (top right) → Raw configuration editor.

You are now looking at the whole dashboard as YAML.

The auto-generated Overview dashboard has no YAML of its own until you take it over (⋮ → Edit dashboard → Take control). A new dashboard from Settings → Dashboards is the easier place to try this.

Step 2 — add a template

At the very top of the file, above views:, add:

decluttering_templates:
  room_light:
    card:
      type: tile
      entity: '[[light]]'
      name: '[[room]]'
      features:
        - type: toggle

views:
  # …your existing views, untouched…

What each part does:

Part Meaning
decluttering_templates: The container. All your templates live under here.
room_light: The template’s name. You choose it; it must be unique on the dashboard.
card: This template holds a card. See Cards and the other content types.
'[[light]]' A variable. It gets replaced when you use the template.

A template can also carry a default: block beside card:, with a fallback value for any variable a card leaves out, written - room: Somewhere like the variables on a card. Your First Template adds one.

Quote variables that stand alone on a line. entity: '[[light]]' is right, entity: [[light]] is not valid YAML — [ starts a list. See Variables.

Click Save, then Close the raw editor.

Step 3 — use it

Still in edit mode, click + Add card, search for declutter, and pick Decluttering Card Plus. Then click Show code editor at the bottom left and enter:

type: custom:decluttering-card-plus
template: room_light
variables:
  - light: light.living_room
  - room: Living Room

You will see the card render live in the preview as you type.

The Decluttering Card Plus editor: the template picked, what it builds, and the variables box

Click Save.

variables: can be a list, every entry starting with - as above, or a plain mapping (light: light.living_room on one line, room: Living Room on the next). Both work. What matters is that the entries are indented under variables:.

Step 4 — do it again

Add two more cards the same way, changing only the variables:

type: custom:decluttering-card-plus
template: room_light
variables:
  - light: light.kitchen
  - room: Kitchen
type: custom:decluttering-card-plus
template: room_light
variables:
  - light: light.bedroom
  - room: Bedroom

Four tiles built from one template: the three above, and a Hallway added the same way

Step 5 — see the point

Go back to the raw configuration editor and add an icon to the template — one edit:

decluttering_templates:
  room_light:
    card:
      type: tile
      entity: '[[light]]'
      name: '[[room]]'
      icon: mdi:lightbulb          # <- added once
      features:
        - type: toggle

Save. All three cards change together. That is the whole idea.


Where to go next

Next step Page
The same walk, slower, from a tile you already have, with every line explained Your First Template
Give variables sensible fallbacks so you can pass fewer of them Variables
Build templates by clicking instead of typing Visual Editors
Template badges, entity rows or picture-elements icons Badges, Rows, Elements
Use the same templates on several dashboards Sharing Templates Between Dashboards
Copy a finished example Recipes