The microgrid system with battery storage manages the renewable energy generation and the building’s energy use; optimizes demand management, load shifting, and frequency regulation services; and ensures uninterrupted energy reliability against local grid outages.