Have you tried a integral sensor in home assistant? Seems like the thing you need
You could do it in home assistant with the utility meter on a daily cycle.
Though you just want a litres total (not litres per whatever) for this. I.e. just the plain pulse count.
Hi Daan, thanks for your help!
Hi Tom, I have implemented the Utility Meter in Home Assistant and it works like a charm! I have spend a lot of hours to build this functionality in ESPHome. However, I didn’t know that Home Assistant was also able to deliver this functionality. Thanks for your help!
Would you mind sharing the hardware which creates the pulse to measure the water consumption?
Hi Ralf, please find attached the schemes and pictures. I use a Wemos D1 Mini in combination with a LJ12A3-4-Z-BX-Inductieve-Proximity-Sensor.
Hi Corne,
Would you be so kind to share your yaml file?
I have build the same watermeter but stuck on the utility_meter setup.
Thanks for sharing.
Greets
Bastiaan
(tagging @cmartens who wouldn’t necessarily see your message)
Another possibility is to use ESPHome’s total_daily_energy
sensor and just lie about the units. I do this with my electricity metering: I have a pulse_counter
counting the flashes on the meter (1 flash = 1Wh) and a total_daily_energy
integrating the pulses:
sensor:
- platform: pulse_counter
pin: D5
unit_of_measurement: 'kW'
name: 'Power Meter House'
filters:
- multiply: 0.06
id: house_power
- platform: total_daily_energy
name: "Total Daily Energy"
power_id: house_power
accuracy_decimals: 1
giving this instant meter (electric shower being used atm!) and 7-day barchart (custom:mini-graph-card):
Hi Troon,
Thanks for your response.
I am a newbie and mu problem is that I want to add “utility_meter” to my watermeter. I want to see daily-monthly water usage.
My watermeter.yaml is saying " Component not found: utility_meter
Nothing found on Google so far.
(btw how can I show my yaml. file?
Just copy-paste it in a response here, surrounded by three backticks (```) before and after.
You are aware that utility_meter
is a Home Assistant integration, not an ESPHome component?
no I didn’t know. every day learning new things!
Hi Bastiaan,
I hereby send you the part of my config file regarding the utility meter. The ESPHome pulse counter measures the number of pulses per second. As every pulse is exactly 1 liter, it measures liters per second. To convert this to liters per day, the utility meter can be used. Add the following code to configuration.yaml:
utility_meter:
water_daily:
source: sensor.water_per_second
cycle: daily
After a restart of Home Assistant, the entity “sensor.water_daily” will be added to Home Assistant, which can be added to Lovelace. I hope this will help you.
Greetings, Corne
You can also considerably simplify that schematic by enabling the ESP internal GPIO pull-up resistor:
Hi Corne,
I had trouble with the utility_meter because it should not be in the esphome file but in the configuration yaml.file . But now in your file I can see also the set-up for more than one sensor reading. I have made water_hourly / water_daily / water_monthly / water_yearly
Thanks for sharing!
Bastiaan
Hi Corne,
Thanks for your help, the job is fantastic. I now see how much water I use per hour. Just a few more questions:
- with me the wheel was hanging exactly under the meter so that it continued to count, thereby adding an amount of “unreal used” liters, do you have experience / solution with this?
-how can I get the counters to zero? Searched the internet and came across a code against “reset values utility_meter” but I can’t get it done. Maybe you want to give a small addition to your yaml.code At least I assume that you reset your counting after a day.
utility_meter:
water_hourly:
source: sensor.watermeter
cycle: hourly
water_daily:
source: sensor.watermeter
cycle: daily
water_monthly:
source: sensor.watermeter
cycle: monthly
water_yearly:
source: sensor.watermeter
cycle: yearly
Kind regards
Bastiaan
Hi,
Based on the defined cycle, the meter will be reset every hour, day, month, etc. In the example which I have send to you, the watermeter is reset every day at 0:00h. Please see the photo below how I mounted the meter. It is important to place it exactly above the wheel so that ever liter is counted once.
Hallo Corne,
Thank you for your response. Clearly answer, I have to center my sensor above the wheel. And all my sensors will be set to zero when the time is ready.
Thanks again
Bastiaan
Hallo Corne,
I Have mounted the sensor exactly above the wheel but now my values are very strange. This hour I flush toilet once and the sensor output is 140 ltr. Little bit too much.
Do you have any tips so I can count a realistic amount?
Your sincerely,
Bastiaan
What you need to check if you flush the toilet, is to have a look at the wheel and count the number of times that the wheel was going round. For every round, the LED on the sensor should be on just one time. So 7 times for one flush, when 7 liter of water is used. If this is not the case, you have to re-mount the sensor in such a way that with one round, the sensor is measuring only one signal. So it is important not to mount the sensor exactly above the wheel.
What I did to get most “false counts” away is in ESPHome at the sensor I’ve added “internal_filter”:
sensor:
- platform: pulse_counter
pin: D2
name: "Water Meter"
update_interval : 60s
accuracy_decimals: 0
internal_filter: 200ms
So in this case: all the counts that are less as 200ms long are not counted.