Energy consumption dashboard - not able to add water

Hi All,

I just started my home assistant journey today.
One of my first projects was to create a proper energy dashboard.

I’m using a device connected to my smart meter which I read in via ESPhome.
Had to make some modifications in the firmware of the device to make it all work, but I’m getting all my inputs now within HA:

2023-07-08 23_44_31-Window

Both electricity and gas can easily be added in my energy dashboard, but the water consumption not.
I cannot add the sensor for water, I’m assuming it hasn’t the right device class (“water”) so HA is not detecting that as a valid sensor.

What can I do to make sure energy dashboard would accept my sensor for water usage as a valid one?

Thanks in advance!

You can create a template sensor using the value from your water meter entity. That way you can set the correct device class etc. Example below. Set name etc to what you want. This goes in configuration.yaml file.

sensor:
    - name: "water meter use"
      unit_of_measurement: "m³"
      unique_id: "water meter use"
      device_class: water
      state_class: total_increasing
      state: "{{states('sensor.water_meter') }}"

Hello Mark,

Thanks a lot for your quick feedback!
When adding the code into the configuration.yaml, I still get few errors.
I’ve tried to put other fields but still cannot find a way to have to code properly integrated.

Thanks a lot for your support!

Apologies, it wasnt a full example. It should be…

template:
  - sensor:
    - name: "water meter use"
      unit_of_measurement: "m³"
      unique_id: "water meter use"
      device_class: water
      state_class: total_increasing
      state: "{{states('sensor.water_meter') }}"

You will need to change the sensor name in the last line to matxh the name of your water consumed sensor

Thanks a lot, this worked out!
Thanks for the swift reply!