Waterwell Problems

Guys 0 i need some guidance.

I have a water well with an Insteon device that measures current. It basically logs every time the water well comes on or goes off. I can see this nicely in the history log.
Ones in a while the wife runs water to the pasture and forgets to turn of the faucet. Our well pump comes on and off every 8 minutes to feed the open faucet. I want to create an alert in Home Assistant that sends a text message when the water well pump comes on for more then 10 times per hour.
I looked at ‘history_stats’ but don’t seemed to be getting this right.
Any advice?
entity_id: switch.waterwell_sensor