Integrate water consumption in energy panel

So far yes. But I’m wondering why the template sensor gaz2 is not listed as well. If it is not listed you won’t be able to add it to the energy panel. Bare in mind that when a template sensor is modified you have to click on dev tools / template entities button in order to make the update live

after a restart

gaz2 is accepted in the energy panel.

What is the syntax of the last line without the multiplication?
I also want to thank you for your help and patience.

Great! Could you please tag the answer above as the solution.
What do you mean by

What is the syntax of the last line without the multiplication?

Since indeed there is a multiplication

The incremented value in the knx counter is already in m3 and I put this in the last line

state: "{{states('sensor.compteur_gaz3') | multiply(1.000) }}"

Avec cet affichage:


Multiplication is therefore unnecessary and the code is cleaner without

My problem remains for water
knx.yaml

#Compteur eau (m3)
  - name: compteur_eau_p
    state_address: "9/7/3"
    type: "volume"

configuration yaml

- name: eau
      unit_of_measurement: "L"
      state_class: total_increasing
      device_class: water
      state: "{{states('sensor.compteur_eau_p') | multiply(1.000) }}"

with the error message for the line device_class :slight_smile:
Value is not accepted. Valid values: “apparent_power”, “aqi”, “battery”, “carbon_dioxide”, “carbon_monoxide”, “current”, “date”, “duration”, “energy”, “frequency”, “gas”, “humidity”, “illuminance”, “monetary”, “nitrogen_dioxide”, “nitrogen_monoxide”, “nitrous_oxide”, “ozone”, “pm1”, “pm10”, “pm25”, “power”, “power_factor”, “pressure”, “signal_strength”, “sulphur_dioxide”, “temperature”, “timestamp”, “volatile_organic_compounds”, “voltage”

The only entity selectable as a source in water consumption is this one:
HA-eau2

with this result
HA-eau3

no data displayed
HA-eau4

if I replace “water” with “gas” (also m3) in the device_class, nothing is selectable as source for water consumption

Your are still doing the same mistake. Based on the screenshot entity_id is: sensor.compteur_eau and not compteur_eau_p. This is the reason why state is “unavailable”
Secondly, from what I understood, energy panel is expecting a unit in square meters. So, based on the screenshot, the sensor does report square meters, so you need to multiply by 0.001 to get liters. This has been said over several posts. Sorry to repeat myself.

I made for water a code similar to that of gas

After the code I created a “helper” which offers this:

compteur_eau_p (which is the “entity” containing the consumption knx index) is indeed associated with sensor.compteur_eau

Since version 2022.12.X the device_class water is actually supported and it is possible to implement it at the level of the knx counter. I can now display the consumption of electricity, gas and water.

1 Like