Water Meter in Energy Dashboard Not Available

Hi all. I just upgraded Home Assistant Core to 2022.11.0 and was hoping to add my water meter to the Energy dashboard now that there’s a way to do that. However, when I go to add the meter, it says there’s “No matching statistics found”. I get my water meter data through the “Eye On Water” HACS integration. That integration reports water usage in “gal” (US gallons). The Energy pane appears to be expecting an entity reporting in either cubic meters (m3) or gigaliters (???) (gl). See screenshot attached. I’m not familiar with common water meter units of measurement outside the USA, but a gigaliter seems like a very large unit to measure residential water usage. Or, is the Energy pane looking for gallons but just expecting the statistics to show “gl” instead of “gal”? I’ve never seen gallons abbreviated as “gl” though.

2 Likes

Same issue for me, I made my own water meter using ESP8266 with values in liters but can’t be detected in the Energy dashboard.

You must add all statistic-needed attributes (unit_of_measurement, device_class & state_class).

Check my template sensor config (water pulse meter data from nodemcu running tasmota):

    - name: "water_meter_total_m3"
      state: >
        {{ states('counter.voda') |float * 0.001 }}
      unit_of_measurement: m³
      device_class: water
      state_class: total_increasing

image

image

3 Likes

I am using wmbusmeters for my wireless m-bus meters. I think I have everything set correctly, but it still does not show up for me in the energy dashboard config.

mqtt:
  sensor:
    - state_topic: "wmbusmeters/ColdWater"
      json_attributes_topic: "wmbusmeters/ColdWater"
      unit_of_measurement: "m3"
      state_class: total_increasing
      device_class: water
      value_template: "{{ value_json.total_m3 }}"
      name: Cold Water
      icon: "mdi:gauge-low"
      unique_id: cold_water
    - state_topic: "wmbusmeters/HotWater"
      json_attributes_topic: "wmbusmeters/HotWater"
      unit_of_measurement: "m3"
      state_class: total_increasing
      device_class: water
      value_template: "{{ value_json.total_m3 }}"
      name: Hot Water
      icon: "mdi:gauge"
      unique_id: hot_water

Just guessing: m3 x m³?

I kind of sort it out adding this to my configuration.yaml:

template:
  - sensor:
      - name: "consumi"
        state: "{{ states('sensor.total_water_used')|float * 0.001 }}"
        unit_of_measurement: m³
        device_class: water
        state_class: total_increasing

However, I find quite weird that, from an entity in “L”, I have to create another one in “m3” which will be displayed in “L” in the Energy tab… :confused:

6 Likes

Here same issue. ESPHome entities are not visable while device_class: water, state_class: total_increasing and unit_of_measurement: m³ are configured. Even tried with unit_of_measurement: m3. Without any result.

I’m also trying to add my water sensor to the energy dashboard but it is also not available.

What do I wrong?

ESPHome:

sensor:
# ⬇ watermeter ⬇ #
  - platform: pulse_counter
    pin: D2
    id: watermeter_pulse
    name: "watermeter pulse"
    update_interval: 1s
    unit_of_measurement: L
    accuracy_decimals: 1
    filters:
      - multiply: 0.01342282
# ⬇ Totaal watermeter ⬇ #      
    total:
      id: sensor_pulse_meter_total
      name: "watermeter Totaal"
      icon: "mdi:cube-outline"
      unit_of_measurement: "L"
      accuracy_decimals: 1
      filters:
      - multiply: 0.8

In Home Assistant:

utility_meter:
  waterverbruik_per_dag:
    source: sensor.watermeter_totaal
    cycle: daily    

sensor.waterverbruik_per_dag is not available as option in the energy dashboard for water.

Thanks, looks like m³ helped :expressionless:
I am still waiting for cold water to show up, but I think it is just a matter of getting at least one update from the meter. Both meters now show up after they read new values using the “new” unit of measurement.

1 Like

I guess ‘L’ does not work, although it is supported by the water device_class.

In my ESPhome I have this:

- platform: pulse_meter
  pin: GPIO13
  name: "Water Flow Meter"
  unit_of_measurement: "L/min"
  icon: "mdi:water"
  internal_filter: 100ms
  timeout: 20s
  total:
    name: "Water Total"
    unit_of_measurement: "L"
    device_class: water
    state_class: total_increasing
    icon: "mdi:water"

I set the unit_of_measurement, device_class and state_class, but I cannot select the sensor in the energy dashboard. I also have the hourly, daily and monthly utility sensors.

If I need to change it to m³, what happens to my history? Can I do a mysql database update query to the measured data in ‘L’ ?

I have a similar problem. My gas consumption is defined as:

mqtt:
  sensor:
    - name: "Gas volume consumption"
      state_topic: "gasmeter/main/value"
      value_template: "{{ value| float }}"
      unit_of_measurement: "m³"
      state_class: 'total_increasing'
      device_class: 'gas'

This shows up in my energy dashboard under “Gas Consumption”.

However, my water consumption which is coming from a similar device is defined similarly as:

    - name: "Water consumption"
      state_topic: "watermeter/main/value"
      value_template: "{{ value| float }}"
      unit_of_measurement: "m³"
      state_class: 'total_increasing'
      icon: "mdi:faucet"
      device_class: "water"

This doesn’t show up under “Water Consumption” in the energy dashboard.

Is it expected that it behaves differently than gas consumption?

I’m pretty sure that the statistics required states need to go in your home assistant config, not the esphome one.

It looks correct. Maybe use only single quotes not double. I do not use any quotes and it works. You may need a statistics sensor, but it should at least show up in the dropdown.

sensor:
  - platform: statistics
    entity_id: sensor.water_consumption
    state_characteristic: mean
    sampling_size: 20

Not sure why the devs made it so darn complicated!

I managed to get data for water consumption but somehow very strange :wink:
Based on following incomplete ESPHome device config

sensor:
  - platform: pulse_counter
    pin:
      number: D4
      mode: INPUT_PULLUP
    count_mode: 
      rising_edge: DISABLE
      falling_edge: INCREMENT
    name: 'Conso Eau Potable'
    id: 'h2oPotable'
    unit_of_measurement: 'L'
    icon: 'mdi:water'
    internal_filter: 10ms
    state_class: measurement
    filters:
      - lambda: |-
          if(x==0){
            return {};
          } else {
            return x;
          }
    total:
      name: 'Eau Potable : volume total'
      device_class: water
      state_class: total_increasing
      unit_of_measurement : m³
      filters:
        - multiply: 0.001
  - platform : integration
    name : testintegration
    sensor: h2oPotable
    time_unit: min
    device_class: water
    state_class: total
    unit_of_measurement : m³

I got the following results in the dashboard

The sensor used is “testintegration” , what’s the prb (except negative value & very high values) :wink:
Thx

I created statistics and it indeed shows up. Strange however that this wasn’t needed for my gas consumption.

Also the configuration for water in the energy dashboard it gives the warning:

Last reset missing. The following entities have state class ‘measurement’ but ‘last_reset’ is missing:…

I’m not sure if that is a problem?

FYI, I added the new water device class and converted to m3, below works for gas and water:

sensor:
  # Device class, icon, and accuracy are not inherited from main sensor, manually repeat
  - platform: pulse_meter
    pin:
      number: GPIO32
      mode: INPUT_PULLUP
    internal_filter_mode: PULSE
    internal_filter: 100ms
    timeout: 60s
    unit_of_measurement: 'gal/min'
    accuracy_decimals: 3
    name: ${device_name}_water_meter
    icon: 'mdi:water'
    filters:
      - multiply: 10
    total:
      name: ${device_name}_water_meter_total
      icon: 'mdi:water'
      device_class: 'water'
      id: water_total
      unit_of_measurement: 'gal'
      accuracy_decimals: 3
      filters:
      - multiply: 10
  - platform: pulse_meter
    pin:
      number: GPIO33
      mode: INPUT_PULLUP
    internal_filter_mode: PULSE
    internal_filter: 100ms
    timeout: 60s
    unit_of_measurement: 'ft³/min'
    accuracy_decimals: 3
    name: ${device_name}_gas_meter
    icon: 'mdi:fire'
    filters:
      - multiply: 10
    total:
      name: ${device_name}_gas_meter_total
      icon: 'mdi:fire'
      device_class: 'gas'
      id: gas_total
      unit_of_measurement: 'ft³'
      accuracy_decimals: 3
      filters:
      - multiply: 10
  # https://esphome.io/components/sensor/template.html
  # TODO: l unit for water is not used, m³ is used, remove l when no longer needed
  - platform: template
    name: ${device_name}_water_meter_total_l
    icon: 'mdi:water'
    device_class: 'water'
    state_class: 'total_increasing'
    accuracy_decimals: 3
    unit_of_measurement: 'l'
    # Convert gal to l
    lambda: |-
      return id(water_total).state / 3.785;
  - platform: template
    name: ${device_name}_water_meter_total_m3
    icon: 'mdi:water'
    device_class: 'water'
    state_class: 'total_increasing'
    accuracy_decimals: 3
    unit_of_measurement: 'm³'
    # Convert gal to m³ 
    lambda: |-
      return id(water_total).state / 0.003785;
  - platform: template
    name: ${device_name}_gas_meter_total_m3
    icon: 'mdi:fire'
    device_class: 'gas'
    state_class: 'total_increasing'
    accuracy_decimals: 3
    unit_of_measurement: 'm³'
    # Convert ft³ to m³
    lambda: |-
      return id(gas_total).state / 35.315;

I think there are a few issues in this thread, but for me, I was not able to add my ESPHome water sensor with the “gl” unit_of_measurement when I changed it according to the dropdown hint. (I read ‘gl’ as an abbreviation for gallons, even though I’ve never seen that either).

image

I changed the unit_of_measurement in my ESPHome yaml to and It was found. I tried changing it back to ‘gl’ to see what would happen, and I got this warning

image

So even though the dropdown “hint” asks for ‘gl’ or ‘m³’, the warning says it wants ‘m³ or ’ ft³’. If I change the unit_of_measurement in ESPHome to ‘gal’ it also works.

Here’s my working ESPHome water configuration:

  - platform: pulse_counter
    pin: D1
    accuracy_decimals: 2
    unit_of_measurement: 'GPH'
    update_interval: 1s
    name: "Main Water"
    id: main_water
    icon: mdi:water
    filters:
      # 330 pulses/L  .00303 L/m * 15.8503 to get GPH
      - multiply: 0.048031212
      
    total:
      unit_of_measurement: 'gal'
      name: 'Total Main Water'
      id: total_main_water
      icon: mdi:water
      device_class: water
      filters:
        # 330 pulses/L  3.78541 L/G
        - multiply: 0.0008005217

So my problem was just confusion between what the dropdown says vs the warning vs what it really wants in addition to a lack of documentation here Integrating your water usage - Home Assistant (or maybe I just completely missed the relevant documentation). Hope it helps someone.

I’ve tried various things based on information in this thread, but still have no relevant data in my Energy Dashboard for water section. Could someone help with a full example ESPHome yaml and Configuration.yaml or help me correcting my mistakes.

relevant part of my ESPHome yaml (for ESP8266 with NPN sensor):

relevant part of configuration.yaml:

1 Like

Exact same issue here too, nothing comes in. Made sure i had some usage but no luck so far. Dashboard does say it can take up to 2 hours but since this data is coming in i assume that doesn’t matter. I left it on for a day too, no change.

Can anyone that has the dropdown list filled, show the content of the entiity? In what format it comes in, so we can compare?

Apparently, it is a problem indeed. After almost a day water consumption in the energy panel is still at 0 while the sensor (and statistics) reports more than 0 usage.