Can anyone please tell me what’s wrong with the opening lines on a single lovelace dash UI yaml file, please?
Error is: Button-card template ‘riverlevel’ is missing! (similar repeated for every button-card)
This works if all the template yaml is put into just one !include file
I know it’s reading both files, as if I corrupt the path name, it breaks with a clear file reading error.
Thanks Russell. It’s a limitation, but if I know it is so, at least I can work around it. Perhaps the C #include pragma might have been an alternative approach - more intuitive.
You can include that way but you have to remove the - inside your files. The - is either outside on the single file line and the file contains 1 template, or the include is on the full field and multiple templates are in the file. Not both. Because it didn’t work for you, you must have had the dash in both places.
I’m just off to confirm if that works… It would do me. If I find I have shared files (between entirely different template sets), a good old linux symlink or hardlink should do the job…
The Lovelace dash is /config/local/dashboards/mobile-dev.yaml
It brings in everything recursively under …/local/templates/mobile-compact/
sizes/ has the layout pixel/%/etc settings
cards/ has the card tempates for button-card
The idea is that I can symlink/hardlink**
…/local/templates/mobile-compact/cards/ → …/local/templates/pad-compact/cards
and employ a local sizes/ directory with different scalings.
** Can’t hardlink dirs - but could do so to the files - just noted for the purists
Yes, I know - I should write the ultimate layout that scales for everything nicely - but it’s easier just to pixel customise a couple of dashboards so they look super crisp on the devices my family use.
But either way - I hope this general idea might be useful or adaptable for others
because you cant have the same key 3 times. If you’re trying to map that, there’s a whole section in the docs for breaking up your config. That requires a !include_dir_merge_list.
I’m aware of the !include_dir_merge_list and used that before but I don’t want all files in the directory to be included, hence I change to listing the individual files.
You can’t do that. You either include them all, or list them individually. However if you list them individually, the individually listed files can only contain 1 sensor.