Energy Dashboard shows random high costs after reboot

Since ~25th of May I am noticing that the energy dashboard generates too-high costs upon reboot of Home Assistant.
Ofcourse I can change this via the Developer Settings, Statistics and then the cost sensor for the energy dashboard.

However, this becomes a bit annoying also because you have to specify rather specifically on the timeindex this occured. It’s not a whole list you can scroll through or sort on decreasing amount of value.

Still, the option to correct it, is a workaround.
Any idea on how I can ensure that it’s not going to show up in the future again?

I checked in my stats/logs and suspect that this issue is happening since HA Release 2025.5.3
Before I did not have this issue.

What do the history graphs of your energy sensors look like during a restart?

Which integrations are you using for these sensors (e.g. do you use template sensors)?

I use a P1 Dongle Pro from smart-stuff.nl
Sends it data via MQTT to Home Assistant.
MQTT is the Mosquitto Add-on (switched from EMQX to Mosquitto end of May)

I use the MQTT entity (e.g. “Delivered T1”) for input to the Energy Dashboard.

When I check the sensor, I notice the following:

Some dips occur at times of reboot of Home Assistant. 100% match.
I do not return power to the grid by any means.

Also did a test of rebooting the P1 dongle, it does not occur at that time.

Finally I also just did a test with rebooting Mosquitto, that incurs the dip, but not the calculation error (however the calculation might be done by the hour, so I have to wait another 25 min).

Yeah those dips are your problem. Every time they occur the full height of the spike is added to your energy total.

Are these discovered mqtt sensors or are you using YAML sensors?

If so, share the YAML and it may be able to be fixed.

These are sensors that are provided via MQTT. (I assume).
In the MQTT Device Info, I see them in the MQTT Info.

device_class: energy
value_template: '{{ value | round(3) }}'
state_topic: P1-Dongle-Pro/energy_delivered_tariff1
state_class: total_increasing
device:
  model: P1-Dongle-Pro
  manufacturer: Smartstuff
  name: P1-Dongle-Pro
  identifiers: '<ID>'
unit_of_measurement: kWh
name: Energy Delivered T1
unique_id: energy_delivered_tariff1

The Delivered T1 entity is this one:

The hour has also passed now, no cost increase in the dashboard (yet).

Anyone with some additional insights/tips? Or when I can report a bug/issue?

I have the same problem – almost always after an HA restart, such gaps appear in the measurements. These are Zigbee smart plugs, and I’m using separate containers: MQTT, Zigbee2MQTT (+ Zigbee2MQTT Proxy). It’s indeed very annoying to have to fix the statistics after every HA restart (for example, monthly updates).