How do I create a portable, battery-powered relay that switches in the daytime?
You could try something like this:



simulate this circuit &ndash; Schematic created using CircuitLab
I've not used this before. (Obviously, since I just made it up.) But the general idea was to use a simple diff-pair of BJTs running at very low collector currents (to keep the load relatively light when the relay isn't in use.) \$M_1\$ isn't critical. But it does need to have a threshold voltage of below \$4\:\text{V}\$. (It's usually given as a negative voltage on the PFET datasheet, so I'm talking about the magnitude.) \$Q_1\$ and \$Q_2\$ can be 2N2222A, PN2222A, 2N3904, or many other common small-signal NPN devices.
More could be done to reduce the current when it's not active. But at least this is something to try out and see how it goes for you. \$P_1\$ is there so that you can adjust the threshold. And this circuit includes hysteresis, as well, so it should &quot;feel okay&quot; when you bring it in and out of various lighting situations.
It will work with a \$9\:\text{V}\$ battery until the battery voltage is below \$7.5\:\text{V}\$. So that means well after the battery dies and wouldn't operate the relay, anyway. \$50\:\text{mA}\$ is a hefty load for a \$9\:\text{V}\$ battery. So just be aware that the battery isn't going to last more than a few hours' time, if you leave it activated.