Home Assistant is one of the most customizable pieces of software you'll find, and if you've spent any time working with its companion app on Android, you've probably scrolled past its Template widget. It doesn't have a flashy icon, and it doesn't come with a setup wizard, but there's more here than meets the eye.
This widget sits right next to more obviously useful options like the Entity widget or the Media Player controls, but once you actually dig into what this widget can do, you'll quickly realize it's one of the most powerful features the HA companion app offers.
Every other widget was designed for you. This one isn't
You write the layout instead of picking one
You see, every other widget in the companion app is purpose-built. The Entity widget shows one entity's state, the Media widget controls playback, the gauge widget draws a dial, and so on. They're all useful, but they're also rigid. You get what the developers designed for, nothing more.
The Template widget flips that entirely. Instead of picking a predefined layout, you write the layout yourself using Jinja2, the same templating language that powers automations, scripts, and template sensors elsewhere in Home Assistant. This means that if you already know how to write a template for an automation, you already know most of what you need for this widget.
The problem, however, is that writing custom templates and configurations has a reputation for being intimidating. That reputation is somewhat deserved, but also somewhat overblown. Jinja2 syntax errors are common when you're starting out, and that's why there's a live preview window built in so you get instant feedback, which saves a lot of frustration. Regardless, if you're working on a more complex template, it's better if you use the Template option in Home Assistant's Developer Tools, as that environment is a lot more forgiving to work in than a phone screen.
Four widgets become one if you're willing to write Jinja2
If/else blocks turn plain text into a status light
The real use for the Template widget shows up when you start combining data sources into one template. Instead of four separate widgets cluttering your home screen for indoor temperature, outdoor temperature, humidity, and a light status, you can fold all of that into a single Template widget using line breaks and basic HTML tags. With a little bit of work, you can end up with something that looks much better designed than a generic Android widget.
Since the widget supports full Jinja2, you can write if/else blocks that change the displayed color or text based on state. A common example is changing the font color to green or red depending on whether an automation is active, effectively turning a plain text widget into a status indicator without needing an icon at all. You can build all sorts of trackers and status indicators by simply playing with colors and entity states.
It renders beautifully. It just can't be tapped
Stack a button underneath if you need it tappable
For all its customizability, the Template widget has one big drawback: it's read-only. It renders text, and that's it. You cannot tap it to toggle a light or trigger a scene the way you can with dedicated action or button widgets.
If you want a widget that both displays a templated status and lets you tap it to control something, one workaround is to layer two widgets on top of each other: a Service Button widget underneath, sized to be tappable, and a smaller Template widget overlaid on top purely for the visual status display. It's a bit of a hack, but it works, and it's a good example of how far supposedly simple widgets can be pushed.
Updates aren't instant in every scenario either. The widget refreshes automatically on relevant state changes, but Android's rate limiting can occasionally slow that down, in which case tapping the widget manually forces a refresh. Data saver mode or restricted background data will also stop the widget from updating altogether, since it needs a live connection to your Home Assistant instance to render fresh templates.
A mini dashboard editor that lives on your home screen
Less a widget, more a skill you already have
Once you understand the syntax, the Template widget starts feeling a lot like a mini dashboard editor that lives on your home screen. You're no longer choosing between a handful of preset widget types; you're designing your own.
Entity by entity, and condition by condition, there are limitless options for what you can make with the Template widget, and that's what it's all about. For anyone who already tinkers with YAML and automations, that's less of a learning curve and more of a natural extension of skills you already have.