Here's a narrative description of this project. I've added pictures with descriptions to help explain. This project is one that will require a bit of hands-on know-how. It can be adapted to an assortment of applications but the basics of how the system is constructed and how it works is about the same.
Most every washing machine has two controls that together will do the trick quite nicely. Washing machines control the water supply with an electric solenoid valve. They use a pressure switch to control the water level in the tub. Those two devices together are what is needed. The solenoids are on the back of the machine. The pressure control is most often in the top of the machine with the other controls.
It’s really a rather simple system. All that is required is wiring the solenoid with the pressure switch in the circuit to cut the solenoid on when the water is low and off when the water level reaches maximum. As usual, I scrounged for most of what I needed. I used a couple of old extension chords for the wiring and an old piece of water hose for the water supply.