Real time management of unpredictable renewable solar energy in smart cities