Attempting to switch to YAML mode and lovelace_gen

you can create one yourself. Just remove all the code from your lovelace_gen files and get a separate view working with the !include.

TBH, to me it seems like you don’t have basic lovelace yaml functionality nailed down and you’re trying to install the hardest, most complicated lovelace modification. You’re trying to run before you know how to walk.

OK. Thanks for all your help. I’ll keep trying to figure it out.

Yeah, I know what you’re saying. I’ve watched plenty of yaml syntax videos, but ultimately I just need lovelace_gen to work for this one view. As you mentioned, we’ve ruled out the issues and its still not working. For things like this, I usually find that reverse engineering working code is the best way for me to learn (e.g. referencing the Raw configuration editor), but for some reason, that doesn’t seem to be a winning strategy in this case. :man_shrugging:

@thomasloven You might want to mention that lovelace_gen is available to install via HACS on your lovelace_gen GitHub page. Also, thanks to you and @petro and the team for creating it and many other HA integrations. I’ll eventually figure out how to harness its power! :laughing:

well you don’t understand basic yaml. Skipping the regular code. You’re making simple mistakes with the yaml, not even the lovelace_gen side.

Bare minimum, this will work:

ui-lovelace.yaml

title: Home
# Exclude entities from "Unused entities" view

views: !include master.yaml

master.yaml

#lovelace_gen
{% set bar = 'bar' %}

- title: Foo
  cards:
  - type: markdown
    content: {{ bar }}

Correct. I do not understand basic yaml. I’ve admitted that at least twice now, but also explained how I’m trying to learn it. I’m not sure how else you’d like me to learn yaml when so much of the basic dashboard design is UI driven. I tried your sample code which also didn’t work for me, so it seems clear to me that something else is (also) going on with my configuration (my issue, not yours).

Again, thank you for your help.

You should try creating the dashboard without Lovelace gen in yaml. Then switch to Lovelace gen. You’d learn the basics of yaml and using !include

For anyone reading this in the future, I got this working after reading this post entry (🔹 Lovelace_gen - Add abilities to ui_lovelace.yaml - #98 by thomasloven).

  1. Using YAML mode with multiple dashboards - When using YAML (with or without lovelace_gen), you only have to put ui-lovelace.yaml into YAML mode if you intend to set your primary dashboard to YAML. That primary dashboard can be left in UI or storage mode and you can selectively set the dashboards you intend to use to YAML mode allowing them to be optionally configured for lovelace_gen ( Multiple Dashboards - Home Assistant (home-assistant.io)).

  2. EVERY dashboard that uses lovelace_gen must have the main YAML file set to reference the #lovelace_gen commented file - The important note here ( hass-lovelace_gen/README.md at master · thomasloven/hass-lovelace_gen (github.com)) mentions it for the primary dashboard (ui-lovelace.yaml), but this also applies to any secondary dashboard using lovelace_gen.

Ironically, after figuring this out, I now feel like I have the basic dashboard structure to experiment (e.g. yaml, lovelace_gen, etc.) in sandbox dashboards without affecting my default dashboard to create code that I can copy over when it’s properly configured.

configuration.yaml

YAMLSandbox.yaml:

YAMLSandboxIncluded.yaml:
image

I intend to make my contribution to HA by submitting recommendations for improved documentation based on what I’ve learned.

3 Likes

Hi, can you help me please?

I didn’t find Developer tools → Info

And I did the same as your images above but the comma {% error remains

I’ll do what I can.

What are you looking for in Developer Tools…and why?

I need more info on what you’re trying to do and some of the code you’re using in order to help.