Type conversion template functions

These template functions convert values between text, numbers, and other types, and let you check what type a value currently is. Use them whenever you need to turn sensor states into numbers for math, or verify the shape of data before acting on it.

Home Assistant extends the Jinja2 template engine with many custom functions, filters, and tests. Each function on this page has its own page with detailed descriptions, parameters, and practical examples.

New to templates? Start with the templating documentation to learn the basics.