Motivated by the potential ability of air conditioning (A/C) units in demand response, this paper explores how to utilize A/C units to increase the profit of a smart community. A coalitional game between the households and the load serving entity (LSE) in a smart community is studied, where the LSE joins by selling renewable energy to householders and providing an energy saving service to them through an A/C controller. The A/C controller is designed to reduce the amount of electricity purchased from the main grid by controlling A/C units. An online A/C energy management algorithm is developed, based on Lyapunov optimization, that considers both the A/C energy consumption and the thermal comfort level of consumers. In order to quantify the contribution of A/C units, the Shapley value is adopted for distribution of the reward among the participating householders and the LSE, based on their contribution. The simulation result verifies the effectiveness of the proposed coalitional game for a smart community and the algorithm for A/C.