YAML, visual editor, Jinja, Java script, triple square brackets... how does it hang together?

Well I knew it was going to be a steep learning curve, that’s how it goes. But that doesn’t make it less frustrating :slight_smile: I’m grateful for the community and the documentation! But after days of reading up on both I’m still struggling to put the puzzle together. Apologies if its clearly described somewhere and I missed it.

On a dashboard card editing there’s an option to use the ‘code editor’. Is that YAML? if so, I’ll request that as a change to say something like ‘code editor (YAML)’

Thanks to a post in a long thread somewhere I now understand YAML is not a programming language and you can’t do much logic in it. Thank you community! We use Jijna for that. But there are also many references to JavaScript. are they related, the same, or different? and if there are these 2 options, are there more? Are they all included inside YAML?

What about the triple square brackets, I guess that demarcates a different code inside YAML - Jinja code? or JavaScript? or something else? I also see {{{ and {% (I think) and I wonder if I should know about that. It would help me interpret the many great examples.

Grateful for your answers, or links to documentation.Cheers!
Bas

Only custom frontend cards use javascript as their template engine.

They are not related at all. Every single one uses different syntax. They all attempt to provide similar syntax.

JS, only for custom button card.

{{ }} and {% %} is Jinja. That’s the only official template engine provided by HA. I don’t think I’ve ever seen any card use {{{, you’d have to point that to me and I could tell you what language it is.

2 Likes

Thank you for this @petro, that helps a lot. I think ‘templates’ in my world have always meant something completely different and it threw me off, assuming it’s not something I would need. I may have made up the {{{, confused by all the brackets. I’ll let you know I’ll find one in the real world :slight_smile: