Filtering extra pulses from water meter

I’m using a DAE AS250U-100P water meter (one pulse per 10 gallons) in line with a servo valve relay, attached to the same ESP8266. I’m having issues with extra pulses from the meter. It pulses correctly every 10 gallons (roughly every two minutes when the valve is open), but also frequently pulses one or several times when the valve is opened/closed. I have no idea what’s creating this, but it renders the rest of the data unusable. Has anyone had this issue and/or can suggest ways that I might filter out those extra pulses?

The ultimate goal is to be able to use this not only for metering, but for shutting the valve off automatically if there is ever a detectable leak.

sensor:
  - platform: pulse_counter
    id: pulse
    name: "Hilltop Water Meter"
    unit_of_measurement: 'gal'
    accuracy_decimals: 0
    internal: true
    update_interval: 5s
    internal_filter: 10ms
    count_mode:
      rising_edge: INCREMENT
      falling_edge: DISABLE
    filters:
     - multiply: 10
     - throttle: 10s
     - skip_initial: 3
    pin:
      number: GPIO14
      inverted: true
      mode:
        input: true
        pullup: true
    total:
      name: "Hilltop Meter Pulses"

  
  - platform: integration
    name: "Hilltop Water Usage"
    sensor: pulse
    unit_of_measurement: 'gal'
    time_unit: min

switch:
  - platform: gpio
    pin: GPIO5
    name: "Hilltop Valve"
    id: hilltopvalve
1 Like