-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incompatible with 2022.7? #39
Comments
I'm having the issue and commenting out some of my includes makes it work, but i cannot for the life of me see why those are causing it to fail. Doesn't seem to be anything in the breaking changes of 2022.7 that would apply to me. |
The only thing I can see is that Home Assistant changed to Python 3.10 and that the jinja2 package has been updated and the integration doesn't pin the version: https://github.com/pallets/jinja/releases Can't yet see why it should break though. |
I think it has to do with "Our YAML & JSON tooling improved, using faster libraries and methods". Other than with But it's a strange issue: my YAML files using |
Bit more digging, i found this in my log file.
Path is correct, if i remove # lovelace_gen and change to a standard card include in that file (ie no jinja2) it picks up the file in that location. edit Some more oddities.
This works with multi level attributes but no # lovelace_gen at the top of the file. Something very weird is going on. add # lovelace_gen at the top and it breaks. |
So dug into the changes in the core yaml loader which this imports and it seems references to SafeLineLoader have been replaced with LoaderType I've not tested yet, but I'm guessing these two lines.
Need to change. |
So just pored over the jinja2 loader.py file and found that split_template_path will throw a template not found if the path has a .. in it. I was doing this to keep cards, dashboards and views seperate. Soon as moved them all into the same directory its started working. Not saying the lovelace_gen doesn't need some work to follow the improvements made in the latest release as it does look like it does to me, but will leave that up to @thomasloven |
@chriscolden Does it mean it then works for you on the latest version of HA? I'm still struggling to get it to work at all after upgrading |
yeah im working again it would seem. which means i had to ../ out the directory to get to my next inlcude. Just moved to then replaced ../ with ./ and it seems to have sprung into life. |
@IDmedia do you see this in your logs when you load a dashboard? jinja2.exceptions.TemplateNotFound: /config/lovelace/dashboards/../views/office.yaml |
No, I'm not using '..' in the path. No visible errors in the logs or console except the "unknown error" message when trying to view the dashboard. |
you will have to post some examples. maybe create a new dashboard for testing, or at least comment out most of it and post whats not working for you. |
The example is in the initial post (same goes for the path). Once I comment the lovelace_gen yaml out everything works so I know it's causing the issue. Something changed in the latest version of HA, just not sure what yet. |
So what's in the lovelace/xiaomi_vacuum.yaml file? just standard yaml? |
Did you see this about that file. Important: For some reason, which I can't seem to nail down, things stop working if you add # lovelace_gen to ui-lovelace.yaml. Adding it to any file included from ui-lovelace.yaml works, though. |
I'm not using lovelace_gen in that file. mines still on storage mode, and i include a separate dashboards which use lovelace_gen. thats the only think i can glean here. |
Anyone was able to sort it out? |
It's working for me now so you will need to post your config. |
Mine isn't working as well, configuration.yaml -
lovelace_floorplan_desktop.yaml -
lovelace_floorplan_data.yaml - |
Sounds stupid, but try adding ./lovelace_floorplan_data.yaml |
Didn't work unfortunately. If I remove both the includes only then it works (rendering an empty page) |
Can you post your lovelace_floorplan_data.yaml view. Edit: lovelace_floorplan_desktop.yaml does that have a # lovelace_gen at the top? |
Yes it has "# lovelace_gen" on top, and so does the lovelace_floorplan_data.yaml file |
This is the lovelace_floorplan_data.yaml file, |
That's interesting, seems like if you had the entities\images it would work, i just get an "unknown error". |
Sure. I've just had to pop out so will do that later today. |
Thanks @chriscolden, I really appreciate it. |
Hey, sorry ran out of time yesterday. I've included all the way down to one of my most complex cards but haven't included all the cards the view includes. Nothing is out there. I dont use macros but everything else is pretty much the same as what you have. |
Thanks a lot @chriscolden! |
I find out that it's the variables that causing it to not work for some reason. Doesn't work:
Works:
Anyone knows why or how to solve it? |
I cannot make work the yaml with includes function. I want to make optimization of ui-lovelace.yaml, but for me, the folder structure, does not work. Logs do not tell me what is wrong. My configuration.yaml has:
In the left menu, I see the button name "Test", but when I click on it it shows only yaml cards that are in it, but not what is included. My code of test.yaml:
lovelace\test.yaml has code:
Can somebody help to debug this issue? Thank you in advance! |
You have a space after your ! And an s on the end. It should be.
|
Thank you! It works! I had the wrong guide. |
I just put up a PR that should fix this in #42. It undoes the performance improvement (using the C Loader for YAML) from Home Assistant 2022.7, but that seems to be an acceptable trade off. |
Thank you, this solved my problem!!!! now i'm runing 2022.10 without a problem.. |
Tried upgrading HA to 2022.7 and I'm getting "Unknown error" without any errors in the console or logs.
Can't get the UI to show until I comment out my lovelace_gen include. Anyone else having this issue?
Example from my UI-lovelace.yaml file causing the error:
The text was updated successfully, but these errors were encountered: