I have previously used very simple template to calculate so called heating number, which I use for certain energy related optimizations. However, 2025.12 version of Home Assistant changed the way statistics are collected and saved, and changes were made to templates too, if I have understood it correctly.
The code below output float before 2025.12. After 2025.12, it outputs string and messes rest of template, because one can’t perform math operations with strings, which is logical: {% set temp_ave = states('sensor.24h_average_outdoor_temp') | default(0) | float %}
sensor.24h_average_outdoor_temp likely to float, because it’s source is HomeAssistant’s builtin Filter (moving average), which in turn receives temp from my EcoWitt weather staion in float/measurement form.
I have tried to study how to correct the code line above to work with current versions. I have tried float/default commands in different order in dev tools, only result being different errors. This is propably very simple thing to fix, but I just don’t know, how to change that line of code. Any help is greatly appreciated!
What exactly are the error messages that you’re getting? I tried this with your template and |typeof returned float, so it should be working with any valid numeric string.
My issue seems related but also has been resolved. I just want to share the issue/fix.
I had multiple templates comparing 2 temperatures. This worked fine until recently and might have been broken by the 2025.12 update (I didn’t have an opportunity to look at it earlier).
The template used to look like this (used to work until it didn’t):
There are two possibilities: either there was a change in the Home Assistant handling the code, or I have had a major brain glitch, and I changed the templates to the wrong coding. Both are equally likely