YAML Functions Reference guide

So I’m starting to get ever deeper in templating. I can do want I want most of the time, but there are times where I don’t know the name or a function or how to code it, even though such a function would probably exist as it’s a common one in other programming languages
My issue right now is finding a list to use as a reference other then searching on this forum for someone that may have implemented what I want (thinking of @pnbruckner and @petro who have helped me loads with this)

So the big question is: is there a YAML functions reference guide out there that I could save as a favourite?

1 Like

Hi @lolouk44, please fix the missing space after @pnbruckner.

I think @pnbruckner and @petro are the:
“Living YAML functions reference guide” :grinning:

2 Likes

Thanks, sorted.
And could not agree more with your comment, but ideally I want a list I can access any time. I know @pnbruckner and @petro will come to my rescue really quick, but don’t want to rely on them all the time. And who knows, maybe I can start helping others with more advanced requests too after this

+1
Its very annoying searching the web everytime… :slight_smile:
http://jinja.pocoo.org/docs arent really readable IMO

1 Like

Thanks, that’s actually a good starting point, already bookmarked the index:
http://jinja.pocoo.org/docs/2.10/genindex/

I’ve noticed a small chuck of the jinja API is missing too, just to warn you. I can’t think of any functions off the top of my head, but I have ran into my fair share. Anyways, I use the docs that @letsoulfly use. I also reference these pages quite frequently for the Home Assistant only API jinja calls:

and this page for the trigger object shape:

1 Like

I, too, often reference the HA docs, and the jinja docs they point to. Remember, though, a lot of the solutions I’ve seen and have come up with myself use a lot of Python, too. If the template includes a Python object (like a datetime, timedelta, dictionary, etc.) you can use any methods those object normally have. (E.g., …last_changed is a datetime, so you can do last_changed.date(), or you can subtract it from now(), which also returns a datetime, to get a timedelta, etc.) So what we really have is a combination of YAML, Jinja and Python.

2 Likes