As dashboards grow in complexity it would be very helpful to be able to use some of the advanced features of YAML without having to go full YAML mode for a dashboard.
In particular, I would love to be able to use the !include directive in my dashboards! I’ve got a few integrations that auto-generate dashboard views that then have to be copy and pasted back into the dashboards that I have created. Ideally I could just add a !include and the path to the file and be done with it.
I really don’t want to switch to full YAML mode for my dashboards as that is a lot of extra overhead to manage keeping the resources up to date with HACS installations as well as the inability to easily tweak components around the !included configuration
As this is a feature I’d love to see as well, I thought I’d bump this thread.
Or does anyone know of a simple any way to include files in UI mode? I’d need to load a button_card_templates.yaml file, because copy and paste of over 1300 lines is not really practical…
Yes, this feature is much needed! Even if it isn’t full support for includes, etc. If there were a way to import a header file (or just specifically a button card templates file) in the gui.
Been searching for this today and glad to see there’s recent activity on this thread.
Would really like to see the ability to reference these with !include. I know that the raw editor isn’t technically the YAML file, so I get it is a little different to reference. I’ve been sorting my config.yaml into different files (sensors, templates etc) with !includes and it is so much easier to navigate.
Recently moved from the file editor to visual studio too and it is so much nicer to work with. I’m no programmer but I’ve learned so much mainly thanks to HA. Still far from an expert, though. I usually use the GUI, but will edit individual cards or use the raw dashboard editor to adjust as necessary. I do enjoy being able to view changes in real time as for the frontend building. I know splitting the views into !include YAML means that you would have to edit them in code form, but having the GUI means I could tinker with cards on a separate dashboard and copy them in as necessary.
I don’t know quite how it could be done, given the different languages between raw editor and the config files so I don’t know quite what’s involved. Perhaps if !include would not work, you could ‘add’ a view to your dashboard and select GUI or a path to the YAML view, which wouldn’t allow you to then edit using the GUI. It would be even better if there was additionally some way to open each view in it’s own visual editor.
I can get most done with visual editor and then accessing YAML mode or raw dash editor, but it would be nice to split it up so you could easily copy view templates etc, or reference things elsewhere to tidy up the code. I have used repeated instances such as header cards etc with custom:decluttering card, which has helped. I’m sure there is a way to essentially make your own “custom:thisismycard” and then reference it, but the skill required for this is well out of my league. I’ll keep searching.
Bump.
YAML already stinks as a scripting language ( fine for data exchange, but seriously lacks for scripting, though it certainly simplifies the lexicon parsing), but to have to work with a massive file in that editor is difficult.
It would be nice to have some in the file, as well as to avoid bringing it in over and over and over. That will grow it. Though given a choice of a quick hack such that each includes brings in the code, vs. a nice elegant solution that will take time, I would prefer the first.
At the very least, a simple per-processor approach would work on this (it worked fine for us with C++ back in the mid 80s). Put it before the yaml2DB parser and after the DB2Yaml generator.
I also make extensive use of the button_card_template and would love to just move those to a separate file.
I don’t want to switch to full YAML mode because I use the UI to work out what param names and structure are. I like the trend for using the UI more, as it’s a convenient way to generate the YAML, but I’d also love the Edit Configuration view to get some love.
Considering it is still just a YAML edit, I’ve no idea why we can’t use !include like on all other yaml files though?