Issue on calculations

Hi everyone,

I’m encountering some issues on the Energy dashboard.
Although I seem to have this issue only once or twice, it affects my stats a lot.

Here’s what’s happening :

As you can see, the stat on 1 hour is not quite right. Is there a way, maybe by going into the database to correct the data to the right value?

Just in case, here’s my config for the sensor (I basically merge all my sensors together):

- sensor:
  - name: "Compteur ES Maison"
    unit_of_measurement: "kWh"
    device_class: "energy"
    state_class: "total_increasing"
    state: >-
      {{ (states.sensor.eco_devices_teleinfo1.attributes["T1_BBRHCJB"] | float / 1000) + (states.sensor.eco_devices_teleinfo1.attributes["T1_BBRHPJB"] | float / 1000) + (states.sensor.eco_devices_teleinfo1.attributes["T1_BBRHCJW"] | float / 1000) + (states.sensor.eco_devices_teleinfo1.attributes["T1_BBRHPJW"] | float / 1000) + (states.sensor.eco_devices_teleinfo1.attributes["T1_BBRHCJR"] | float / 1000) + (states.sensor.eco_devices_teleinfo1.attributes["T1_BBRHPJR"] | float / 1000) | round(3) }}

Thanks for your help!

To prevent this happening need to add an availability template to make sure your child sensors are numbers. You also need to supply default values for your float filters. Search the forum there are many examples.

To correct the past values go to Developer Tools → Statistics and click on the ramp icon next to your entity. Find the time the bad measurement occurred and replace it with an average of the numbers before and after that measurement.

Thanks. It’s just perfect. I didn’t know this tool existed, it’s awesome!
I will try to add the availability template another time, but I don’t think it would be complicated.