Water flow sensor with ESPhome as "simple" water meter?

Hi

I am wondering if it somehow is possible to utilize ESPhome in building a simplified water usage meter ?

I am thinking about using an YF-S201 or YF-B6 water flow sensor - but the challenge is, that these outputs a signal based on the water flow (HZ = 7.5 pulses per l/minute for YF-S201 and 6.6 pulses per l/min for YF-B6)…

I am not interested in the flow rate - more the water consumption (how many liters has passed through the sensor - total increasing (which might be reset of the ESP device is reset - so an utility meter probably needs to be added as helper) )…

What would be the best approach - if possible ? Or has someone already made a simplified water-meter using this method ?

Is it in principle just a matter of counting the pulses ? So that every pulse on YF-B6 in principle corresponds to 0.1515L water (1/6.6) ?

Regards
Brian

Guess you could start here:

The esp will need the flow rate to sum it up for you but obviously you don’t need to expose the flow rate to ha if you don’t want :non-potable_water: