Where to find the Lovelace UI Yaml file?

I want to edit and copy my Lovelace UI yaml file

I know that in the GUI you can switch to yaml mode but the editor is very basic and I would prefer to use an editor like Visual Studio. I would also like to be able to backup my UI before proceeding to deep changes.

I have search all over the place to find where the lovelace yaml is saved in HA system file but I could not find it (at least not it the directories available through Samba).
Does someone knows where to find it, how to edit it from outside the gui, and how to save it before major changes?

It’s stored in a different format in a file which should not be edited manually while Home Assistant is running and will cause it to fail to start in case of any tiny mistake.

It is really not recommended to edit it in any other way than what is provided.
It is included in the system backup, so I recommend you use that if needed.

For editing; either copy the yaml from the raw editor to your editor of choice, or switch to a full yaml configuration: https://www.home-assistant.io/dashboards/dashboards/#using-yaml-for-the-default-dashboard


Thanks for the explanation.
The current UI mechanism is nice because you can do most of the things graphically but as I mentioned, it would be nice to be able to save and restore the UI.

Yesterday I was trying to update my UI on the small screen of my phone and I have ended up with my main view tab deleted (I do not remember exactly what I have done precisely)! Unfortunately, there is no easy way to recover the missing view. From a backup there is no specific switch to restore ONLY the UI. You have to restore everything in HA to get the UI back and this means you lose all the recorded long-term statistics between the time of the backup and the time of the restore.

To get around this problem I had to restore my backup on a dummy system copy the full yaml content of the dashboard and paste it on my main system. By doing that I have been able to restore the UI without losing the long-term stat but it is not easy to do.

It would be nice when you are in the “edit configuration” (with yaml file) to be able to save and restore the content from a file. This would allow to backup/restore a known working configuration file. From now on I will backup “manually” (cut and paste in VS) the content of my current UI on a regular basis.

Thanks, was looking for the same.

My solution for now: I create a private repo on Github and from time to time I manually copy the yaml to a file in that repo.

I want to add a tv card to my main dashboard, the plugin suggests to do it through lovelace-ui.yaml.
I don’t mind adding it through GUI, but could you please explain how to do that?

You open the view, click the 3 dots, click EDIT-Dashboard, click again and choose raw-editor
Thou i guess you maybe have to “take control” over the view/dashboard :wink:
Or as Thomas suggested( a year ago, with an url, You should read ), copy it into any editor of choice, i use notepad++

PS: I would however suggest you read that “tv card” plugins guide, but also make sure to check the cards github, who knows, it might be 5 years since last update of that card

If you can’t edit the lovelace yaml file directly is there anyway of stopping the UI from expanding Anchors? In its current form all the references are replaced with the full value of the Anchor which complete negates the simplification that Anchors offer.