Closed marcolino7 closed 7 months ago
{{ state_attr('sensor.consumo_caldaia', 'last_period') | float }} Wh
Could you test this template in Dev tools -> Template? I observe SAME output for all defined number formats.
Seems this is a common issue with templates in HA. The number is stored in DB as a string with a "point" separator (seems to be); only Frontend shows converted values dependingly on user settings. But templates give us data "as is". Check the Markdown card too - it shows "raw" data too:
In short - this is not a bug. This happens because we show data "as is" and do not apply a filter "convert_to_local_settings" (because there is no such a filter in Templating exposed to users).
Hi, you are right. I will ask to HA community.
Thanks
Hi, for who have my issue, here is a fancy solution:
Hi, I use this plugin to templating some numbers. I am in Italy so we use comma as decimal separator and dot as thousand separator. As you can see in screenshoot, the red rounded line is templated, comma separator il wrong and thousand separator missing. All other values that are not templated, are fine. Here is template I use:
{{ state_attr('sensor.consumo_caldaia', 'last_period') | float }} Wh
Thanks in Advance Marco