I use a PLC for this purpose (that was already used for different automation tasks in my house).
The general firmware of the OS is not able to do this task, but you might be able to do it with a relay or a smart relay with Home Assistant.
I have two floating switches in my water tank.
The lower one tells me, if I have to refill the tank.
The upper one tells me, tank is full (enough) for some sprinkler use.
Filling is timed at night before sprinkler operation. This way if enough rain is falling, the tank doesn’t get filled.
The tank is for gathering the rain from my roof.
But can also get filled from the city water supply via a standard sprinkler valve.
For driving the sprinkler I always use a pump, switch on with a flow switch. It builds up a pressure in the tubes and tries to maintain that. If a valve is opened, the pressure drops and starts the pump. After a valve is closed, the pump runs for a short time and switches of when the pressure is built up.