This paper formulates a unit commitment optimization problem for renewable energy sources distributed in a micro-grid formed by a complex of intelligent buildings of both office and residential characters, including a wide range of amenities. We present a general description of the solution of this task using the simulated annealing heuristic optimization technique. The experiment was processed in the specialized computer program. For comparison, Appendix A of the article describes the Lagrange multipliers optimization method as the conventional alternative to the used heuristic technique. A description of the concept of intelligent buildings is provided in Appendix B.