I have tried using a water flow sensor type: YF-S401, working range 0.3-6 L/min,Allowing pressure: pressure 1.75Mpa,Load capacity: 10 mA (DC 5V),Working voltage range: DC 5~18 v,Maximum operating current: 15 mA (DC 5V),The lowest rated working voltage: DC4.5 5V-24V,Size : 6.5cmX4cm/2.55’‘X1.57’’ ,but I encountered problems, this sensor cannot detect flow. I tried installing it on a water dispenser, to measure the rate of drinking water use.
I use D1 mini, with the following code:
- platform: pulse_counter
state_class: measurement
name: "Water Flow"
id: Aliran_Air
pin: GPIO5
update_interval: 1s
filters:
- lambda: return (x / 400.0);
unit_of_measurement: "L/min"
- platform: integration
device_class: water
state_class: total_increasing
name: "water comsumption (m³)"
unit_of_measurement: 'm³'
accuracy_decimals: 4
sensor: flow_water
time_unit: s
icon: "mdi:water"
filters:
- lambda: return (x / 1000); #(x / 1000);
any suggestions to solve this problem. thank you