Solar power generation using batteries