This paper is concerned with optimal energy management of micro-grids. The goal is to show that the problem of minimizing the operating costs of a micro-grid by coordinating and scheduling its components can be formulated as a constrained optimal control problem for a stochastic hybrid system. This, in turn can be addressed through the Dynamic Programming (DP) approach, and the resulting DP equations solved through approximate DP techniques. A simple case study of a building cooling system with two chillers serving a cooling load is presented to this purpose