Household Energy Monitoring

I’m using the template sensor to monitor my daily running total energy usage of Gas & Electricity and energy generation from my solar system which works brilliantly and accurately MOST of the time. The only time a error occurs is if I do a restart of HA then sometimes not always the figure will jump. I’m certain the restart is the issue, so is there any way I can add a configuration to stop this happening
image
The running total of my Electricity Usage this morning (the flat horizontal line) was 2.4kWh until I restated HA (after changing a configuration value in my Config.yaml for something else) then after the restart it jumps to 264,000 kWh

Can you provide more info on how the template sensor is calculated/created ?

utility_meter:
  electricity_daily:
    source: sensor.currentcost_electric_meter
    cycle: daily
    offset: 0
    name: Electricity Daily

sensor 10:
  - platform: template
    sensors:
      daily_electricity:
        unit_of_measurement: kWh
        value_template: "{{ (states('sensor.electricity_daily')| float) | round (1) }}"
        friendly_name: Daily Electricity