Smart integration of renewable energy