In the various solar hot water projects,
I've referred to the cold water inlet valve "turning itself on when the
sun shines"... and haven't described exactly how this works.
Here's how:
I use a second-hand (of course!) hot water cylinder thermostat which
you can pick up for free if you talk to a plumber nicely. These
thermostats generally get dumped with the old cylinder when someone
installs a new hot water cylinder in their home. Here's what one
looks like: