**6. Conclusions**

This paper presents the design, implementation and preliminary test of Solar+ Optimizer (SPO), a control software that provides demand flexibility to building-scale microgrids. The software uses Model Predictive Control (MPC) to optimally coordinate the operation of building loads and the distributed energy resources on site. SPO is designed to be vendor-agnostic and protocol-independent and is built on open-source software. The software has been tested in a convenience store in northern California with on-site solar generation, battery storage and control of HVAC and commercial refrigeration loads and preliminary results show the ability to shed load in response to price signals and to curtail demand, generating more than 10% savings in energy costs alone. Future work includes more extensive testing and publishing the project as an open-source library as well as sharing the data obtained during the project.

**Author Contributions:** Conceptualization, K.Z., D.B., and M.P.; Methodology, K.Z., D.B., and M.P.; Software, A.K.P., K.Z., P.G., D.B., M.M. and G.F.; Validation, K.Z., D.B., P.A., J.Z., R.B. and M.P.; Formal analysis, A.K.P. and K.Z.; Investigation, A.K.P., M.M. and M.P.; Resources, A.K.P., M.M., J.Z. and R.B.; Data curation, A.K.P.; Writing—original draft preparation, A.K.P., K.Z. and M.P.; Writing—review and editing, A.K.P., P.G., D.B., P.A., R.B. and M.P.; Visualization, A.K.P. and K.Z.; Supervision, D.B., R.B. and M.P.; Project administration, P.A., J.Z. and R.B.; Funding acquisition, P.A., R.B. and M.P. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by California Energy Commission grants EPC-17-002 and EPC-15-057 and by the U.S.–China Clean Energy Research Center (CERC) 2.0 on Building Energy Efficiency (BEE), supported by the U.S. Department of Energy, Building Technologies Office. Lawrence Berkeley National Laboratory is a multiprogram science lab in the national laboratory system supported by the U.S. Department of Energy through its Office of Science under Contract No. DE-AC02-05CH11231.

**Acknowledgments:** The authors wish to acknowledge the Blue Lake Rancheria for supporting this research by providing cost share and providing their convenience store as a pilot site to deploy the Solar+ Optimizer software.

**Conflicts of Interest:** The authors declare no conflict of interest.
