ESPHome Water Pulse Cable Sensor - HELP!

Hello everyone.

i have created my own sensor for my utility water.
and i really have some issues.

in days it can really work well, but then just like that it senst wrong values to my home assistant.

like this:

im using a NodeMcu V3 1.0 and have added designed it like this:

# Reed switch between GPIO and GND
sensor:
  - platform: pulse_counter
    pin:
      number: 12
      inverted: true
      mode:
        input: true
        pullup: true
    name: "Pulse Counter"

my own code looks like this:

sensor:

# Pulse Cable Water Meter (Inlet)

  - platform: pulse_counter
    pin:
      number: D6
      inverted: true
      mode:
        input: true
        pullup: true
    name: "Pulse Cable Counter Water Consumption - Inverted"
    filters:
    - multiply: 10
    total:
      name: "Pulse Cable Counter Water Consumption"
      id: water_meter_total_esp
      unit_of_measurement: "L"
      device_class: water
      state_class: total_increasing
      accuracy_decimals: 0
      icon: "mdi:water"
      filters:
      - multiply: 10

  - platform: template
    name: "Water Meter Total New"
    id: water_usage_total_esp
    accuracy_decimals: 0
    unit_of_measurement: "L"
    icon: "mdi:water"
    device_class: water
    state_class: total_increasing
    lambda: return (id(water_meter_total_esp).state * 1);
    update_interval: 10s

I have a sliding glass door in front of my engineering cabinet in my basement.
but as it works moslty of the time i cant see how this is making any avoidance.

can anyone help me out, what is wrong ?

here is also a screendump of the water at now, and at the moment im not using any water.

image

BR
/Mike

You have a sensor. What is it?

I am not clear on what the error is. Are you just getting spurious pulses?

I would go into fault finding mode. I would get the log screen up (in ESPHome dashboard ) and then turn a tap on. Check the log screen to see whether you get a pulse when you are expecting it.

If you are still getting pulses when the water is NOT running then I am assuming your wiring need to be checked. Is the wiring long? Is it screened? Have you used a capacitor to remove spikes? Turn off pull-up and try a different resistance. Try a different pin. They are not all the same

Do you have a leak! there is a lot of posts on pulse counter and meter you might want to check for all the knowledge

I also saw an impossibly large number of pulses when I was testing my setup. It usually happened near the end of a water run - within a few seconds of closing a faucet. I figured it had to do with the floating values so I added the same “pullup: true” but it didn’t fix it. I currently have it working with these additional lines. I haven’t messed with it once I got it working, so I’m not sure which of these actually fixed it. The only other difference from your code is that I’m using pin number GPIO5.

    count_mode:
      rising_edge: DISABLE
      falling_edge: INCREMENT

    filters:
     - debounce: 1.0s

thank you i will try this out !
i just moved the glass slide door, and untill now no mistakes, tomorrow i will let it stay on and see oif any issues. can it be that the wifi is making some noice when sending trough a glass door and sent wrong numbers ?

I don’t think your wi-fi has anything to do with it. If you view the live logs I believe you’d see the large number of pulses being reported by the ESP itself, which is strictly coming from the ESP and/or the pin and pulse sensor, which has no relation to the wi-fi signal it is sending. Double-check your wiring connections to make sure they are tight.

What sort of pulse/flow sensor are you using? Please do report back your findings as it seems that there’s a lot of interest lately in reporting on water usage in HA and people are struggling to get it working. I wish we had something similar to the HA Blueprints for ESPHome!

It looks like the power supply could be the cause of the extra pulses. I also initially had issues with an esp32 I was using to connect to a BLE radon meter and found that it was very sensitive to what power supply I used.

I have a wind meter … I use pulse meter … the results are erratic as hell. I have a list of things to test … power supply is one! and capacitors

i hvae one module, that is not making any noise at all, and i have tried change a charger from one of the other modules to the working one, and the working one is still not make any noice,

I have two LDR modules.
One have i soldering directly at the D1 MINI Shield (working one)
the other is solered to the D1 MINI directly and then a cable on 30cm connected to the LDR module and then set on the meter.

any other ideas ?