templates

Use Jinja2 templating in Home Assistant YAML for dynamic configurations.

Updated Mar 6, 2026
One-click install
npx skills add https://github.com/renne/skills --skill templates-renne
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: templates
Source: https://github.com/renne/skills/tree/main/home-assistant/templates
Command: npx skills add https://github.com/renne/skills --skill templates-renne

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies the creation of dynamic values within Home Assistant automations, scripts, and entities by leveraging Jinja2 templating.

Core Features & Use Cases

  • Dynamic Value Generation: Create responsive configurations that change based on real-time data.
  • Conditional Logic: Implement complex if/else statements and loops for advanced automation control.
  • Use Case: Automatically adjust your thermostat based on the current outdoor temperature and time of day using template sensors.

Quick Start

Use the templates skill to get the current hour from the Home Assistant system.

Frequently Asked Questions about templates

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use Jinja2 templating in Home Assistant for dynamic automation values?

Jinja2 templating in Home Assistant enables dynamic configurations by evaluating entity states, attributes, and filters directly within YAML to generate real-time values for automations and scripts.

Can I create template sensors in Home Assistant to adjust thermostat settings based on outdoor temperature?

Yes, you can define template sensors and binary sensors in Home Assistant YAML to evaluate conditions like outdoor temperature and time of day, enabling dynamic thermostat adjustments and advanced automation logic.

What Home Assistant entity attributes are available when writing Jinja2 templates?

Home Assistant Jinja2 templates can access entity states, attributes, math operations, date and time functions, and support conditional logic with if/else statements and loops for data manipulation.

How do I apply filters and math functions in Home Assistant YAML templates?

Home Assistant templates support Jinja2 filters and math functions to manipulate entity state data, allowing you to calculate values, format strings, and process real-time sensor inputs within YAML automations.

Does Home Assistant templating support conditional logic and loops for automation control?

Yes, Jinja2 templating in Home Assistant supports complex if/else conditional statements and loops, allowing you to implement advanced automation control logic and dynamic data manipulation directly in YAML configurations.

When do I need Jinja2 templates in Home Assistant YAML configurations?

Jinja2 templates are needed in Home Assistant YAML when creating responsive configurations that require dynamic value generation based on real-time entity data, such as building template sensors for advanced automation logic.