I originally bought some solenoid valves to experiment with, but ended up simplifying my approach. I use a submersible pump that is plugged in to power. I can just automate turning on/off power to that outlet (I have two TP-link / Kasa HS300 strips). The nutrients / water are in a tank below the tray of plants, so when the power is "off", gravity brings the water back through the pump into the tank again.
What a clever and simple solution, I love it. I have been thinking about such a grow system for a long time for my chilli plants, and after having had a few split solenoid valves on a different irrigation project I was very hesitant. Thanks for the inspiration.