Jinja templates in button card #1106
lisz8
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I recently learned that Jinja templates can be rendered using
rest_command. This allows them to be used in a custom button. However it's not very convenient, since the service calls are asynchronous, and you can't simply assign the result to a name or action.But maybe this technique will be useful to someone, here's a demo.
Rest command
First you need to create a long lived access token and put it into
secrets.yaml, e.g.my_token: Bearer your_very_long_access_tokenCommand:
( if configured with an SSL certificate, the URL should be: "https://localhost/api/template" )
Button card
Beta Was this translation helpful? Give feedback.
All reactions