Midnight Spikes in Daily Energy Cost since 2024.5

Since i upgraded to 2024.5 i have noticed that i am getting a positive or negative spike in my daily energy cost graph just after midnight each day:

This Daily Energy Cost uses a template sensor:

  - sensor:
      - name: "Electricity Consumption Cost New"
        state: "{{ (states('sensor.daily_energy_new_offpeak')|float * states('input_number.electricity_consumption_tariff_offpeak')|float) + (states('sensor.daily_energy_new_peak')|float * states('input_number.electricity_consumption_tariff_peak')|float) + states('input_number.electricity_day_rate')|float | round(2) - (states('sensor.daily_power_export_to_grid_sungrow')|float * states('input_number.electricity_feed_in_tariff')|float ) }}"
        unit_of_measurement: '$'
        state_class: total
        icon: mdi:home-import-outline
        unique_id: "Electricity_Consumption_Cost_New"

The peak, offpeak and feed-in sensors do not have any spikes:

Has anyone else experiences something similar to this since upgrading.

I don’t have the old graphs now but this is something that has 100% only started with 2024.5, I can log as a bug but i am not really sure if it is something weird about my setup or is an issue others are seeing too.

The spikes don’t seem to be a consistent amount or always the same and “sort themselves out” after they appear.

My hardware hasn’t changed (running docker container on a Pi4 with a MariaDB backend DB on a NAS).

I noticed similar (in my daily energy usage graph) and till now I’m not able to determine the reason or how to solved these positive and negative spikes which appear at midnight. Hopefully someone can give us an hint in the right direction.

I experience the same. This is my config for at least 2 years now without any problems. In the single power lines (L1-3) I cannot see any spikes in the recorder database so I wonder where the spike is calculated at (for me it is always > 8.000kWh).

    - name: "Energy Total"
      unique_id: flat_powermeter_energy_total
      state: >-
        {{ states('sensor.flat_powermeter_l1_energy')|float(0) +
           states('sensor.flat_powermeter_l2_energy')|float(0) +
           states('sensor.flat_powermeter_l3_energy')|float(0) }}
      unit_of_measurement: kWh
      device_class: energy
      state_class: total_increasing
      availability: >-
        {{ states('sensor.flat_powermeter_l1_energy')|float(0) +
           states('sensor.flat_powermeter_l2_energy')|float(0) +
           states('sensor.flat_powermeter_l3_energy')|float(0) > 0 }}