Energy dashboard - negative spike every start of the day

hi all, merry christmas!

I hope I can get some warm help on a long lasting problem… an energy dashboard spike. Every day.

I described it here and maybe several other places (discord) but never got it solved.

The problem is as follows:

Every start of the day I have a negative spike as big as the total gen of the day before.

the sensor comes directly from esphome (modbus:


sensor:
  - platform: growatt_solar
    energy_production_day:
      name: "${esp_name} - Today Gen"
      id: todaygen
      filters:
         lambda: |-
            if (id(inverter_status).state != 0) {
                return x;
            }
            return {};

Also resetting it every night did not help:

time:
  - platform: homeassistant
    id: homeassistant_time
    on_time:
      # Every morning on weekdays reset ID todaygen
      - seconds: 0
        minutes: 0
        hours: 0
        #days_of_week: MON-SUN
        then:
          - lambda: id(todaygen).publish_state(0);

There is no need to keep creating new topics about this. The answer is the same as last time: