Things like electronic valve to turn the water on/off are normally driven by mains voltage (as used in every domestic washing machines). This means you need some way to get your computer with its 5V X .001A output to switch mains SAFELY. The only way is to use a relay, this is an electromechanical device that operate a switch, so 2 watts of low voltage can switch 2KW of mains voltage. So you will need some sort of amplifier/interface to get your 5V .001A to operate a 12V 100 mA relay, whose contacts can handle the mains voltage and current. Which should be pretty low as the valve only takes, say 5W or .02A. Somewhere you will have to find a DC power source for this, it could be you can find a 5V relay and power it from the micros supply.
The next advance is to use a Solid State Relay this is a module that accepts, say 5V at .02 A and switches mains. The mains and the 5V connections are fully isolated. It is doubtful if you can drive one direct from your micros out, so a 5V amplifier will be required.
For geeks only , you build your own SSR, with a triac and other components. This is not trivial as you don't want any mains to get back to your micro and yourself!
Frank