How to fix statistics data (e.g. energy data)

@nemezis336 The listing which I gave comes exactly from my configuration so I can confirm it works

Of course you need to change all the entity names in it.

The logic is pretty simple. If the owl_energy_total value is 0 then return energy_total (it’s own, same/unchanged) value, if not then provide the new value from owl_energy_total. Please note that I multiply there by 0.001 to convert Wh to kWh and at the end I round the output.