You can also add YAML dashboards when your main dashboard is UI configured:

I followed the instructions from the Home Assistant documentation to add a new Dashboard.
Here is my code in my file /homeassistant/configuration.yaml

lovelace:
  mode: storage
  # Add yaml dashboards
  dashboards:
    lovelace-yaml:
      mode: yaml
      title: YAML
      icon: mdi:script
      show_in_sidebar: true
      filename: dashboards.yaml   

I then created the dashboards.yaml file "/homeassistant/dashboards.yaml " . I copied the content of my current dashboard using Raw Configuration Editor.
I restarted Home Assistant.
I don’t see my new dashboard YAML in my the sidebar and neither in the Setting-Dashboard.

The documentation mention that I should create the file in my configuration directory, but I cannot find such directory.
What am I doing wrong ? Any additional steps required?

why are you doing it via the confugration yaml?

why not use: http://homeassistant:8123/config/lovelace/dashboards ?
(replace the stem with whatever your home assistant address is of course)

your configuration directory is almost certainly /config unless you did something to change it.

if you want to verify, go here: http://homeassistant.local:8123/config/repairs
hit the 3 buttons in the upper right and choose system information.

1 Like

I am just following the instructions in the Home Assistant official documentation.
I did not change anything in the structure of the file. Using File Editor, I can see that my configuration.yaml is in the homeassitant directory. Nowhere I can see ‘config’ directory.
Where can I get more information about your suggestion to access my dashboard with http… directly. What is the advantage to do so?

that url is a direct link , but you can get to it navigationally through the ui.

settings->dashboards.

the advantage of doing it through the dashboard is that you can do it all via the ui… it will take care of code location and such.

at the same time, if you want to drop down to yaml, you can still do so…

essentially you get the power of yaml when you want it, but you don’t get the headache when you don’t need it.

to answer your question about file editor and the path… file editor is actually abstracting some of that away from you. do you have samba installed? if you don’t, you should… then you can browse the home assistant full directory from your mac/pc.

also do you have visual code studio? i prefer using that for when i need to instead of file editor. visual code studio will show you the real heirarchy.

but again, especially if you are new… use the ui, don’t grovel the yaml first. not only will it guide you and make things easier, it will also help prevent you from making accidental catestrophic mistakes…

on another thread someone corrupted their config file… they said they didn’t change anything… but when we actually saw the file, it was clear they had an accidental “paste” in the header and it prevented homeassistant from booting…

Thanks for your quick reply and clarifications.
About the config directory; I just find out that it as been rename homeassistant.
That explain why while editing my configuration.yaml file the top line show
“ /homeassistant/configuration.yaml”.
It seem that not all documentation have been updated.

I understand your alternives, but, at this point in time, I would prefer to stick to the official documentation.
So my problem is the same, I cannot see my new dashboard YAML in setting neither in thé Sidecar.

in your yaml, you have set mode: storage this is used when it’s ui managed. but you are saying you don’t want to use the ui. so you should set this to be mode: yaml

if i may… can i still inquire why you want to do it purely in yaml? the official documentation does recommend the ui. see it below. it has yaml as an alternative. but it first focuses on the ui method. if you’re new to this, i would strongly recommend as well. i don’t believe you lose any power or flexibility going that path.

but in any case ,if you want to stick with it… start with switching the mode to yaml mode instead of storage. this doc link half way down will explain that as well.

The documentation state:
“ You can also add YAML dashboards when your main dashboard is UI configured:”
This statement is follow by the code that I copy to my configuration.yaml file. Including mode storage.
You are saying that storage is for UI, is The documentation wrong?

The reason I wish to use both UI and YAML dashboard types is that I using extensively custom:decluttering-card. I want to used the included file or directories within my YAML dashboard and copy my decluttering templates into raw-configuration-editor of my UI dashboard.
I understand that my approach is not perfect because we cannot include file or directory into UI dashboard.

I appreciate the help that you are providing.

i’m not saying the documentation is wrong… what i’m saying is actually consistent with the documentation. i think perhaps that you may want to read the full documenation.


note where it says specifically that the mode should always be set to yaml. and that storage mode is for those created in the configuration (ui) panel.

I understand your alternives, but, at this point in time, I would prefer to stick to the official documentation.

But the official documentation also mentions setting up dashboards in the UI. And it’s the first method explained, at the very beginning of the article. YAML method is second, and it’s more complicated.

You can manage your dashboards via the user interface. Go to Settings > Dashboards. Here you can see some of the defined dashboards and create new ones

So, unless there is a specific reason why you prefer to use the YAML method, I would just do it in the UI.

I sorry for the misunderstanding.
I know and understand that UI Dashboards are the one recommended for Home Assistant. I agreed with this.
I have multiple dashboards all of them are UI controlled.

I am also using extensively ‘decluttering templates’ and ‘button_card_templates:’. I got about 1000 lines of those in my UI Dashboards. I change and maintain then using 'raw-configuration editor.
My concern is that every time I change these templates, I have to cut & paste them in each of my dashboard.

UI dashboard do not support ‘include file / directory’. YAML dashboard do.
I am trying to set a new dashboard YAML type.
This dashboard would ‘include’ and external file “dashboard.yaml” where I will put all my “decluttering templates / button_card_templates” code.

I follow the instructions in the Home Assistant documentation:

You can also add YAML dashboards when your main dashboard is UI configured:

lovelace:
  mode: storage
  # Add yaml dashboards
  dashboards:
    lovelace-yaml:
      mode: yaml
      title: YAML
      icon: mdi:script
      show_in_sidebar: true
      filename: dashboards.yaml

I added the code in my “/homeassistant/configuration.yaml”. Homeassitant being the directory and configuration.yaml the file.
The I created a file ‘dashborad.yaml’ in '/homeassistant/dashboards.yaml ’

The documentation clearly state that I can add YAML dashboards when your main dashboard is UI configured.

I think that I followed every steps of documentation. My problem is that I cannot see anywhere this new dashboard title “YAML” mode “yaml”, even if my configuration indicate that the dashboard should show_in_sidebar: true.

I appreciate all suggestions and alternatives that you are proposing.
But what I am looking for is to do exactly what the documentation say “You can also add YAML dashboards when your main dashboard is UI configured:”
My question is what did I do wrongly, and what else should I do to see/access/maintain this new dashboard?

Thank you in advance