Energy Dashboard with splitted Energy Usage

Hi all,

I would like to use the Energy Dashboard with home usage and solar production data. Data come from the Kostal Plenticore Solar Inverter integration.

My heat pump is the largest consumer of energy. As a result, I would like to see the heat pump energy consumption already in the “Energy Usage” as individual bar. The head pump consumption is also displayed under “Monitor individual devices”, however this is not split down to hours.

In order to achieve this, I defined the following sensors:

  • “Wärmepumpe Energiezähler mit Nachkomma” → energy consumption from the heat pump
  • “Energie Dashboard - Hausverbrauch von Grid ohne Wärmepumpe” → Calculated via sensor template

The second value is calculated as follows:

  - sensor:
      - name: "Energie Dashboard - Hausverbrauch von Grid ohne Wärmepumpe"
        unique_id: energy_from_grid_wo_heatpump_exact
        unit_of_measurement: "kWh"
          '{{ states("sensor.scb_home_consumption_from_grid_total") |float(0) |round(2)
          - states("sensor.warmepumpe_energiezahler_kwh_mit_nachkomma") |float(0) |round(2) }}'
        device_class: energy
        state_class: total_increasing
      - name: "Wärmepumpe Energiezähler (kWh) - mit Nachkomma)"
        unique_id: warmepumpe_energiezahler_kwh_mit_nachkomma
        unit_of_measurement: "kWh"
        state: '{{ states("sensor.warmepumpe_energiezahler_wh") |float(0) |round(1) / 1000 }}'
        device_class: energy
        state_class: total_increasing

The energy consumption of the heat pump comes from a KNX sensor:

    # Wärmepumpe Energiezähler Wh
    - name: "Wärmepumpe Energiezähler (Wh)"
      state_address: "9/2/8"
      type: active_energy
      state_class: total_increasing

Whereas the result from the screenshot looks good, I have an issue with each restart of HA. Often, the calculated values are then resulting in a peak consumption, as you can see here:

Do you know, what the issue is? How could I prevent this behaviour? Did I configure the sensor calculation wrong?



Don’t know for sure, but I think the knx sensor is “unavailable” after restart until the value was received from KNX Bus. In this short period your default value “0” is applied in the template - thus a new meter cycle is calculated.

Id just use the knx sensor entity without a template for the energy dashboard.

Thanks for your response. I will try that.

Regardless from this, the following question pops into my mind:
The energy counter has an increasing value and will not be reset. Would the state_class „total“ make more sense? Or could the same effect occur as well when HA is restarted as long as HA gets no value from the group address?

Thanks a lot,


I think state_calss: total can’t be used in the energy panel. Not sure though.

The effect is probably the same as you use | float(0) which evaluates to 0 when the state is “unknown”.

Since 2022.12 you can just add device_class: energy to a knx sensors yaml config directly. No need for the templates and “unavailable” is also handled correctly.