KNX Energy Dashboard Gas & Water with Counter

Hi there,
I try to get my KNX-Counters working but i am not sure what i am doing wrong.
On my KNX-System the Input is configured as Counter → Type 13.001

Thats the configuragtion i added in my configuration.yaml:

  sensor:
    - name: "Gas Impuls"
      state_address: "7/3/4"
      type: pulse_4byte
      sync_state: every 5
      state_class: total_increasing

customize.yaml:

sensor.wasser_impuls:
  friendly_name: Wasser in m3
  device_class: water
  unit_of_measurement: "m³"
  value_template: "{{ ( states('sensor.wasser_impuls') | int / 1000 ) | round(1) }}"

I saw the chart for the counter, but im not able to inplement the state into my energy dashboard.

Please give me an adverdise what i am doing wrong.

Thanks!
Kind regards

Hi :wave:!
I don’t think value_template is a valid key for customie.
What HA version are you using? In 2022.12 you can configure device_class directly at the knx sensor configuration.
Maybe do a screenshot of the states found in /developer-tools/state.

Hi farmio,
thanks for your fast feedback.

Here is the screenshot what you want:

if you want to use value_template you will have to create an extra template entity. See https://www.home-assistant.io/integrations/template/#state-based-template-binary-sensors-buttons-numbers-selects-and-sensors

Is this now about “gas” or “water” ??

It’s about gas but for me it’s completle the same setting with water because there i have the same setup.
I thought i need to make this value_template because the impuls-rate is 0,01 for the gas. So 100 Impulses would be 1m3.

You can’t change the value of an existing entity, you can only use it as input for a new template entity.

can you give me especually a short example ?
But for now, did you see anything wrong why i can’t get the state available in the energy dashboard?

there are plenty of examples here in the forums or in the documentation https://www.home-assistant.io/integrations/template/#state-based-sensor-changing-the-unit-of-measurement-of-another-sensor
I don’t know why it can’t get added to the energy dashboard. To me it looks fine, but I only know that problem from electrical engergy, not from gas or water.