I have a similar solution. It monitors low water levels in the tank to shut off the water pump so it doesn’t run dry.
My second solution is based on two 05P units. One monitors low water levels to protect the pump, and the other monitors high water levels to prevent the tank from overflowing.
There are probably solutions on the market that measure water levels across the entire height of the tank, but nothing comes to mind right now, and they probably won’t be compatible with Sonoff/EweLink.
https://forum.ewelink.cc/t/sonoffs-alternative-to-autoaqua-smart-level-security/
Theoretically, the SONOFF Zigbee Smart Water Valve is supposed to have the ability to monitor how much water has flowed, but I don’t have it, so it’s hard for me to say.