Are we not half way there already, I am sure I can make hydrogen & oxygen from sunlight in my shed if I was in the mood. Solar PV & a Browns gas generator are no longer rocket science.
Hydrogen fuel cells are problematic in that they need a very pure form of hydrogen. I am not sure of the chemistry but simple electrolysis doesn't provide the right stuff

. I am sure someone will explain why hydrogen generation for fuel cells requires huge temps and much processing.
I wonder what the sausage tastes like?
Electrolysis of water can be used to obtain pure hydrogen to use in fuel cells but it is expensive. It requires roughly three times the energy to split the water as you get back from the fuel cell and still needs additional processing. I believe the hydrogen must be dried as too much (or too little) water content can damage the platinum catalysts in the proton exchange membrane.
The major processing and high temps are necessary when obtaining the hydrogen from methane, methanol and various other fuels as even tiny amounts of carbon monoxide produced when extracting the hydrogen has a catastrophic effect on the platinum membrane in the fuel cell.
There are some new membranes being developed made from nanoparticles of platinum, titanium dioxide and a pinch of tungsten which can cope with small amounts of CO and so will be more commercially viable as less cash will need to be spent purifying the hydrogen. Personally I'm not convinced about a so called hydrogen economy but there's my Christmas tuppence worth!