Counting water usage with the Watermeterkit

Watermeterkit is an awesome idea to count water usage on most Dutch watermeters (possibly in other countries too). With these steps, it would be easy to add into Home Assistant to show usage in litres or m³.

Steps to install

  1. Make sure the Watermeterkit is installed and connected to your Home Assistant install.
  2. Create a counter in the helpers screen, where the initial value is the current value of your meter. This will be in litres, so fill in the red numbers too.
  3. Add the blueprint (No need to copy this, you can press the add button instead) and make an automation from it. Setting the total consumption counter from the Watermeterkit entities as well as the helper counter you just created.

My Home Assistant (Links to a gist since HA has issues with blueprints containing multiple code blocks)

blueprint:
  name: Watermeterkit Meter Value
  description: Update a counter when the watermeterkit.nl sensor gets updated
  domain: automation
  input:
    watermeterkit:
      name: Watermeterkit Total Consumption counter
      description: Watermeterkit Total cosumption counter (provided by ESPHome)
      selector:
        entity: {}
    counter:
      name: Helper Counter
      description: The helper counter you made
      default: []
      selector:
        entity:
          domain: counter
  source_url: https://gist.github.com/Techwolf12/e7f3bf88d33c803b7b024e7e229a1c81
mode: single
trigger:
- platform: state
  entity_id: !input 'watermeterkit'
condition:
- condition: not
  conditions:
  - condition: or
    conditions:
    - condition: state
      entity_id: !input 'watermeterkit'
      state: '0.000'
    - condition: state
      entity_id: !input 'watermeterkit'
      state: unavailable
action:
- service: counter.increment
  target:
    entity_id: !input 'counter'

Congrats! The counter should now show the total usage in litres!

Extra options

  1. Optionally, Create a sensor to show the meter value in m³ (Update the sensor ID and counter ID where needed):
sensor:
  - platform: template
    sensors:
      water_meter_total_m3:
        friendly_name: "Water meter consumption"
        unique_id: "sensor.water_meter_total_m3"
        value_template: >
          {{ states('counter.watermeter_consumption_counter') |float * 0.001 }}
        unit_of_measurement: m³
  1. Optionally, add a utility_meter on this sensor to show usage over different periods (Update the sensor ID where needed):
utility_meter:
    water_daily:
      source: sensor.water_meter_total_m3
      cycle: daily
    water_monthly:
      source: sensor.water_meter_total_m3
      cycle: monthly
    water_yearly:
      source: sensor.water_meter_total_m3
      cycle: yearly
5 Likes

I’ve seen the suggestion for the Counter in the ‘ha-watermeter-kit’ Discord channel recently. I ran into problems when reprogramming the Esp32, the values became zero (0) and I had to adjust values using template sensors etc.

This Helper + Automation approach is much more convenient to adjust incorrect values.

The imported blueprint is crippled, but from your instructions and source above I was able to create a correct automation myself.
Got it up and running now, Thanks!

1 Like

Cool blueprint!
However I’m not sure that the counter you use is the best way.
What if you don’t have wifi for some time? Then all the water you use is not counted?
As soon as the watermeterkit is back online, the meter value entity is updated, but the self made counter only increments by 1.

I just made an utility_meter sensor. This sensor has a ‘Calibrate’ service that lets you set it to a value.
With a ‘trick’ that i red somewhere I made sure that this utility_meter never resets:

water_total:
  source : sensor.water_meter_total_consumption
  name   : Waterusage Total
  cron   : '0 0 * */1000 *'

The cron line says that the sensor only resets every 1000 months (83 years). That’s enough :smiley:

Not sure either if it is the best way, but this is the best way I currently got it working!

Something I observed:
Turning off the power to the watermeterkit resets the internal watermeter to 0 upon boot, so then you lose the statistics if power went out and you used water for example.
I never had it disconnect wifi during operation yet, but that would indeed give the senario you described.

The counter also has a calibrate function for this, call the counter.configure service with a new value to update it manually and it should be fine until another power/wifi outage!

1 Like

Hi,
somehow I can’t do it. What do you have to enter as a helper in automation? Service? Device? Somehow can’t find my helper. Is there a screenshot for the completed automation?
Best regards
Averall

You have to follow step 2 in the install instruction on the post, you need to create a “counter” helper in the helpers screen, that is what you use in the automation.

I created the helper as in your screenshot, but under what point do I integrate the helper in the automation? I don’t find him here under any point:

And under what type of action? I can’t find the helper counter anywhere

Thank you for your support

Ah, it seems I made a mistake editing another blueprint. Must not have been paying attention at that moment. Could you delete the blueprint and import it again? After that it should work!
My apologies for this!

Thanks for your support, but it don´t work: :frowning:

grafik

I just can’t find the mistake

Hi there,
Found the bug. The one in front of the screen again. :slight_smile: I understood it to mean that the helper adjusts the value of the water meter Total Consumption, but it only replaces it. :+1:

1 Like

Hi. I notice this uses ESP as the pulse source, what, if any, changes would be necessary to use say an Aqara door sensor as the prime source? Would be interested to see if this is possible as I’ve already got a gas energy monitor working using an Aqara. Cheers.

I’m using the watermeterkit and noticed that somehow the device became unavailable last night, when it became available again it reset to 0:
image

Does anyone know what happened and how I might fix this?