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.
A washing machine pressure switch is a simple device. It has a length of rubber hose that is lowered into the water supply. Water pushing up into the tube creates air pressure that moves a diaphragm that turns a switch on or off. Some machines have a simple pressure switch that is normally open but closes when activated by rising water in the tube. Those will have only two terminals. Mine had three terminals attached to a double-throw switch inside the control. I had to use an ohm meter to figure out which terminals to use. I connected the wiring to the side of the switch that is open until the diaphragm is activated by rising water level. It’s easy to activate the switch to test it. All one has to do is blow in the tube. The control clicks when the switch is thrown.