Setup pulse meter or pulse counter

Ok I will try it thanks

@thusassistint Hey again,

I did try you code, but after a upgrade the ESP Controller with a new firmeware. I got wrong values.
I saw two issue:
The state was: 10241.504
After upgrade the counter got the value 10241 pulses and then multiply with 0.001 so the global state was 10.241

  1. First problem the decimal places were gone
  2. Second i think i have to multiply with 1000 but not sure during on_shutdown or on_boot and how

Do you have an idea? Thank you

Hi,
Reading this and many other topics i try to get my water meter running that has installed a proximity meter. When it turns the light on the proximity meter on every time the wheel passes. Every passage should be 1 liter of water but. The code is easy and simple and you find it on many places over the web ( i used pieter brinkmans code but there are many others) I also tried pulse meter and pulse counter. But every time the led goes red the log shows 80-120 pulses (fluctuating a little) instead of 1. I use a D1 mini and connected it to D4 - GPIO2. Questions i have might it be possible that the time the red light is on(so the pulse is on) it measures the time it’s on and shows in a way so many pulses ? or did i not use the correct pin on the D1 mini or something .