Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use templates across Dashboards #43

Open
rahaaas opened this issue Jun 3, 2021 · 4 comments
Open

Use templates across Dashboards #43

rahaaas opened this issue Jun 3, 2021 · 4 comments

Comments

@rahaaas
Copy link

rahaaas commented Jun 3, 2021

Have decluttering cards set up and working across single dashboards, but using it on different dashboards results in an error:

"undefined is not an object (evaluating 't.config.decluttering_templates[e.template]’)”

The use case is tablets with different dashboards in different rooms, so I would want to use, for example, my 'House Status’ card across each room.

Is this possible? I’m using the Lovelace GUI and pasting the template YAML in the default dashboard’s Raw Configuration editor.

@masman69
Copy link

masman69 commented Jan 15, 2022

Very similar to this issue, I use multiple dashboards using the method described in Dashboards under the section Adding more dashboards with YAML.

With this method, I don't have a lovelace-ui.yaml file. My resources are referenced in configuration.yaml and dashboards included from separate yaml files.

I have tried adding decluttering_templates in the lovelace section under resources and that causes the error: Invalid config for [lovelace]: [decluttering_templates] is an invalid option for [lovelace]

Adding a ui-lovelace file with just decluttering_templates results in the dashboard that includes the templates warning: Cannot read properties of undefined (reading "test_template").

Suggestions on how to use the awesome card with this configuration?

@SirIndubitable
Copy link

I think I figured it out, you have to add the decluttering_templates in each yaml dashboard.
I did this with includes so I can reuse them between dashboards

configuration.yaml

lovelace:
  mode: yaml
  resources:
    - url: /hacsfiles/decluttering-card/decluttering-card.js
      type: module
  dashboards:
    my-yaml-dashboard:
      mode: yaml
      title: yaml
      show_in_sidebar: true
      filename: my-yaml-dashboard.yaml

my-yaml-dashboard.yaml

decluttering_templates: !include decluttering_templates.yaml
views:
  - path: default_view
    cards:
...

@DorwinDT
Copy link

Is there some solution working nowadays for current version of homeassistant? I want to re-use template across various dashboards

@ildar170975
Copy link

I want to re-use template across various dashboards

Available only for yaml-dashboards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants