Problems withe energy dashboard Watermeter

Hi,
I am new working with the ha and have same problem with the energydashboard and my ESP32 Watermeter.
I am working an the AI on the edge watermeter-projekt. I tried to integrate the ESP32-cam to my ha.
I want to show the usage of water on my energy-dashboard but cannot add the sensor I tried to create in the yaml-File. I can add the WatermeterValue but not the usage in l. Also the calculation for the usage of water doesn’t seem to work:

Here’s my config file:

mqtt:
  sensor:
    - state_topic: "wasserzaehler/main/value"
      name: "Watermeter Value"
      unique_id: watermeter_value
      unit_of_measurement: 'm³'
      state_class: total_increasing
      device_class: water # Needs Homeassistant 2022.11!
      icon: 'mdi:water-pump'
      availability_topic: wasserzaehler/connection
      payload_available: connected
      payload_not_available: connection lost

    - state_topic: "wasserzaehler/main/value"
      name: "Watermeter_in_L"
      unique_id: watermeter_Liter
      unit_of_measurement: 'l'
      state_class: total_increasing
      device_class: water # Needs Homeassistant 2022.11!
      icon: 'mdi:water-pump'
      value_template: "{{( value | float * 1000 ) | round(2)}}"
      payload_available: connected
      payload_not_available: connection lost

    - state_topic: "wasserzaehler/main/rate"
      name: "Watermeter Rate"
      unique_id: watermeter_rate
      unit_of_measurement: 'm³/min'
      state_class: measurement
      device_class: water # Needs Homeassistant 2022.11!
      icon: 'mdi:water-pump'
      availability_topic: wasserzaehler/connection
      payload_available: connected
      payload_not_available: connection lost

    - state_topic: "wasserzaehler/main/error"
      name: "Watermeter Error"
      unique_id: watermeter_error
      icon: "mdi:water-alert"
      availability_topic: wasserzaehler/connection
      payload_available: connected
      payload_not_available: connection lost    

    - state_topic: "wasserzaehler/uptime"
      name: "Watermeter Uptime"
      unique_id: watermeter_uptime
      unit_of_measurement: 's'
      state_class: measurement
      device_class: duration
      entity_category: diagnostic
      icon: "mdi:timer-outline"
      availability_topic: wasserzaehler/connection
      payload_available: connected
      payload_not_available: connection lost
      
template:
  - sensor:
    - name: "Leistung (Summe)"
      unique_id: power_total
      state: >-
        {{ 
          [ states('sensor.leistungsmesser_shelly_em3_channel_a_power'), 
            states('sensor.leistungsmesser_shelly_em3_channel_b_power'), 
            states('sensor.leistungsmesser_shelly_em3_channel_c_power'), 
          ] | map('float') | sum
        }}
      unit_of_measurement: Watt
      device_class: power

  - sensor:
    - name: "Energie (Summe)"
      unique_id: energy_total
      state: >-
        {{ 
          [ states('sensor.leistungsmesser_shelly_em3_channel_a_energy'), 
            states('sensor.leistungsmesser_shelly_em3_channel_b_energy'), 
            states('sensor.leistungsmesser_shelly_em3_channel_c_energy'), 
          ] | map('float') | sum
        }}
      unit_of_measurement: kWh
      device_class: power

  - sensor:
    - name: "Watermeter in l"
      unique_id: watermeter_in_l
      icon: "mdi:gauge"
      state: "{{ states('sensor.watermeter_value')|float(default=0) * 1000 }}" # Convert 1 m3 => 1000 l
      unit_of_measurement: l
      device_class: water
      availability: "{{ states('sensor.watermeter_value') not in ['unknown', 'unavailable', 'none'] }}"
 I am looking forward to some feedback from you.

Best regards
Ben

1 Like

Hi,
I am having the same problem. Luckily I found this post from Ben5 so I don’t have to open a new one.
Would be nice if someone could help us out with this problem. :slight_smile:

Moin, (hello :slight_smile: )
I have had the same problem. There is a very easy solution I found randomly:
Go to „development tools“ and there to the tab „statistics“. There you will see that there is a problem with the unit of the Watermeter. If you solve this problem by clicking on the red message you should be able to integrate the water values in the dashboard.
I hope I have translated the menu items in the correct way because I am using the german language.