Driving chemistry at photoelectrodes and electrodes