Setup pulse meter or pulse counter

Hey,
I didn't read all responses but as I had a related issue some time ago...

My use case was a bit more complicated and posed a bit of a challenge.
It is my personal believe that the esphome implementations pulse_meter as well as pulse_counter are flawed, i.e. limited in functionality and very badly documented. Someone should unify them into one consistent pulse measurement component.

Anyhow, I ended up building what I needed by myself, which is quite easy. @MelleD maybe consider that: