This question already has an answer here:
Its a very common answer to this:
After Machines took over, sunshine never reached earth surface.
Isn't it shown like Sun was destroyed?
In Revolutions (III), sunshine was displayed when our heroes flied to higher altitude. Why didn't Machines choose solar energy of higher altitude and outer space?