Here's some YAML code... But where do I put it?

Frequently, as a newer HomeAssistant user, I’ve depended on information online to move forward. One thing that has been really frustrating is that when folks document their YAML or you find a pre-existing reference, it is not clear where that YAML goes.

For instance, the YAML could just be for a card. But it could be for a section. Oh wait, it can also be for the whole dashboard… Sorry it was actually supposed to be manually entered into your (enter folder name here) folder using studio code server.

Not sure what the solution to this would be, but it was my primary frustration for the first month or so.

You could try the official documentation for a hint or two.

I agree, would love a Development Text Box for pasting YAML snippets
& it states: This is possibly a [ Card, Script, Theme ]

2 Likes

The other option is to ask the person who posted the config.

I try to include this information, e.g. look at the first line of this: Automation to display different photos depending on weather conditions - #2 by tom_l

You will also find this in the official documentation examples.

3 Likes

I see two cases:

  1. YAML used in the official docs.
  2. Users posting YAML on the forum.

Tom addressed both. The latter is harder to solve for though.

That said, there are often hints. E.g., for frontend/dashboard cards, there must be a type. If it starts with custom:, then you know it’s HACS or some other third-party thing. Otherwise, you can search for it in the offical docs to see how it must be used.

The other pain point is that users can structure their configs differently. New users will typically start with the default configuration.yaml and e.g. a separate automations.yaml. More advanced/structured users might use packages. This means, which files you’d add things to might vary, but knowing the key under which it would sit is important. If someone says it’s a script, then it’s always under a script: key, etc.

It would be good to see some examples from you, because there could be exceptions to the above.

1 Like

Unless it’s a UI script being edit in the UI YAML editor… then there’s no visible script top level key. :upside_down_face:

Kidding aside, I do think this is a significant source of confusion… The docs almost always use the convention that YAML examples should be written as if they are in configuration.yaml. But, most examples and answers a new user will find on here leave out the top-level keys and IDs because they aren’t used in the UI editors.

2 Likes

Right, thanks. I didn’t know, because I don’t use the UI for that. :+1:

The issue with this is that a newbie wouldn’t know how to ask.
I still don’t know the technical names to use to differentiate
between the YAML that you copy into a card, like the custom card, versus the YAML that would copy to the section or the whole dash. Most new folks are going to be looking for card examples, but a lot of the code given in examples will have
“-type: custom:card” Where the leading “-” will keep it from working.

I hope I’m explaining this in a way that makes sense.

“Hi thanks for the example. Where do I put this”

Yes this does work, but it tends to frustrate folks at times. I only put this suggestion in WTH to see if one of you experienced folks could come up with a clever solution. :wink:

What I’m missing here, especially in the forum, is a start label. What do I mean by that?
In Github you have to fill out a form before opening a thread.

That should also be introduced here. As a beginner, I can’t say exactly what should be asked because I don’t have an overview.
I need informations like:
Integration: yaml, GUI
where and how to configure the sensor (or whatever)…dependencies, affiliations, how to connect with template & co such beginner questions.

I really read a lot, I also collect some code snippets, BUT it doesn’t say anywhere WHERE and HOW you have to insert this code, how to configure it. This is known to most people, but not to beginners.
And it is the beginners who ultimately decide whether a forum stays alive or not.

I’ve already put two ‘project ideas’ aside because I just don’t have an overview, and the documentation is the least helpful here…
There’s a long way to go before HA can REALLY be used for ‘normal’ people…

So long
Pc

1 Like

While I can’t speak to the ability to splash a message on first login - the community maintains this pinned thread:

1 Like

thank you, nathan, you’re welcome!
i will throw an eye on it, thanks.

so long
Pc

In addition to what I said above:

You can also get a small hint from the forum category. Frontend Configuration category → Cards & Dashboards, Configuration category → everything else.