A distributed energy management system for community microgrids is developed in this paper. Unlike a centralized optimization-based energy management system, it schedules distributed energy resources and energy storage systems, as well as residential appliances, indirectly through iterative interaction between the microgrid central controller and home energy management systems, based on price signals. In each iteration, the microgrid central controller adjusts the scheduling of distributed energy resources and energy storage systems at the microgrid level. Meanwhile, the home energy management system of each house adjusts the scheduling of residential appliances. Then, the energy price at each bus is updated according to the unbalanced power between generation and demand. The optimization converges when the unbalanced power of all buses is close to zero, i.e., the microgrid central controller and home energy management systems reach an agreement on the energy price and generation/consumption. In particular, a detailed thermal dynamic model of the house is integrated into the HEMS scheduling for intelligent control of the heating, ventilation, and air-conditioning system by customers. The distribution network is also considered to make the energy price signal locational. Results of case studies validate the efficacy of the proposed distributed energy management system.