Text this: Forecast-Based Energy Management for Optimal Energy Dispatch in a Microgrid