Water meter build

I am using now for some time a home build water meter, and i am very pleased with the outcome I inspired this project on this tutorial there where some things in this tutorial that was not quit right. There was some issues with the YAML for this integration. There for I have uploaded the right YAML.

This picture is the inside of the electric box, I choose for a stable 12v and turn it do to 5v for the sensor. The ESP8622 has it own stepdown convertor on the develop board.

I have used a 80mm drain pipe to put the sensor on the right place on the water meter so it will be stable.



The outcome form this project is that I have nice water meter integration, and it will also show up in the energy dashboard.
Water meter 1


Water meter 3

I hope this project will inspire you and maybe build it, it is much fun to do this.

1 Like

This is very cool. :+1:
I am curious: How does your water meter itself look? I ask because my has a strange plastic cover over it and I would like to know if I could do something similar or if maybe the distance is too far for the sensor. Maybe you can post a photo of it too?

Thanks for the nice response, I have take some pictures for you. You have to ajust it with the big nut, i have let rest on the glass form the meter and adjust half turn back up.


Thank you!
Am I understanding it correctly that the sensor needs to be placed above the red/white rotation thingy? :blush:

I’m sorry but am I missing where you uploaded the correct yaml?

esphome:
  name: 
  friendly_name: 

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: ""

ota:
  password: ""

wifi:
  ssid: 
  password: 

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: ""
    password: ""

captive_portal:

sensor:
- platform: pulse_counter
  pin:
    number: GPIO12
    allow_other_uses: true
  update_interval : 6s
  name: "water pulse"
  id: water_pulse

- platform: pulse_meter
  pin:
    number: GPIO12
    allow_other_uses: true
  name: "Water Pulse Meter"
  unit_of_measurement: "liter/min"
  icon: "mdi:water"
  total:
    name: "Water Total"
    unit_of_measurement: "liter"

- platform: pulse_meter
  pin:
    number: GPIO12
    allow_other_uses: true
  name: "Water Pulse Meter"
  unit_of_measurement: "liter/min"
  icon: "mdi:water"
  total:
    name: "Water Meter Total"
    unit_of_measurement: "m³"
    id: water_meter_total
    accuracy_decimals: 3
    device_class: water
    state_class: total_increasing
    filters:
      - multiply: 0.001

- platform: template
  name: "Water Usage Liter"
  id: water_flow_rate
  accuracy_decimals: 1
  unit_of_measurement: "l/min"
  icon: "mdi:water"
  lambda: return (id(water_pulse).state * 10);
  update_interval: 6s 
1 Like

Hello all,

Last year, I built this project, based on the instructions from Pieter Brinkman’s website.
It worked very well several months.

Since then, I’ve got some serious problems with the incoming data.
Here is a brief example of the logs I get :

[20:29:38][C][api:142]:   Using noise encryption: YES
[20:29:39][D][sensor:093]: 'Water Meter Total': Sending state 0.00700 m³ with 3 decimals of accuracy
[20:29:39][D][sensor:093]: 'Water Pulse Meter': Sending state 70.51987 liter/min with 2 decimals of accuracy
[20:29:40][D][api.connection:1121]: Home Assistant 2024.1.3 (192.168.1.60): Connected successfully
[20:31:29][D][sensor:093]: 'Water Meter Total': Sending state 0.00800 m³ with 3 decimals of accuracy
[20:31:29][D][sensor:093]: 'Water Pulse Meter': Sending state 0.54696 liter/min with 2 decimals of accuracy
[20:32:50][D][sensor:093]: 'Water Meter Total': Sending state 0.00900 m³ with 3 decimals of accuracy
[20:32:50][D][sensor:093]: 'Water Pulse Meter': Sending state 0.73569 liter/min with 2 decimals of accuracy
[20:34:26][I][ota:117]: Boot seems successful, resetting boot loop counter.
[20:37:50][D][pulse_meter:076]: No pulse detected for 300s, assuming 0 pulses/min
[20:37:50][D][sensor:093]: 'Water Pulse Meter': Sending state 0.00000 liter/min with 2 decimals of accuracy
[20:38:08][D][sensor:093]: 'Water Meter Total': Sending state 0.02600 m³ with 3 decimals of accuracy
[20:38:08][D][sensor:093]: 'Water Meter Total': Sending state 0.96200 m³ with 3 decimals of accuracy
[20:38:08][D][sensor:093]: 'Water Pulse Meter': Sending state 2102504.50000 liter/min with 2 decimals of accuracy
[20:38:08][D][sensor:093]: 'Water Meter Total': Sending state 2.43600 m³ with 3 decimals of accuracy
[20:38:08][D][sensor:093]: 'Water Pulse Meter': Sending state 2593320.25000 liter/min with 2 decimals of accuracy
[20:38:08][D][sensor:093]: 'Water Meter Total': Sending state 2.69800 m³ with 3 decimals of accuracy
[20:38:08][D][sensor:093]: 'Water Pulse Meter': Sending state 739312.43750 liter/min with 2 decimals of accuracy
[20:38:38][D][sensor:093]: 'Water Meter Total': Sending state 2.69900 m³ with 3 decimals of accuracy
[20:38:38][D][sensor:093]: 'Water Pulse Meter': Sending state 2.03361 liter/min with 2 decimals of accuracy

I’ve got some numbers that are ok, but sometimes I got incredibly high numbers. Therefore, I can’t use any of this data.

Any idea on how to fix this and what can be the problem would be helpful :slight_smile:

Thank’s a lot

Is it true that since a update of ESPhome it is not possible anymore to address the same GPIO several times?
I wanted to add my doorbell to the esp but get errors when compiling, telling me to not double use the same GPIO…

Any help would be appreciated.

Regards,
Gijs

@gaaijus: The allow_other_uses: true statement in yaml above will allow the use of the same GPIO several times.

1 Like