This browser cannot run the template engine. A current version of Chrome, Edge, Firefox, or Safari is required.
Supported Home Assistant functions and caveats
The engine is real Python jinja2, so syntax, filters, tests, and namespace() behave exactly as Home Assistant's do. The Home Assistant functions below are stubbed over the sample state you provide, not read from a live instance.
states("entity.id")the state string, or None when the entity is not in your samplestates.sensor.kitchenthe state object: .state, .attributes, .name, .entity_idis_state("entity.id", "on")True when the sampled state matchesstate_attr("entity.id", "attr")an attribute value from your sample, or Noneis_state_attr("entity.id", "attr", v)True when the sampled attribute matcheshas_value("entity.id")True unless the state is unknown or unavailablenow(), utcnow()the real current time, in your browser time zoneas_timestamp, as_datetime, as_localthe Home Assistant time helperstimedelta, strptimefrom the Python datetime modulefloat, int, timestamp_custom filtersthe common Home Assistant filters
Not stubbed, because they need a running instance or the network: service calls, expand() over live groups, distance() to real coordinates, and device or area lookups. These read from a live Home Assistant, so they cannot be reproduced from sample data here.
Everything runs in this tab: your files and inputs never leave your device.
Related tools
- Compose ConverterMove between docker compose YAML and docker run commands in either direction.
- systemd Unit BuilderGenerate a production-ready systemd service unit with sane restart, ordering, and security hardening.
- RAIDZ CalculatorCalculate usable capacity, parity overhead, fault tolerance, and mean time to data loss for a ZFS RAIDZ, dRAID, mirror, or stripe pool.
- WireGuard ConfigGenerate WireGuard key pairs and ready-to-use configs with QR export for phones.
- GAM Command BuilderBuild correct GAM commands for Google Workspace admin tasks from plain English intent.
- Log File AnalyzerSummarize an access or application log: traffic, status codes, top paths, slow requests and errors, without uploading it anywhere.
What it does
Renders Home Assistant Jinja templates in your browser using the real Python jinja2 engine, the same engine Home Assistant uses. You define a sample set of entities with their state and attributes, then the tool stubs the Home Assistant template functions (states, is_state, state_attr, now, and more) over that sample data so your template runs exactly as it parses. Because it is real jinja2, constructs that other online testers get wrong, like namespace() and the full filter set, work here.
How to use it
Write your template in the top editor and describe a few entities in the sample state editor below it, as YAML or JSON. Load the template engine once (about 13 MB, cached for later visits), then the output updates as you type. Template errors are shown with the line number and the reason, so an unclosed tag or an undefined variable is easy to find.
Why this one
Home Assistant's own template editor needs a running instance you can reach, and the popular online Jinja testers use a JavaScript engine that does not match Home Assistant: it has no namespace() and no HA functions, so templates that work there can still fail in your config. This one runs the real Python jinja2 engine with the Home Assistant functions stubbed over sample state you control, so what renders here is what the template language does. Everything runs in this tab: your files and inputs never leave your device.
FAQ
- Does this match Home Assistant exactly?
- The template engine is identical: real Python jinja2, so syntax, filters, tests, and namespace() behave the same. The Home Assistant functions are stubbed over the sample state you provide rather than read from a live instance, so states, is_state, state_attr, has_value, and states.<domain> are faithful to your sample. Functions that need a running instance or the network are not stubbed: service calls, expand() over live groups, distance() to real coordinates, and device or area lookups. now() and utcnow() use the real current time.
- Why the large download?
- Rendering real jinja2 means running Python, so the tool downloads Pyodide, a build of CPython compiled to WebAssembly, plus the jinja2 and MarkupSafe packages. That is about 13 MB total, fetched only when you choose to load the engine and cached so later visits are instant. It is served from this site, never a third party.
- Is my template uploaded anywhere?
- No. The engine and your template both run inside this browser tab, and the page works offline once the engine is cached: your files and inputs never leave your device.
Keyboard shortcuts: press ? anywhere on this page to see them.