Need some help with the energy dashboard

Try adding availability templates to your energy template sensors:

template:
    -sensor:
      - name: "Gasverbrauch"
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: total_increasing
        state: "{{ (states('sensor.brenndauer_tag')|float(0) - states('sensor.speicherladung_tag')|float(0)) * 4.95 }}"
        availability: "{{ has_value('sensor.brenndauer_tag') and has_value('sensor.speicherladung_tag') }}"
      - name: "Gasverbrauch Speicherladung"
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: total_increasing
        state: "{{ states('sensor.speicherladung_tag')|float(0) * 14.84 }}"
        availability: "{{ has_value('sensor.speicherladung_tag') }}"

During home assistant start up the source sensors may not be available before the template sensors and the float(0) filters will render the state values with your specified default of 0.

This will stuff the energy dashboard right up. The availability templates should prevent this occurring.

some value → 0 → some value: add the entire value to the energy used.
some value → unavailable → some value: do nothing.

I don’t see any evidence of this in your history graphs but you may not have shown the times this occurred.

BTW this 3rd party integration may be an easier way to do it: