A model for operating an energy hub-based multiple energy generation micro-grid is optimized using the demand response program. The optimized objective model is validated against energy demand of a residential building in Tehran, Iran. The mathematical model and optimal analysis of the proposed tri-generation micro-grid are implemented by using a real-world modelling and considering the constraints of the storage system, demand response program and the performance of the devices and the power and gas grids. The dynamic optimal operation model is prepared on the basis of the mixed integer linear programming on the subsequent day and is solved to minimize the costs of energy supply. To demonstrate the improvements, different scenarios are developed so that the renewable energy resources and storages are fed into the combined cool, heat and power system gradually. The results reveal that the inclusion of each element results in a significant improvement in the operational parameters of the micro energy grid. Scenario 1 includes a combined cool, heat and power system alone, Scenario 2 is supplemented with renewable wind and solar energy resources in addition to combined cool, heat and power system and Scenario 3 includes electrical, heat and cold storages in addition to combined cool, heat and power system and renewable energy sources. Scenario 4 is similar to Scenario 3 in terms of equipment, but the only difference lies in the use of the demand response program in the former. Total operational cost is 12.7% lower in Scenario 2 than in Scenario 1, 9.2% lower in Scenario 3 than in Scenario 2 and 8.6% lower in Scenario 4 than in Scenario 3. Practical application: An optimized operation method is prepared for combined cool, heat and power systems running in different operation modes in which renewable energy sources and storages are added to the combined cool, heat and power and the demand response program is applied. The results reveal that the cost of energy supply, including the cost of electricity, gas and pollutant emissions, is reduced and the qualitative parameters of the operation, including efficiency and reliability of building micro-grid, are increased. The proposed algorithm and the evaluation method will enable building operators to plan demand response activity on the residential building in Tehran, while this can be extended to other buildings too.