Open brhahlen opened 2 years ago
Thank you for creating your first issue for the Swiss Army Knife custom card!
This kind of problem is related to ressources files, add it directly from the dashboard ressourses can resolve the problem
@novisys Thanks. As far as I can tell, the resources files are added in the dashboard
Have you reffered to this step by step instalation guide ? https://swiss-army-knife-card-manual.amoebelabs.com/start/installation/#hybrid-install-using-hacs-custom
Yes, otherwise I wouldn't be able to see the card at all.
After upgrading to 2022.8 of HA it worked! ...and then it didn't again... :(
So, it appears the backend should be alright... but for some reason...
That is very weird, as if the backend can’t load the data for some reason.
i haven’t found any cause yet. It works on my end, so difficult to reproduce.
what kind of hardware are you running?
Sorry, am on holiday, so spending a lot less time at the computer/phone. I'm running HA in Docker, on x86_64 hardware.
I'll get the full list to you soon :-)
CPU: Intel(R) Pentium(R) CPU G4560 MainBoard: H110M-STX RAM: 16GB SSD: Samsung NVME 970
Anything else you need to know?
@AmoebeLabs I'm running it on docker-compose, if that helps any. Not sure where/how to test more, it just seems a bit weird that it doesn't work, and I can't pinpoint why...
Do you have any suggestions on debugging steps?
I´m having the same issue. I´ve installed using HACS and not using YAML mode.
Same issue here for me too. Really randomly too. I.e. it will start working and then stop again even without making any changes or restarting Home Assistant.
@mcrummett Did you also install using HACS?
Same issue here. I installed with according to the hybrid method and tried to go through the tutorials and with the given files. Everything works (e.g. tutorial 1 part 1/2) until I try it with the templates (e.g. tutorial 1 part 3/4).
So I've tried to "switch" to the fully custom install, but that also doesn't work. I think it has to do with the dashboards being in storage mode, but am not entirely sure.
I'll leave it for now, and see what's going on later. @AmoebeLabs If you need more help testing, let me know.
Same problem here with HACS. HASS is installed in VM on unraid.
I am also experiencing this on 2022.9.7 -- @brhahlen mentioned that this might be related to using a storage mode dashboard, so I converted to yaml mode and loaded the example dashboards and any of the installed views that utilize a template produce the same error, see figure 1. I installed 1.0.0-rc3 via the hacs add-on, originally into a mode: storage
install, which I converted to a yaml mode install by manually copying over all of my resource definitions from the ui. Its worth noting that the visualizations that don't use templates do seem to render, at least partially (see figure 2)
Can concur that the issue is related to storage mode.
I made a test dashboard via the ui in storage mode and copied it's contents to a dashboard yaml file that was referenced in an commented lovelace: mode: yaml
configuration entry.
When storage mode is enabled the exact same dashboard definition doesn't work.
However, if yaml mode is enabled, the exact same dashboard definition works after a refresh of the browser.
Switching back to storage mode without refreshing (but with restarting HA in another window) ensures that the dashboard also works in the ui controlled dashboard. Unlike the yaml mode the dashboard in storage mode will only keep working until the browser is refreshed. Therefore I believe that, in storage mode, somewhere along the reference chain there is a broken path reference to the example templates files.
Since, everything works without a refresh after switching to yaml and back but with a refresh (which probably causes the template files to be re-requested) the broken path becomes evident.
hi @sfstar, my installation is currently in yaml mode (not storage mode) and the example dashboard screenshots I pasted above are from a yaml mode dashboard, so my experience diverges from your explanation.
I was able to resolve the template error by going into chrome developer mode and keep fixing the issues as they were identified. Keep in mind that my f12-based errors could be unrelated, but one of these things fixed it:
At this point, I am no longer getting template errors, but I've gotten a separate error that I'll create a new issue for.
I have the same problems as described here. Installed in storage mode, the cards worked at first, but after restarting HA I got the "Cannot read properties of undefined (reading 'templates')" error. I also noticed that only some of the cards on the "sak-example-dashboard" was working. I tried all the steps posted by @PeterGrace, but that didn't solve the issue for me. The strange thing is that the cards has been working a couple of times, but then the error is back. These cards are really nice looking and adds a lot of customization, so I would really love to use them - but it seems that there are some issues that needs to be resolved first.
Edit: Discovered something interesting. I changed one of the template !include in "sak-examples-dashboard.yaml" to something not valid (added / in front of the path), then saved the file and refreshed the dashboard page (sak-examples/sak3). Then the error message was gone (the example dasbhoard doesn't show all card info, but the error is gone), and my SAK cards added via UI is working as expected. After a new refresh, the error is back.
My card added via UI before changing sak-example-dashboard.yaml:
Example dashboard before changing sak-example-dashboard.yaml:
Added an error to the path in sak-example-dashboard.yaml:
Stored the file, refreshed Lovelace dashboard, removed the error in the path, stored the file and refreshed Lovelace dashboard:
Example dashboard after changing sak-example-dashboard.yaml:
My card added via UI after changing sak-example-dashboard.yaml:
After another refresh of the dashboard, the errror is back.
Edit2: I think this issue is related to the fact that storage mode doesn't use ui-lovelace.yaml and the raw editor doesn't support includes. So as far as I know there is no way to add the templates that are included in ui-lovelace.yaml in storage mode. The temporary "solution" mentioned above seems to only be a browser cache, since the templates are loaded when YAML mode dashboard is loaded, but the included templates seems to get removed when the storage mode dashboard is refreshed. I don't know if this is the answer - this is way outside my knowledge - but it seems that everything is working as intented when using YAML dashboards and including the templates as described in the documentation. So, unless there is a way to include the templates in storage mode, I don't think this will work.
Please help the developers. The same problem happened. Performed the installation according to the scheme indicated on the site. Hardware configuration (Windows 10, Chrome). In the configuration file (lovelace, mode: yaml). Here's an observation: I'm using a lovelace created by a graphic editor (not YAML), if I refresh the browser page on the lovelace tab (created by a graphic editor) then an error appears (Cannot read properties of undefined (reading 'templates'), but if I refresh the browser page on the lovelace page created via yaml, and then go to the lovelace (graphic editor) page, then this page displays the information correctly.but it does not work on the mini pc RPI3 ( OS Raspbian)
Hi how to solve the problem?
I had the same.. reason was that I had this line (from the manual)
!include include/sak/sak_templates.yaml
I changed that to this:
!include lovelace/sak_templates/sak_templates.yaml
then it worked. (I got the same error just with reading: state.. but changed the entity in the example to something that existed.. then all was well.
Bug report notice
Before you file a bug, make sure that you did not make a configuration mistake. The Swiss Army Knife in its current state does not yet have full configuration sanity checks!
So make sure your problem is not related to that!
Bug description
Trying to use cards with the templates, throws the error in the title. For instance:
Error in console:
To Reproduce
Good question...
I have installed Swiss Army Knife using the "Hybrid HACS" install. Meaning, installed via HACS, then downloaded the latest zip from GitHub, and unzipped. Copied all files from
ha-config
to the relevant directories, removing them first, and restarted HA. The dashboard was created via the UI of HA, not sure if that might be the problem, but would expect it to work by configuring via the UI as well.Different folder structures:
Expected behavior
I expect it to work :)
Screenshots
Desktop browser (please complete the following information):
Companion App on Smartphone/Tablet (please complete the following information):
Additional context I think that's about it. If you need more information, please let me know.