Please allow me this total Lovelace noob question. since you’re the first and only person I found writing about one of my Lovelace worries: how to manage this huge ui-lovelace.yaml…
I have that in /config/.
how do I proceed to have the includes? I can’t call the
If I may respond: You don’t use includes in ui-lovelace.yaml, but in /config/lovelace/main.yaml (or other files in this folder).
The tool will generate ui-lovelace.yaml which will still be a huge file, but at least with this method you have the opportunity to split your “source files”, which is very convenient.
how does HA know where to look for the config/lovelace/main.yaml file is that a setting in configuration.yaml? -> I think it’s a setting of the plugin, that might be hardcoded. Don’t take my word for it though.
If i have this main.yaml and use !include view-Home.yaml, where does this file go? Also in config/lovelace/ ? -> Yes, you can put your files in the same folder. You might also put them in subfolders but I haven’t tried that yet. Here’s a screen of my /config/lovelace folder:
thank you!
i have the 2nd and 3rd alright, so its a matter of getting the 1st step: how to have HA know where to look for the main.yaml.
The py script only creates the ui-lovelace.yaml, and sets nothing in configuration.yaml or other files ( I tested that)
must be configurable in configuration.yaml (at least, for users not having set Lovelace as default yet)
Or is it set in the resources section of the ui-lovelace.yaml? Can you have a look in either of these files please
The actual answer to your worries about the huge ui-lovelace file is actually to have a bit of patience until the GUI editor is available. A beta version is scheduled to be released this week (possibly within hours). Once that function is finished, there should be no need to edit ui-lovelace.yaml manually at all.
If you still wish to edit it manually, you don’t even need lovelace-gen to be able to use !include. The tool was created at a time when it was said that !include support was going to disappear, but the plans have changed, and the support will stay.
That said, there may still be other reasons for advanced users to use lovelace-gen, and if you feel the need then it is as @Vlavonvidden says; lovelace-gen will overwriteui-lovelace.yaml, and you should not touch that file manually if you use the tool.
For how to make it do it’s thing, please refer to the README file on github.
That’s all it’s supposed to do. What did you expect it to set, and why?
What doI need to add to have it display the files referenced in Main.yaml.
I’m not sure what is your end goal to be honest. If I understand correctly, you want to create several view_files that will be used in ui-lovelace, right ?
If so, you must use the script with main.yaml where you reference your view_files, and the content will be included in ui-lovelace.yaml.
I’m sure you know that, but you also must use the command lovelace_gen in order for the tool to generate the ui file:
I hope that will help you solve the issue you’re facing. The tool is very useful !
right. just like we did with the groups before in regular yaml. Not have a huge file, but nicely organize that. We use the group: !include_dir_merge_named groups for that in configuration.yaml
Are you saying I need to first create all these files in Main.yaml, and then the tool creates the ui-lovelace out of that? If so, I completely misunderstood the instructions…
I had 2 of these view_groups.yaml in folder /config/lovelace, ran the script and an ui-lovelace.yaml was made with the content of these view-groups, so the other way round…
Are you saying I need to first create all these files in Main.yaml
Yes (well you need to include them).
and then the tool creates the ui-lovelace out of that?
Yes as well.
I had 2 of these view_groups.yaml in folder /config/lovelace, ran the script and an ui-lovelace.yaml was made with the content of these view-groups, so the other way round
That is the correct way to use the tool.
Allow me to explain the way I use it, so we’ll hopefully be on the same page.
I created a file call main.yaml in /congifg/lovelace/.
In the same folder, I created several view_file.yaml.
I referenced each one of them in main.yaml using ! include view_file.yaml.
Then, I ran the script using the command I mentionned earlier.
→ Result: ui-lovelace.yaml is created. I never edit this file since it’s auto generated.
You are supposed to create the directory lovelace/, the file lovelace/main.yaml and any other files you wish to include in lovelace/whatever.yaml.
When you run the tool, the file ui-lovelace.yaml will be overwritten with the contents of lovelace/main.yaml and also any files that are included in lovelace/main.yaml.
If it’s not too much bother, could you please let me know what you thought would happen, so that I may improve the doumentation? Thank you!
Seriously.
Someone must know.
All I want to know is where, if anywhere, is the .json that I need to include in order to have these cards appear in the tracker card?
Thanks!
One more question please before I start reconfiguring…
If I have all my files in the /lovelace/ folder and everything referenced in the /lovelace/main.yaml, and run the tool so it creates the ui-lovelace.yaml, wouldn’t that leave me with twice the code?
A set of manageable separate files with all the code, and 1 huge ui-lovelace.yaml, with all that same code? Mind you, my ui-lovelace.yaml is already 4000 lines, and I havent even started adding all the whistle and bells…