Hi Jimmy, the reason I used pulse_meter is that it reports the pulse frequency in pulses/min on every pulse recieved. pulse_counter reports pulses within a specified period of time in pulses/min. So they are not that different; I chose to use pulse_meter as it offers better data resolution (the sensor receives more pulses the faster the wind blows, so it catches more data of wind gusts).
I have never had any trouble with inconsistent or errant wind data from this sensor using pulse_meter. If you are seeing a gust, know that one way or the other your ESP is recording many pulses. So whether there is interference, or if your wiring is not correct, I am not aware of any issues with pulse_meter on the ESP32 using my setup and pin config. Is it possible you were handling the sensor and turning the anemometer during this time period? I have provided myself with bogus data in this way and caused confusion before.
Per your error Couldnt find ID "g_WindSpeedMin_Reset", it appears that this variable is not defined in any of the code provided by kluszczyn. I suspect it may be a template switch that allows the user to reset the WindSpeedMin in home assistant. Perhaps he forgot to attach as switches are in a different area of the yaml. So you may want to add some code like such:
switch:
- platform: template
id: g_WindSpeedMin_Reset
@kluszczyn, thank you for sharing your config and very detailed solutions! For the time being I use statistics sensors in home assistant to handle gust calculation, but your code looks very nice for a native solution in ESPhome.
Edit: Mean to attach this info on pulse_counter vs. pulse_meter: Pulse_counter vs pulse_meter - ESPHome - Home Assistant Community (home-assistant.io)