Simple questions about Lovelace (YAML mode) and dashboard references

So I’m taking the plunge – I want more comments in my work, so I’m moving to YAML mode for Lovelace config. Pray for me (still a newbie, and somewhat intimidated).

And we’re already seeing the limits of my knowledge .

I got the resources set up alright using (!include resources/resources.yaml) but was unable to do the same for the filename tags referencing the dashboard yaml. To illustrate:

dashboards:
  ui-myhome:
    filename: !include dashboards/ui-myhome.yaml

This call consistently threw errors. Meanwhile, if I placed the dashboard yaml directly in the config directory and just referenced them directly:

filename: ui-myhome.yaml

… everything was fine.

Did my best to dig through documentation and similar questions, but the answer eludes me. Any help?

Thanks!
Justin

It’s just looking for the filename, so the following might work:

dashboards:
  ui-myhome:
    filename: dashboards/ui-myhome.yaml

Although the docs say this:

filename string REQUIRED
The file in your config directory where the Lovelace configuration for this panel is.

Using !include includes the contents, which you don’t want there.

More than slightly embarassed that I missed this – could have sworn I tried this first!
Worked a treat and thanks very much!

1 Like

Hi I’m thinking of moving mine into Yaml do you think it’s worth it ?
I’m worried I will lose everything but messing something up.
What page did you follow to swap over and did everything look the same.
Do you have to create a yaml file for every dashboard and every view.
Any help appreciated.
Cheers

1 Like

Made the leap and never looked back.

While it does initially increase the workload – yep, everything needs to be manually coded; or more realistically, copied from YAML produced by the UI – the increase in flexibility and greater access to user-created tools ultimately improves the overall experience.

I can’t precisely remember the process, but you very much can have a YAML mode dashboard and a UI mode dashboard co-exist. This is how I approached it. Start a blank YAML board and keep your original dashboard in UI mode, slowly copying your code over into from the UI board into the YAML board to better understand how it works.

You’ll slowly start doing more and more work on the YAML side, and eventually, it all becomes (mostly) less terrifying.

Good luck!

2 Likes

Thanks for that.
I half took the plunge and did the storage option so one new dashboard is Yaml which seems to work ok.
Do you think I have to manually enter the resources into the Yaml dashboard for custom cards etc…
even though I have them added on the resources menu.
Cheers