How to understand pulse_counter precision

Hello,

I’ve installed a water meter (a generic one, I’m unable to find a reference on the internet, loks like this one ).
Here is a picture of the meter

When comparing physical reading and number of pulse I get in home-assistant after a few weeks, I find a very strong error.

Here is what I’ve tested so far:

  • open water flow, look at physical counter and wait for ~30L => I received 3 impulsions which is expected.
  • wait a few weeks, compare increase on physical counter and in home assistant => strong difference.

For instance, over a period of 5 weeks, physical counter moved from 8.406m³ to 17.504m³ (so 9.098m³) while home assistant counted 15,670L. My hypothesis is physical reading is correct but pulse reading through esphome is not working as expected.

Here is my esphome configuration:

 - platform: pulse_counter
    pin: 32
    internal_filter: "13us"
    name: "Water flow"
    unit_of_measurement: 'L/min'
    filters:
      - multiply: 10
    total:
      name: "Water total"
      unit_of_measurement: 'L'
      state_class: total_increasing
      filters:
        - multiply: 10

(the meter emits one pulse for 10L)

Would you have any advice on how to test/understand this issue further?

1 Like

FWIW, I ran into a similar issue trying to use the pulse-counter. I was trying to measure running-time of an HVAC system. Since the ‘pulse’ tended to run for many minutes (e.g. 15m - 1h), the counter gave up on it. I’m still not quite sure what kind of pulses it’s expecting to count.
My eventual solution was to [write my own time integrator and] track the running-time duration at the receiving end (munin and HomeAssistant), and just let the ESP supply the simple on/off states of the 3 relays it monitors.