Water sensing tap operation

Hi, in my place, local municipal corporation use to supply water only at unexpected time of the day; that too in 7-10 days gap. Unable to figure out the exact time of pumping, we leave the main line tap open. Problem is that, if we do so, even at the time when they are not pumping water, air flows through the line which keeps the water meter running. So, what I am asking is that, is there any way to turn the tap on, only when water is pumped through the line an turn it off when water supply stops? By some instrumentation and sensor, something like that? I heard about motorized valves, but not having slightest idea of how to operate them by sensing only water in the main line instead of air. Expecting expert ideas… Thanks