Water Meter in Energy Dashboard Not Available

Thanks for this, fixed my problem by comparing configs.

My ESP config was missing device_class and state_class.

I changed the measurement unit from M3 to m³ also, although I don’t think that was part of the problem.
After changing measurement unit, don’t forget to ‘Fix’ statistics too as described here above.

Dont understand how to set this up
i have a flow sensor which gives me the current flow rate, not accumlating usage.
do i need to put it through utility meter first to get it to count ? and then set it up for energy dashboard?

Hi,
if you only have a flow-rate you first must calculate the absolute value. If you have the flow every 5 minutes, you must add every 5 minutes your value to a counter. You need a always increasing value.

I also tried for hours to add the water consumption to the energy dashboard.

Finally a template sensor works.

Here is the configuration:

sensor water_meter_total_m3:   
  platform: template
  sensors:
    water_meter_total_m3:
      device_class: water
      unit_of_measurement: m³
      value_template: "{{ ((states('sensor.n_ergie_watermeter_m3') | float)) | round(2) }}"
      attribute_templates:
          state_class: total_increasing

This is the configuration of the MQTT Sensor:`

    - name: "n_ergie_watermeter_m3"
      state_topic: "kg/wasser/main/value"
      device_class: water
      unit_of_measurement: "m³"
      state_class: total_increasing
      value_template: '{{value | round(2) }}'
      icon: "mdi:water"

In the dashboard I only see the template-Sensor.

I am currently trying to build a water sensor to display it in the dashboard. I get the following information from my water system:

  • Daily water consumption in liters
  • Total consumption in liters

How exactly do I have to set up the sensors so that I can use them?

I currently have these 3rd sensors

    ...
      - name: "bwt_water_consumption_yesterday"
        value_template: "{{ value_json.totalWaterConsumption | float(default=0) }}"
        unit_of_measurement: "L"
        device_class: water
        state_class: measurement
        icon: mdi:water
      - name: "bwt_water_treated_total"
        value_template: "{{ value_json.waterTreatedTotal }}"
        unit_of_measurement: "L"
        device_class: water
        state_class: total_increasing
        icon: "mdi:water"
    ...
    - name: "bwt_water_treated_total_m3"
      unit_of_measurement: "m³"
      state: "{{ ( states('sensor.bwt_water_treated_total') | float / 1000 ) | round(3) }}"
      icon: "mdi:water"
      device_class: water
      state_class: total_increasing

Schauen sie da mal vielleicht ist das hilfreich.

Danke, sieht so ähnlich aus, was ich aktuell versuche

template:
  sensor:
  - name: "Watermeter Value from JSON"
    unique_id: water_meter_value_from_json
     state: >-
            {{ state_attr('sensor.watermeter_json','main')['value'] | float }}
     unit_of_measurement: 'm³'
     device_class: water
     state_class: total_increasing
     icon: mdi:gauge

Jedoch werden bei mir leider keine Werte angezeigt, egal welchen sensor ich nehme.

Ich habe an meinem Wasserzähler ein “KY-033 Linien Folger Line Tracking Sensor Modul TCRT5000”, das ich über den Analogport an einem ESP8266 angeschlossen ist, der in ESPHome eingebunden ist. Mit den Digitalen Ausgang habe ich an manchen Stellungen des Liter-Zeigers falsche Impulse bekommen, wenn der Zeiger an bestimmten Stellen stehenblieb.
Mit dem analogen Auslesen gibt es kein Problem mehr. Ich habe den A0 Port direkt mit dem Kollektor des IR-Transistors verbunden. Die Schwellwerte habe ich so gesetzt, dass genügend Hysterese zwischen ON und OFF ist.
Für das Energie-Dashboard habe ich einen Template-Sensor angelegt, dieser muss die Einheit m³ haben.

ESPHome:

#Helper that is Switched on and off by Analog Value
switch:
  - platform: gpio
    id: ipin
    pin: 13


# Analogsensor connected to IR-Transistor
sensor:
  - platform: adc
    id: ntc_source
    name: 'Water Meter Analog IN'
    #internal: true
    disabled_by_default: true
    pin: A0
    update_interval: 0.2s
    filters:
    - or:
      - throttle: 10s
      - delta: 0.01
    on_value_range:
      - below: 0.17
        then:
          - switch.turn_off: ipin
      - above: 0.20
        then:
          - switch.turn_on: ipin

      
  - platform: pulse_counter
    pin: 15 #verbunden mit Pin 13
    unit_of_measurement: 'l'
    name: 'Water Meter House'
    id: pulse_water_counter
    update_interval: 60 s
    internal_filter: 50ms
    count_mode:
      rising_edge:  DISABLE
      falling_edge: INCREMENT

    total:
      unit_of_measurement: 'm3'
      name: 'Water Meter Total House'
      state_class: total_increasing
      id: m3_Total
      filters:
        - multiply: 0.001  # (1/1000 pulses per m3)      
      accuracy_decimals: 3

Templatesensor:

sensor water_meter_total_m3:   
  platform: template
  sensors:
    water_meter_total_m3:
      device_class: water
      unit_of_measurement: m³
      value_template: "{{ ((states('sensor.energy_water_m3_total') | float)) | round(3) }}"
      attribute_templates:
          state_class: total_increasing

Alterntiv, hoffe das passt so:

template:
  - sensor:
      - name: water_meter_total_m3
        unit_of_measurement: m³
        value_template: "{{ ((states('sensor.energy_water_m3_total') | float)) | round(3) }}"
        device_class: water
        attribute_templates:
            state_class: total_increasing
      

So that’s what it looks like with AI-on-the-edge, maybe that will help you a bit.

How do you read out your sensus 620?

Recently I came across the same problem: all three config params are correct but no sensor in Energy dashboard settings. It appeared that another one precondition must have been met - the sensor’s data must be recorded to DB, and this is not quite obvious. I have custom settings for recorder, not to overload the DB with hundreds unneeded sensors, so after I manually added my water meters sensors to recorder config and restarted HASS - all works.