The development of smart energy systems infrastructure has been initiated with deployment of smart meters from the beginning of this millennium. The smart grids incorporated into a hybrid system with optimal energy mix are partly solution to the severe environmental problems, the scarcity of fossil fuels and the constant growth of energy needs. The optimal energy mix contains renewable energy sources, energy efficiency solutions, and energy storage options. In more complex multi energy systems the monitoring and control of the all energy flows (electricity, heat, gas) has been crucial for the evolution to the smart grids as a part of the wider smart energy systems infrastructure, especially in smart cities. In this paper the three step investment minimization problem of the total costs for the instalment of the smart energy system has been formulated. The results show yearly electricity and heat balance (and even hourly) obtained using HOMER software tool. The developed model together with available software can support the decision making in planning phase of the smart energy subsystem.