You cant use templates in the core version of Lovelace.
baunan’s and obaldius’ examples work because they are calling the service with a template in the backend (an automation or script), not the frontend (Lovelace).
You have two options:
- Put your service call and template in a script. Call the script from Lovelace. Or
- use a custom Lovelace template card. This uses JavaScript templates, not jinja.