Energy calculation serval devices (lights) gets a reset or strange value after reboot

I’m still struggeling with the fact that my energy calculation off my lights often gets a reset after reboot or reload sensors.
I know there are other topics about this but can’t find out in my case what’s the problem. This is the sensor I added in the Energy Dashboard in the section of individual devices:

 - sensor:
    - name: All lights energy
      unit_of_measurement: kWh
      state: >-
          {{states('sensor.keuken_verlichting_spots_energy') | float + states('sensor.keuken_verlichting_werkblad_energy') | float + states('sensor.keuken_verlichting_tafel_energy') | float
          + states('sensor.keuken_buitenlicht_energy') | float + states('sensor.garage_verlichting_trap_energy') | float + states('sensor.shellyplug_s_f8cb1a_energy') | float
          + states('sensor.shellyplug_s_dbf35b_energy') | float + states('sensor.tuinhuis_verlichting_energy') | float + states('sensor.houthok_verlichting_energy') | float + states('sensor.bijkeuken_buitenlicht_energy') | float
          + states('sensor.berging_verlichting_energy') | float + states('sensor.veranda_verlichting_energy') | float + states('sensor.woonkamer_verlichting_kachel_energy') | float + states('sensor.woonkamer_verlichting_kast_energy') | float
          + states('sensor.woonkamer_verlichting_tafel_energy') | float + states('sensor.hall_verlichting_energy') | float + states('sensor.toilet_verlichting_energy') | float
          + states('sensor.inkom_verlichting_muur_rechts_energy') | float + states('sensor.inkom_verlichting_muur_links_energy') | float + states('sensor.inkom_verlichting_spot_energy') | float + states('sensor.inkom_buitenlicht_energy') | float
          + states('sensor.hobbykamer_verlichting_energy') | float + states('sensor.stookplaats_verlichting_energy') | float + states('sensor.badkamer_verlichting_spiegel_energy') | float + states('sensor.badkamer_verlichting_spots_energy') | float
          + states('sensor.dressing_verlichting_spiegel_energy') | float + states('sensor.slaapkamer_joaquin_verlichting_energy') | float + states('sensor.zolder_verlichting_energy') | float + states('sensor.slaapkamer_ouders_verlichting_energy') | float
          }}
      availability: >
        {{ not ( is_state('sensor.keuken_verlichting_spots_energy', 'unavailable') or
                 is_state('sensor.keuken_verlichting_werkblad_energy', 'unavailable') or
                 is_state('sensor.keuken_buitenlicht_energy', 'unavailable') or
                 is_state('sensor.garage_verlichting_trap_energy', 'unavailable') or
                 is_state('sensor.shellyplug_s_f8cb1a_energy', 'unavailable') or
                 is_state('sensor.shellyplug_s_dbf35b_energy', 'unavailable') or
                 is_state('sensor.tuinhuis_verlichting_energy', 'unavailable') or
                 is_state('sensor.houthok_verlichting_energy', 'unavailable') or
                 is_state('sensor.bijkeuken_buitenlicht_energy', 'unavailable') or
                 is_state('sensor.berging_verlichting_energy', 'unavailable') or
                 is_state('sensor.veranda_verlichting_energy', 'unavailable') or
                 is_state('sensor.woonkamer_verlichting_kachel_energy', 'unavailable') or
                 is_state('sensor.woonkamer_verlichting_kast_energy', 'unavailable') or
                 is_state('sensor.woonkamer_verlichting_tafel_energy', 'unavailable') or
                 is_state('sensor.hall_verlichting_energy', 'unavailable') or
                 is_state('sensor.toilet_verlichting_energy', 'unavailable') or
                 is_state('sensor.inkom_verlichting_muur_rechts_energy', 'unavailable') or
                 is_state('sensor.inkom_verlichting_muur_links_energy', 'unavailable') or
                 is_state('sensor.inkom_verlichting_spot_energy', 'unavailable') or
                 is_state('sensor.inkom_buitenlicht_energy', 'unavailable') or
                 is_state('sensor.hobbykamer_verlichting_energy', 'unavailable') or
                 is_state('sensor.stookplaats_verlichting_energy', 'unavailable') or
                 is_state('sensor.badkamer_verlichting_spiegel_energy', 'unavailable') or
                 is_state('sensor.badkamer_verlichting_spots_energy', 'unavailable') or
                 is_state('sensor.dressing_verlichting_spiegel_energy', 'unavailable') or
                 is_state('sensor.slaapkamer_joaquin_verlichting_energy', 'unavailable') or
                 is_state('sensor.zolder_verlichting_energy', 'unavailable') or
                 is_state('sensor.slaapkamer_ouders_verlichting_energy', 'unavailable') or
                 is_state('sensor.keuken_verlichting_tafel_energy', 'unavailable') ) }}
      device_class: energy
      state_class: total_increasing
      icon: mdi:transmission-tower

Any idea what’s wrong?
Thx in advance

Please format your pasted configuration correctly.

Sorry, now it’s formatted correctly.