thomasloven / hass-lovelace_gen

🔹 Improve the lovelace yaml parser for Home Assistant
MIT License
209 stars 22 forks source link

!File causes errors in 107.0 #12

Closed JAAlperin closed 4 years ago

JAAlperin commented 4 years ago

Moved resources from ui-lovelace.yaml to configure.yaml (via !include_dir_merge_list) for 107. !file entries then causes parsing errors and Safe Mode. When !file entries removed Lovelace seems to work properly. I've put "# lovelace_gen" as first line in both the included yaml for resources and configuration.yaml.

Here's the log: 2020-03-19 08:44:48 ERROR (SyncWorker_0) [homeassistant.util.yaml.loader] could not determine a constructor for the tag '!file' in "/config/ui-lovelace_resources/ui-lovelace_resources.yaml", line 4, column 8 2020-03-19 08:44:48 ERROR (MainThread) [homeassistant.bootstrap] Failed to parse configuration.yaml: could not determine a constructor for the tag '!file' in "/config/ui-lovelace_resources/ui-lovelace_resources.yaml", line 4, column 8. Activating safe mode.

Want anything else? Thank you Thomas.

aka-raccoon commented 4 years ago

I think this is duplicate of #11 . But I have the same issue. Only workaround so far is: 1) restart Home Asistent with commented sections where - !include is included. 2) after that enable again sections with - !include 3) reload lovelace with service browser_mod.lovelace_reload. 4) repeat this steps every time Home Assistant is restarted..

bend commented 4 years ago

One of the workarounds I found is to include in the configuration.yaml all the Lovelace resources I have a file containing all the Lovelace resources, and I include it in my configuration.yaml This way you don't have to change your Lovelace configuration every time you start homeassistant

eg:


lovelace_gen:

lovelace:
  mode: yaml
  resources: !include lovelace/resources.yaml

and lovelace/resources.yaml

 url: /community_plugin/lovelace-slider-entity-row/slider-entity-row.js
  type: js
- url: /community_plugin/mini-graph-card/mini-graph-card-bundle.js
  type: module
....
thomasloven commented 4 years ago

As mentioned in the readme, operation in the backed configuration cannot be guaranteed.

o0shojo0o commented 4 years ago

One of the workarounds I found is to include in the configuration.yaml all the Lovelace resources I have a file containing all the Lovelace resources, and I include it in my configuration.yaml This way you don't have to change your Lovelace configuration every time you start homeassistant

eg:


lovelace_gen:

lovelace:
  mode: yaml
  resources: !include lovelace/resources.yaml

and lovelace/resources.yaml

 url: /community_plugin/lovelace-slider-entity-row/slider-entity-row.js
  type: js
- url: /community_plugin/mini-graph-card/mini-graph-card-bundle.js
  type: module
....

Thanks for the tip, it worked for me too!