Template formula to use in energy dashboard

Hi,

I like to add my heating system to the energy consumption in the energy dashboard. Same what I can do with power plugs etc.

The value must be calculated out of the subtraction of two power meter values: Z1-Z2. It’s called “Messkonzept 7”.

My attempt was this template configuration. I simply can’t make it work. Currently it’s not returning values at all. And it is also not listed in the energy dashboard to add to “Monitor individual devices” section.

Any advice on this? Thank you! :slight_smile:

/homeassistant/configuration.yaml

template:
  - sensor:
    waermepumpe_power_cur:
        friendly_name: "Wärmepumpe current consumption"
        unique_id: "waermepumpe_power_cur"
        device_class: energy
        unit_of_measurement: 'Wh'
        value_template: "{{ states('sensor.tasmota_pwrz1_power_cur') | float - states('sensor.tasmota_pwrz2_power_cur') | float }}"
    waermepumpe_power_total:
        friendly_name: "Wärmepumpe total consumption"
        unique_id: "waermepumpe_power_total"
        device_class: energy
        unit_of_measurement: 'kWh'
        value_template: "{{ states('sensor.tasmota_pwrz1_total_in') | float - states('sensor.tasmota_pwrz2_total_in') | float }}"

Look at the example here then try again: