Electrical load pattern becomes uncertain and variable due to distributed energy devices, thus contributing to grid instability and energy waste. At the grid level, the introduction of renewable energy into building industry makes the power system status more uncertain and variable. There is a disconnection to address building energy management and battery energy storage to unlock the potential for battery energy storage in commercial and industrial buildings. Leaptran, Inc. proposes to develop a control and communication software platform that will enable the integrated control of battery energy storage and solar-powered buildings so that grid system can penetrate renewable and distributed energy sources deeply. As a result of this project, the building industry and DOE will also obtain the first insights into how commercial and industrial buildings can respond to grid requirements on ancillary services, considering building energy management collectively and interactively.