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
Make sure the Watermeterkit is installed and connected to your Home Assistant install.
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.
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.
(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
Optionally, Create a sensor to show the meter value in m³ (Update the sensor ID and counter ID where needed):
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!
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
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!
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.
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!
Hi there,
Found the bug. The one in front of the screen again. I understood it to mean that the helper adjusts the value of the water meter Total Consumption, but it only replaces it.
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.