Riemann sum integral Sensor Error

Hello,

Today I’ve seen a weird behaviour with my energy dashboard in HA. My export to the grid integration sensor had a spike, but I’m not seeing a corresponding spike in the real-time sensor.

YAML Code

  - platform: template
    sensors:
      grid_export_power:
        device_class: power
        friendly_name: "Grid Export Power"

        unit_of_measurement: "W"
        value_template: "{{ [0 - states('sensor.solarnet_power_grid')|float, 0]|max }}"

  - platform: integration
    source: sensor.grid_export_power
    name: grid_export
    unit_prefix: k
    round: 2

Have you ever seen a behaviour like the one I’m describing?
Screenshots:

What is different today is that I had turned off the solar panels in the morning and then turned them back on at 11:00. Can you help me to understand why this is happening?

Thanks

Normally, the sensor data for a regular day appears as follows: