Forecast-based battery charging