Sensor shows up incorrectly

Hi,
I added my Heatpump as an individual device. I measure the power via a Shelle 3EM. The standard sensors don’t show up in the Energy configuration, so I created a new template sensor:

template: - sensor: - name: “Wärmepumpe Gesamtenergie” unique_id: shelly_3em_wp_gesamtenergie_dashboard unit_of_measurement: “kWh” device_class: energy state_class: total_increasing state: “{{ states(‘sensor.3em_63_gen3_wp_zahler_total_active_energy’) | float(0) }}”

Now I can select the new sensor for the Energy Dashboard but it shows up incorrectly:

Any hint what might be wrong? It looks like it takes the accumulated values instead of the hourly deltas. But I configured state_class: total_increasing?!

Thanks,

Thomas

Adding float(0) is a problem.

You need your sensor to be unavailable if the source is unavailable, not 0. Glitching to zero and back is counted as a huge spike in consumption.