Decluttering Card Plus Contents ↓ GitHub ↗

Sharing a Template

Sharing Between Dashboards covers reusing your own templates across your own dashboards. This page is about handing one to somebody else — a forum post, a Discord message, a gist — and taking one somebody hands you.

A template card’s visual editor has a Share tab. The top half writes the template out as YAML; the bottom half takes YAML in. Below that, templates other people have posted can be browsed and installed without copying anything (v1.15.0+).

The Share tab of the template editor


Exporting

Open the template card in the editor, go to Share, and copy what is in the Export box. Copy to clipboard does it in one click.

As a file (v2.1.0+)

The end of the Export box, with Copy to clipboard, Download and Copy as a post under it

Download saves the same text as a .yaml file named after the template, room_tile.yaml, for sending as an attachment or keeping a copy of beside your backups.

A template is only ever as portable as the things it is built from, and YAML on its own cannot tell you what those are — so the export says:

type: custom:decluttering-template-plus
template: room_tile
requires:
  custom_cards:
    - mushroom-template-card
default:
  - entity: sun.sun
card:
  type: custom:mushroom-template-card
  entity: "[[entity]]"
includes:
  my_button_base:
    type: custom:decluttering-template-plus
    template: my_button_base
    card:
      type: button

The Share tab export box, with the called template carried under includes

What that tells the recipient:

Anything else the export has to tell you, such as a template it could not find, is still an ordinary YAML comment above it, so it can be pasted back in as it is. They are for the person reading the text, though, not for Home Assistant to keep: a dashboard edited in the UI drops every comment when it saves, so once the template is in, the notes are gone. Put anything the recipient must still know later in the template itself, in description:, requires: or readme:.

A template’s description: and its variable declarations travel with the export, so a template that describes itself arrives self-documenting — whoever imports it gets the same labels, helper text and entity pickers you do. Worth doing before sharing one.

(v2.10.0+) A template going to people who read another language can carry its words in theirs. Put the titles, labels and descriptions in a language: block, one mapping per language code, and write [[$key]] where each goes. The block travels in the export and is kept on install, and every viewer sees the template in the language of their own Home Assistant profile, falling back to the same language without its region, then English, then the first language written. Include en for that reason. See Translating a Shared Template.

The exported block keeps its type:, so it is also just a card. A template that carries nothing under includes: can be pasted straight into a view in the raw configuration editor instead of using the Share tab at all. One that does should go in through the Share tab’s import: only the import unpacks includes: into templates of their own. Pasted as a card, the templates under it are never defined, and whatever calls them says the template was not found.

The dashboard values it uses (v2.8.0+)

A template can read values it does not set itself: from decluttering_defaults on its dashboard, or on the library dashboard. Whoever imports it has none of those, so the export brings the ones it uses into its default:, after its own, which still win. A value built from another (host: http://frigate:[[frigate_port]]) brings that one too. The included templates get theirs the same way. Values it does not use stay at home, and the export names the ones it brought in, so check none of them is private before you send it.

Keeping a password or token out

List the variable in setup:. A name in setup: is never brought in from the dashboard: it is asked for when the template is installed, which is where the other person’s own password belongs. Keep your value in decluttering_defaults on your dashboard or the library, and leave it out of the template’s own default::

# The library dashboard (or this one)
decluttering_defaults:
  - frigate_password: my-real-password
  - frigate_port: 5000

decluttering_templates:
  frigate_camera:
    setup: [frigate_password, camera]
    default:
      - icon: mdi:cctv
    card:
      type: iframe
      title: "[[camera]]"
      url: "http://frigate:[[frigate_port]]/cameras/[[camera]]?token=[[frigate_password]]"

The template works on your dashboard, the export carries frigate_port: 5000 but not the password, and the person installing it is asked for frigate_password and camera. The export says which values it left out because they are in setup:.

Before v2.8.0, a template carried under includes: took every value in the dashboard’s decluttering_defaults with it, used or not. If you shared one that called other templates, check what went out.

Saying who wrote it and what it needs (v2.6.0+)

A template can carry the details someone installing it wants to know: who wrote it, the licence, where to read more, what it needs from their Home Assistant, and what to ask them as it goes in. They are ordinary keys on the template, so they travel in an export and a post like description: does, and none of them change what it builds.

decluttering_templates:
  door_camera:
    description: A doorbell camera with its motion sensor
    author:
      name: John
      github: tempus2016
    license: MIT
    help: https://community.home-assistant.io/t/...
    homepage: https://github.com/you/your-templates
    readme: |
      Shows the **front door** camera, with the motion sensor underneath.
    related: [room_tile]
    requires:
      integrations:
        - integration: [frigate, reolink]
          message: Needs Frigate or Reolink.
      entities: ['binary_sensor.*_motion']
      custom_cards: [advanced-camera-card]
      homeassistant: '2026.10'
      card: '2.6'
    setup: [motion]
    default:
      - motion: binary_sensor.hallway_motion
    card:
      type: custom:advanced-camera-card
      cameras:
        - camera_entity: '[[camera]]'
Key What it is
author A name, or a mapping of name, github, email and url
license The licence it is shared under, such as MIT
help A link to a page or post that explains it
homepage Where it lives, and where newer versions turn up
readme Markdown, shown before it is installed
related Templates that belong with it though it does not call them. They go out with it under includes:, the way the templates it calls do
requires What it needs: integrations, entities (with * for anything), custom_cards, and the oldest homeassistant and card versions it works on. An entry can be a list of names, any one of which will do, with a message
setup Variables to ask for when it is installed. The answers are written into its default: list

Before installing, from the shared list, a paste or an update, the Share tab shows the details at the top of the entry: who wrote it, the licence, the links and the readme. Under them it lists any requirement this Home Assistant does not meet. That never blocks the install, since installing may be the first step of setting it up, but it says the template may not work until they are there. Then a Set up form asks for each setup variable, filled in with the template’s own default; leave one as it is to keep that default. An update keeps the answers already written.

Write versions in quotes. YAML reads an unquoted 2026.10 as the number 2026.1, so the Share tab warns about an unquoted version on export and on paste.

Links are shown only when they are http or https, and the text is trimmed to a sensible length, because a template from a post is someone else’s config. The checks a shared template gets before it goes in, such as the addresses it reaches, look past these keys: a homepage is a link for you to follow, not something the card fetches.

author, license, help, homepage, readme and related describe one template, so a template made with extends: does not inherit them. requires and setup are inherited, since a child needs what its parent does.

Filling them in: Sharing details (v2.6.0+)

The Sharing details panel: author, GitHub login, licence MIT, help and homepage links, a readme, room_tile as a related template, motion asked for on install, frigate needed, and Home Assistant 2026.10 and card 2.6 as the oldest versions

At the top of the Share tab, the folded Sharing details panel edits all of these without YAML. The lists take one entry per chip. A requirement written with a message or as a list of alternatives has no field here; it stays as written and is kept when you save.


Importing

Paste what you were given into the Import box and press Import.

The Import box, empty, with Open a file and Import under it

Or (v2.1.0+) press Open a file and pick a .yaml (or .json) file someone sent you. It is read into the Import box, so you can see what it is before you press Import, and it goes through the same checks as a paste.

If the paste is not a template at all, or is not valid YAML, the editor says that instead of importing anything.

A paste is checked like a shared post (v2.0.0+)

The Import box with a pasted garage template, warning that it calls cover.open_cover, and an Import anyway button

A pasted template that opens the garage when pressed: the first press says so, the second imports it.

A template pasted into the Import box gets the same scan as one picked from the shared list: the services it calls when pressed, addresses outside Home Assistant, embedded web pages, JavaScript or Jinja. When it finds anything, the first press of Import lists it, beside any name clash, and Import anyway goes ahead. A paste with nothing to warn about is still one press.

A source: line in a paste, saying which shared post it came from, is taken off before anything is kept, so a pasted template cannot claim a post it was never installed from.


Templates other people have shared (v1.15.0+)

The project’s GitHub has a discussion category, Share your templates, for posting templates. The bottom of the Share tab reads it.

Shared by others, with a front-door template picked: what it is, a link to the post, a warning that it calls lock.unlock, reaches an outside address and embeds a web page, and the whole template open underneath

A post only appears if its first YAML block is a template the Import box would accept. If it is not in the list, that is usually why. A post over 64 KB, or one whose YAML uses anchors and aliases to balloon when read, is left out too (v1.15.1+).

GitHub allows 60 requests an hour from one address without signing in, shared with anything else on your network that asks. If you hit that, the editor says when to try again and keeps showing the list it last fetched.

Custom cards you do not have (v2.0.0+)

A shared graph template warning that it needs mini-graph-card, which isn't installed

This shared graph needs mini-graph-card, which this browser does not have.

Before installing from the shared list or the built-in examples, the custom cards a template is built from that this browser has no card for are named in a warning. It never blocks the install, since installing may be the first step of setting that card up, but cards using the template show an error until the custom card is installed.

Checking for updates (v2.0.0+)

Installed from shared templates: front_door has an update, with the diff of what would change and a warning that the new version calls lock.unlock

The post was edited after front_door was installed, and the new version unlocks the door on a tap.

A template installed from a post remembers where it came from, under source:: the discussion, when the post was last edited, the template’s name in the post and who posted it. Substitution never reads it. The Share tab lists the templates on this dashboard installed that way, under Installed from shared templates.

Check for updates asks GitHub, only when pressed, and marks each one Up to date, Update available or No longer in the shared list. It compares when the post was last edited, not the content, so a template you changed after installing is not mistaken for a new version. A post now under a different account is reported as such and offers no update.

An available update shows what would change as a diff, and the same warnings an install gets, narrowed to what is new against your copy when anything is. Update, pressed twice, replaces the template wherever it is defined. The cards using it are not touched, and any change you made to the template itself is lost. It can be undone like any other rewrite.

Against the version you started from (v2.9.0+)

Compare with, on the Share tab, sets a template beside the starter library’s version, the newer version of the post it came from, or a copy the trash kept, as a line diff, and can take the other version back. See Visual Editors.


The Add a template gallery: tabs for Starter library, Shared by others and Installed, a search box, chips for All, Cards, Rows and Badges, and tiles each drawn as a real card, room_summary picked, with Preview in full and Install at the foot

The lists on the Share tab tell you a template’s name and what it is for. Browse templates, under Start from one of these, shows you what it looks like. It opens a gallery with three tabs, each with a count:

Each tile is the template drawn as a real card against a sample house, with a lit kitchen ceiling and the like, so it shows something without your own entities. A row or a badge has no card to draw, so its tile says what it is. Under the picture are the name, the description and how many variables it has. A search box looks through names, descriptions and the custom cards a template uses, and chips narrow the tiles to cards, rows, badges, picture elements, groups or repeats.

Click a tile’s text to pick it. The foot then says where it would go and what it would bring: the templates it needs installed with it, custom cards you do not have, and for a shared one what it would be allowed to do, the same warnings as the list. Preview in full shows the YAML. Install is the same install as the lists, asking twice where they do; a template you already have says so.


Bringing templates over from button-card and auto-entities (v2.9.0+)

Convert from another card: two button-card templates pasted, the decluttering version under it with base_light as the template and room_light under includes extending it, a note that one JavaScript block was kept for button-card, a note that it needs custom:button-card, and Copy and Install

Convert from another card, on the Share tab under Import, takes a paste from one of two other cards and shows what it would be as decluttering templates, underneath. Nothing changes until you press Install.

From button-card templates

Paste your button_card_templates: block, a few of its entries, or one entry on its own:

button_card_templates:
  base_light:
    variables:
      room: Room
    show_state: true
    tap_action:
      action: toggle
  room_light:
    template: base_light
    entity: '[[[ return variables.light ]]]'
    name: '[[[ return variables.room ]]]'

Each entry becomes a template that builds a custom:button-card:

The first entry is the template that is installed; the rest go with it under includes:.

From auto-entities

Paste a custom:auto-entities card:

type: custom:auto-entities
card:
  type: entities
  title: Kitchen lights
filter:
  include:
    - domain: light
      area: kitchen
      options:
        secondary_info: last-changed
  exclude:
    - entity_id: light.kitchen_hood
sort:
  method: name

It becomes a template named converted_rows that repeats over the registry, and the card to use it:

decluttering_templates:
  converted_rows:
    variables:
      - name: source
        default:
          domain: light
          area: kitchen
          entities: true
          exclude:
            - light.kitchen_hood
          sort: name
    let:
      row:
        entity: '[[entity]]'
        secondary_info: last-changed
    card:
      type: entities
      title: Kitchen lights
      entities:
        - '[[row|repeat:source]]'
type: custom:decluttering-card-plus
template: converted_rows

The filter’s domain, area, floor, label, integration, device class and entity category, an entity_id pattern, exclude entity ids, and sorting by name or entity id with reverse and count all have an equivalent. The rule’s options go on every row, with this.entity_id written as [[entity]]. An inner card other than an entities card, a glance or a stack say, has the list it fills repeated the same way, card_param included.

What has no equivalent is left out and named, rather than guessed at:

Installing

Install writes every template the conversion made into the dashboard’s decluttering_templates in one save, which can be undone from the toast. When one of the names is taken it says which and waits for a second press to replace it. The card for an auto-entities conversion is yours to add: Copy copies the templates and the card together. The custom cards the result needs, custom:button-card say, are named under it.


Writing a template for other people

A template you use yourself only has to make sense to you. One you share gets filled in by people who never saw how it was built, so they cannot know which field drives which. These habits keep it working for them.

Work values out instead of asking for them

Anything that follows from another field belongs in a default: that uses that field. A default that uses another variable is worked out again whenever that variable changes, live in the editor, so picking a different camera moves everything built from it along too. A field somebody sets by hand stays as they set it, because the card treats a typed value as their choice. The fewer fields a user has to fill in, the fewer can be left behind when something changes.

Keep each choice in a field of its own

A list or mapping in one field is stored whole. Change one item in a list the template worked out, say switch off one detection, and the card keeps the whole list as it stands. From then on, changing the zone or the camera no longer reaches any item in it, and nothing on screen says so.

So do not hand users a worked-out list to edit. Work the list out, and give the choices people make about it fields of their own:

decluttering_templates:
  detection:
    default:
      - skipped: '[[skip|contains:[[type]]]]'
    item:
      entity: binary_sensor.[[zone]]_[[type]]_occupancy
      name: '[[type|capitalize]]'
  camera_detections:
    default:
      - detectors: [{type: person}, {type: car}, {type: cat}]
    variables:
      - name: camera
        label: Camera
        selector: {entity: {domain: camera}}
      - name: zone
        label: Zone
        description: Worked out from the camera. Change it only if your zone is named differently.
        default: '[[camera|object_id]]'
      - name: skip
        label: Detections to leave out
        selector: {select: {options: [person, car, cat], multiple: true}}
    card:
      type: entities
      entities:
        - '[[detection|repeat:detectors|unless:skipped]]'

Leaving out the cat now sets skip: [cat] and nothing else. The rows are still worked out from the zone, so changing the camera or the zone moves every row, and the cat stays left out. Filtering copies with unless: needs v2.10.0 or later; see Keeping only some copies.

Put fields that depend on each other together

Give a field and the fields worked out from it the same group:, with the one that drives the rest first. A user who changes the camera then sees the zone just below it, not folded away in another section. Say what a field is worked out from in its description:, as the zone above does. If a field only matters for some values of another, show_if keeps it out of the way the rest of the time.

Check what the template builds

Entity ids a template puts together, like binary_sensor.[[zone]]_person_occupancy, are the first thing to break when a user’s names differ from yours. A check with exists tells them which one is missing, where otherwise each row would only say Entity not found. Added to camera_detections above:

    default:
      - detectors: [{type: person}, {type: car}, {type: cat}]
      - person_sensor: binary_sensor.[[zone]]_person_occupancy
    checks:
      - name: No zone sensor
        condition: '[[person_sensor|exists]]'
        fail_on: false
        message: There is no [[person_sensor]]. Check the Zone field.

Point people at Reset

A field somebody has set shows a Reset button when the template has a default for it. When a field is worked out from another, say so in the template’s description: or its readme:: a user who changed it by hand and then changes the camera should press Reset to have it worked out again. From v3.0.0 the card editor says so itself when an edit leaves a field like that behind.


Posting yours for everyone (v1.15.0+)

  1. In the Share tab, press Copy as a post. It copies the template’s description, the notes about what it needs, and the export in a YAML block — exactly what the list reads back.
  2. Press Open GitHub, which starts a new discussion in Share your templates.
  3. Give it a title that says what it does, paste, and add anything worth knowing.

The title is what people see in the list, so “Room card with lights and climate” works better than the template’s name. Editing the post later updates what everyone gets the next time their list refreshes.


What travels and what does not

Travels Does not
The template’s type, name, default values and content Entities it points at — the recipient’s light.kitchen is not yours
Every other key it carries: style, variables, let, description, extends and the rest. defaults: goes out folded into default:, which every version of the card reads Custom cards it uses — they install those themselves
The templates it calls or extends, under includes: (v1.6.0+) Anything it calls that could not be found — named in a comment instead
A note naming custom cards it needs Which shared post it was installed from, its source: (v2.0.0+)
Its sharing details, author to setup (v2.6.0+), and the templates in related under includes: Dashboard values it does not use, and any named in setup: (v2.8.0+). View and section values do not go either
The dashboard values it uses, in its default: (v2.8.0+)  
Item templates it fills in with with: or repeat:, under includes: (v2.8.0+)  
Templates a variable picks (template: '[[kind]]_tile') whose names fit, under includes: (v2.8.0+) Ones whose names do not fit — the export says it is picked, so send those yourself

See also