## 1 Introduction
The new European Directive on the energy performance of buildings is a further step on the path towards reducing energy consumption in buildings. It is important to note that this Directive does not have a direct effect but must be translated into national laws and regulations. At the same time, it should be noted that this is not a legally binding interpretation claiming to be complete but a basic building block to be relied upon when addressing this issue on a research and development platform. Therefore, the above claims, conditions, and recommendations are reflected in the design of our research on the platform of the experiment being presented in this paper. Last but not least, it is important to recall that the requirements of Directive 2010/31/EU require, among other things, that the design documentation for all new buildings has to meet the requirements for a so-called Nearly Zero Energy Building (\"NZEB\") since 1 January 2020. A nearly zero energy building is a very low-energy building, where the energy consumption is covered largely by renewable sources (Act No. 406/2000 Coll., on Energy Management, as amended). As mentioned earlier, our research aims to design a smart building template that controls the performance of all technical systems via IoT technology with regard to achieving energy efficiency and sustainable energy within a smart district, or more precisely, a smart city system. Smart building (home) equipment can be divided into the following areas according to the benefits they bring to home users [20; 21; 22]:  
* Comfort
* Assistive technologies
* Security
* Energy saving  
New technologies allow the creation of buildings that are more efficient in terms of energy and water consumption, or generally use more efficient and sustainable resources. Buildings with high-performance appliances that significantly reduce resource usage are designed. Features that allow the building to generate more energy than it consumes are included, smart meters are installed, the Internet of Things is implemented, and large amounts of data on the efficiency of the building's operations are analyzed. Today, so-called smart buildings are created. The building is a part of a larger city system. The city-systems are very complex systems with the following constantly interacting system components: the man-made environment (buildings, infrastructure, urban planning, etc. ), its social environment based on paradigms, values, policies and available technologies, and the natural environment the system needs to exist. These components of the city system are constantly interacting with each other, affecting the city's functioning, surroundings thereof, the operation of buildings in the city, and the people who live, work, and spend their leisure time there [23]. A smart city is not just a collection of smart buildings connected to other smart buildings and decentralized microsystems. It is a complex system managing a constant supply and demand, a continuous relationship between giving and receiving, and continuous exchange among its built environment, social environment, and natural environment. A smart city can only work if all the system components thereof take advantage of this constant flow of exchange, providing information and feedback loops on the necessary inputs and resulting outputs. A smart building is not only an energy consumer but also a producer. A smart building is a power plant within a larger energy-intensive and manufacturing subjects system. The conventional idea of delivering public utilities and requiring them by the building is obsolete in the era of smart buildings. In the era of smart buildings, a new grid model is needed. Grids are no longer the main energy producer. Their main task is to manage multiple sources of energy production and distribute them correctly. Everyone in the system becomes a micro-power plant and the network administrator is responsible for its management. We can show this in Figure 2, although this situation is well known today.