Giter VIP home page Giter VIP logo

Comments (3)

ildar170975 avatar ildar170975 commented on June 3, 2024

As an example:

configuration.yaml:

homeassistant:
  ...
  allowlist_external_dirs:
    ...
    - /config/lovelace
...
lovelace: !include lovelace/lovelace.yaml

lovelace/lovelace.yaml:

mode: storage
dashboards:
  ...
  system:
    mode: yaml
    title: System
    icon: mdi:home-assistant
    show_in_sidebar: true
    require_admin: false
    filename: lovelace/lovelace-system.yaml

lovelace/lovelace-system.yaml:

decluttering_templates: !include_dir_merge_named templates-decluttering/
views:
  - !include views/system/general.yaml
  ...

Folder lovelace/templates-decluttering contains files (may be grouped in folders) for decluttering templates - either "1 file = 1 template" or "1 file = several related templates":

..
template_1.yaml
template_2.yaml

lovelace/templates-decluttering/template_1.yaml:

template_1:
  default:
    ...
  card:
    ...

So, each dashboard file (like "lovelace-system.yaml") should include that decluttering_templates: !include_dir_merge_named templates-decluttering/ string to have your templates available.

from decluttering-card.

OscarGonz95 avatar OscarGonz95 commented on June 3, 2024

I'm getting some issues following your steps.
Copy everything and creating the folder + lovelace.yaml. On lovelace-system.yaml I did just for test a fast view instead of import.
image

decluttering_templates: !include_dir_merge_named templates-decluttering/
views:
  - title: Test
    cards:
      - type: picture
        image: https://demo.home-assistant.io/stub_config/t-shirt-promo.png
        tap_action:
          action: none
        hold_action:
          action: none

Deleting thse"..." from your example code. I try to validate the config and i get this issue:

"Invalid config for [lovelace]: Url path needs to contain a hyphen (-) for dictionary value @ data['lovelace']['dashboards']. Got OrderedDict([('system', OrderedDict([('mode', 'yaml'), ('title', 'System'), ('icon', 'mdi:home-assistant'), ('show_in_sidebar', True), ('require_admin', False), ('filename', 'lovelace/lovelace-system.yaml')]))]). (See /config/configuration.yaml, line 67)."

Maybe a mistake on the !import

lovelace: !include lovelace/lovelace.yaml

to

lovelace: !include /lovelace/lovelace.yaml

But anyways i had error:

Error loading /config/configuration.yaml: in "/config/configuration.yaml", line 68, column 11: Unable to read file /lovelace/lovelace.yaml.

Thanks for your help!

from decluttering-card.

ildar170975 avatar ildar170975 commented on June 3, 2024

Check again steps in my post and compare with your setup.
If you still experience errors - then post your "lovelace.yaml", "lovelace-system.yaml" & "configuration.yaml" files.

BTW, your issue is neither a bug nor a feature request.
It is just a question.
I strongly suggest you to ask similar questions in a dedicated decluttering-card Community thread.
These questions should be posted there instead if being lost on Github.

from decluttering-card.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.