I have build a Water Meter based on a Wemos D1 mini and have integrated it in Home Assistant via the ESPHome Add-on and integration. It measures and displays the Pulses per minute. As every pulse is exactly one liter, it currently displays the Liters per minute in Lovelace. However I would like to display the total amount of liters per day. I have spend multiple days to find a solution, however I am not able to find a workable solution on the internet. Can you please help me? Thanks in advance.
My current ESP Home config:
esphome:
name: watermeter
platform: ESP8266
board: d1_mini
wifi:
ssid: "XYZ"
password: "XYZPass"
manual_ip:
# Set this to the IP of the ESP
static_ip: 192.168.3.6
# Set this to the IP address of the router. Often ends with .1
gateway: 192.168.3.1
# The subnet of the network. 255.255.255.0 works for most home networks.
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Watermeter Fallback Hotspot"
password: "xYyJLmQ7UcbO"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "watermeter"
ota:
password: "watermeter"
sensor:
- platform: pulse_counter
pin: 14
name: "Water Meter"
update_interval : 60s
accuracy_decimals: 0
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!
(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:
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?
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:
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.
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
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.
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.
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.
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?
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.