Energy monitoring shows wrong values of sensors of state_class total_increasing


for beeing able to add a sensor to the energy monitoring, it is necessary that the sensor values are “total_increasing”.
As this option can’t be set in Tasmota smart plugs that deliver a state “measurement”, I created template sensors for each smart plug to convert the measurement value into total_increasing:

  - sensor:
      - name: "dryer power usage daily"
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        state: "{{ states('sensor.tasmota_a_energy_today')|float}}"

I did the same thing for my heat pump sensors running on ESP-home, where I actually have the possibility to change the consumed power to total_increasing. But if I want to see the values also in a statistic diagram, I need them as state_class “measurement”. So I created template sensors also for my daily-use heat pump sensors, that reset every 24 h to zero.

By this I can now include the template sensors in the energy monitor. But the showed values in energy monitor are different to the actual sensor states.
e.g I see for the heat pump a value of 4.24 kWh for today in the energy monitor. The sensor itself, when I click on it, shows a value of the 3.451 kWh.
Another sensor of the washing machine shows 0.47 kWh in the energy monitor while the actual value of the sensor is currently 0.718 kWh.

And additionally I have a KNX-sensor showing the power usage of my network devices (no template sensor is used here). It shows 1 kWh in the energy monitor, but the sensor value is at 2 kWh.

So this seems to show randomly too high or too low values in the energy monitor.
Why is that?

Did you ever solve that? I have the same problem on a few sensors.

I solved my problem: Sensor template values and energy dashboard do not match - #3 by jaegerschnitzel