## 3 Smart city Strategy to Energy Sustainability  
This section reviews the shared aspects of energy sustainability and the smart city urban management strategy arising from the analyses above. The energy transition in cities seeks to change the current model of centralized generation, which is dependent on the consumption of external energy resources, to a distributed one. In this new distributed system, the smart energy systems make the electricity supply more flexible, increasing the efficiency of the distribution value chain, allowing for the integration of renewable energies into the grid and empowering the consumer in the management of demand. Figure 5 shows the process of decentralization of the electrical system within the smart city urban management model. Figure 5: Decentralization of the power electric system within the smart city urban management model. DG can be defined as electric power generation within distribution grids on the customer side of the network [64]. Through this type of generation, it is possible to take advantage of the renewable energy resources in cities. This improves the system efficiency by reducing the losses incurred by the electric transport grid. On-site generation is based on energy self-consumption under the \"zero energy\" concept, which is a determining factor in the management of energy resources in smart cities. When applying this concept to the level of buildings, the idea of \"zero energy buildings\" emerges. These buildings could provide significant and sustainable reductions and help to realize more energy efficient buildings and cities [65]. As shown in Figure 6, the Zero Energy concept is made up of three parts, which are divided based on the balance between demand and the \"credits\" obtained from energy self-consumption. Nearly zero energy is when demand is low but even so it exceeds self-consumption. Net zero energy occurs when demand equals self-consumption. Plus zero energy is the result of local generation exceeding the demand and the energy can be stored or exported to the grid, depending on market conditions or distribution grid techniques. The advancement of Zero Energy Buildings and ICT in buildings creates smart buildings: Residential buildings, offices, commercial, or industrial buildings and smart homes (homes with a high level of comfort which are technologically and architecturally integrated into their surroundings--also called Green buildings [66]) [67]. With the presence of smart meters connecting each point of consumption and generation to the smart grid, \"zero energy buildings\" (Nearly (nZEB), Net (NZEB), and Plus (PZEB)) can share electricity to other DG systems in communities or cities. Therefore, referring back to Figure 6 and taking the \"zero energy concept\" to a community (building or city) level, it is possible to consider the idea of Nearly Zero Energy Communities/Cities (nZEC); that is to say urban systems made up of \"zero energy buildings\" and other systems of generation in which, based on the consumption of locally-generated (endogenous) energy, the consumption of external (exogenous) energy is reduced. From the smart technological development in the distribution grids, new services emerge which will help to increase the energy efficiency of the system by means of the economic incentive to new market agents. Regarding the consumer, although the DSR is a strategy dating from before the development of smart technologies, with smart meters the consumer can manage electric demand in real-time. Similarly, from Zero Energy Buildings, the consumer can become a prosumer of electric energy by adding their surplus energy to the grid and receiving an economic benefit in return. On the other hand, through the advance of distributed generation, PV, and small wind energy have a large margin for growth. This means that energy producers can take advantage of urban spaces or rooftops to generate electricity near consumers. Likewise, demand aggregator comes into play.