Hello,
I have this code generating this display.
value_template: "{{ states('sensor.daily_energy_creuses') | float + states('sensor.daily_energy_pleines') | float | round(2) }}"
Is there a bug in my formula ?
Hello,
I have this code generating this display.
value_template: "{{ states('sensor.daily_energy_creuses') | float + states('sensor.daily_energy_pleines') | float | round(2) }}"
Is there a bug in my formula ?
Nope. round() is a function that is subject to the precision problems of floating point math.
You want to format the output instead.
value_template: "{{ '%.2f'|format( states('sensor.daily_energy_creuses') | float + states('sensor.daily_energy_pleines') | float) }}"
Thanks you !