Optimizing Energy Grids: Forecasting and Automation