Render a Jinja2 template
render_templateEvaluate Home Assistant Jinja2 templates on the server to compute across many entities or test automation logic before deployment; template evaluation is read-only and cannot change state.
Instructions
Evaluate a Home Assistant Jinja2 template on the server through POST /api/template. Useful for computing across many entities at once, for example {{ states.light | selectattr('state','eq','on') | map(attribute='entity_id') | list }}, or for testing a template before putting it in an automation. Templates are read-only and cannot change state.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"template": "<template>"
},
"name": "render_template"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| template | Yes | The Jinja2 template string. | |
| variables | No | Optional variables made available to the template. |