Hello. I was hoping to get some advice, have been reading about registering false pulses, but did not really come to any solution yet.
I have a water meter with built in pulse generator (1 pulse per 1 liter). Something like this here:
It is just 2 wires, which I hooked between GND and GPIO12 pins on ESP32. It is counting pulses, but it is also registering false pulses, such as during night when there is no water consumption at all.
I confirmed by checking last night and this morning. While I used only 53 liters of water, ESP counted 86 pulses (==86 liters).
I am using only cable supplied with water meter (~80cm long), not extending it. ESP is in the plastic box tied to one of heating pipes.
I tried playing with internal filter, but that did not bring any results. Below is my code. Can anyone advise?
sensor:
- platform: pulse_counter
pin:
number: GPIO12
inverted: true
mode:
input: true
pullup: true
name: "Water Flow"
unit_of_measurement: "l/min"
icon: "mdi:water"
update_interval: 15s
accuracy_decimals: 3
internal_filter: 400ms
count_mode:
rising_edge: DISABLE
falling_edge: INCREMENT
filters:
- lambda: return (x);
total:
name: "Total Water Consumption"
unit_of_measurement: "m³"
device_class: water
state_class: total_increasing
accuracy_decimals: 3
icon: "mdi:faucet"
filters:
- lambda: return (x / 1000.0);