The Internet of Energy (IoE) impacts on smart cities' power sector. IoE is an implementation of the Internet of Things technology (IoT) into distributed energy systems and aims to achieve energy efficiency, to avoid energy wasting, and improve environmental conditions. IoE technology includes, among others, utilizing smart sensors and renewable energy integration. Therefore, the IoE is becoming a legal science tool to serve the purpose of a smart city. In this paper, we refer to the reasons that led the European Union to compile Regulations for facilitating transformation of existing cities, starting from existing buildings, into smart buildings. We propose a smart building template that manages the performance of all technical systems through IoT technology with the view of achieving energy efficiency. In addition, in order to improve the certification of existing buildings, as for energy performance, we propose an automated remote, control method supported by cloud interface. This method minimizes time consuming procedures and stores, on a cloud platform the energy performance of each building, for the purpose of drawing conclusion and applying measures. INDEX TERMS Energy efficiency, energy performance of existing buildings, Internet of Things, smart building template, smart energy management.