###### Abstract  
The security measures of IoT devices used in intelligent buildings are one of the ways by which energy efficiency can be accomplished. IoT devices are very important for data collecting and monitoring in intelligent buildings, but a lack of security could result in errors in energy consumption decisions that result in energy waste. To ensure the success of the control systems used for energy optimization, it is necessary to address the security of IoT devices in order to avoid illegal access, data manipulation, and disruptions. This work proposes a research idea and scheme for energy-saving optimization of intelligent buildings by assuring the security of IoT devices used in intelligent buildings. First of all, we defined several parameters that are related to IoT devices' security, energy consumption, and occupant comfort in the intelligent building environment. Secondly, we collected data for each of these parameters by utilizing IoT devices such as actuators, sensors, and other control systems. The niche genetic algorithm (NGA) refers to a particular class of genetic algorithms that is used to tackle problems involving many optimization objectives. We focused on optimizing both energy consumption and occupants' comfort; therefore, we used an NGA for the preprocessed data with the goal of evaluating the data for the purpose of ensuring the comfort of occupants and protection of the security of IoT devices, which eventually leads to energy optimization. Finally, the results of the proposed approach are analyzed and carefully compared with earlier work, demonstrating that our proposed approach is significantly more effective and energy-optimized than earlier approaches. The results show that the total power consumption of the intelligent building system after using our proposed model is generally reduced by more than 18% compared with that before optimization, which shows that the intelligent building system-adaptive optimization control model can effectively optimize the operating parameters of the energy-saving system and achieve the security of IoT devices. IoT devices security; niche genetic algorithm; intelligent building; energy-saving optimization 2  
services, and management, and the interrelationships between them\" [3]. The term \"intelligent building\" was first used to describe a building focused on sustainability rather than cutting-edge technology, but more recently, both have been used. The Internet of Things (IoT), artificial intelligence (AI), and information and communication technology (ICT) serve as the foundations for intelligent buildings. With the use of these cutting-edge technologies, smart building not only tries to provide ease but also minimize energy consumption because more energy consumption is not only a waste of resources but also causes environmental problems. IoT is without a doubt the key component of intelligent buildings because it integrates a variety of systems, sensors, and gadgets [4]. With the help of IoT, data collecting and monitoring tasks are carried out in the context of intelligent buildings while also being automated, which is crucial for sustainability and energy savings. Despite the countless advantages of IoT in the context of intelligent buildings, there are certain difficulties as well. Security and privacy issues are the most significant among all the difficulties intelligent buildings face when implementing IoT [5]. The extensive security and privacy features included in IoT devices used in smart buildings contribute to accurate data, reliable functioning, and occupant confidence. In intelligent buildings, these components serve as the cornerstone of successful energy optimization measures [6]. Building managers can make wise choices that result in greater energy saving without affecting the safety of the building's occupants or the accuracy, security, and privacy of the data collected and used for optimization.