Flow Meter - No Response

Hello All,

Like many, I’m new toe HA, and am trying to build a flow meter sensor utilizing the pulse output from my flow meter. I’ve followed a number of tutorials online and reviewed several posts, trying a number of modifications to get something to work. Regrettably, I’m at the point where I’m hoping someone from this community can provide some direction or helpful insight.

Equipment:

EKM Metering water meter

[https://documents.ekmmetering.com/EKM-SPWM-075-HD-water-meter-spec-sheet.pdf](https://Water Meter Specificaitons)

These meters have a basic, non-powered, Reed Switch, 2-wire, open/close pulse output. One close of the circuit = 1/100th cubic foot of water. As I understand, the pulse reader device will need to put a low voltage on the line and sense when the circuit closes at the water meter end. The manufacturer recommends no higher than 20mA and 24V for reading the pulse on their water meters.

Pulse Reader:

ESP8266 ESP-12F NodeMCU Lua Amica V2

[NodeMCU Amica V2 road test - Hackster.io](https://ESP8266 Specifications)

Setup:

The water meter has a red, white, and black wire coming from the reed switch. Manufacturer documents call for using just the red and black wire for pulse reading. I’ve solder the black wire to GND and the red wire to D6 (GPIO12) on the ESP8266.

ESPHome:

I’ve flashed the firmware and have generally followed these steps to set the system up: [Build a cheap water usage sensor using ESPhome and a proximity sensor - PieterBrinkman.com](https://ESPHome Water Meter DIY)

The yaml for the esphome is below:

esphome:
  name: waterpulser

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: 192.168.1.71
    gateway: 192.168.1.1
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-132Fb7"
    password: "wmxwtDv0dlQO"

captive_portal:

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

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

- platform: pulse_meter
  pin: GPIO12
  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.028

- 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

Problem:

Im able to get the ESP online, sensors show up in HA, but no data is collected at all. Nothing appears in the sensor history, except for when I take the device offline to make changes, there’s a break in the history trend., Otherwise it’s a flat line at 0.

Can aynoe help or point me I the right direction to get this project going?

Try with gpio 4 or 5

Thank you for taking the time to read and comment, will try that this evening! :slight_smile: Can I ask why the switch of GPIO (for understanding)?

Switched it to GPIO4 and it’s alive! Thank you !

2 Likes

Did you get this to accurately display the readings from your water meter? I’m trying to do the same thing with a similar water meter (EKM SPWM-100-NSF) but I’m getting continuous pulses from the meter even with the water turned off. Any ideas what might be wrong with my setup?

I did for awhile, yes. Didnt run into a continue pulse situation, but did have readings come when water flowed.

I messed up the code in another thread and now cant get any pulses!

My setup seems to be working well now. I made changes to the code following the example in this thread - Water usage sensor