## 1 Introduction  
The Internet of Things has grown drastically to become one of the most significant inventions of the 21 st century. The IoT consists of a collection of connected physical objects that are linked together by sensors, applications, and other technologies for data integration and exchange across devices and systems [1]. These devices connect using the Internet protocol (IP), which is the same technology that is used to recognize computers on the Internet and allows users to interact with one another via the Internet. The goal of the Internet of Things is to have devices that can self-report data and information regularly, enhancing efficiency and delivering essential information speedier than a system that is based on human input [2]. Smart buildings use connected technologies, devices, data analytics, and automation to control infrastructures, such as security, lighting, ventilation, heating, and air conditioning [3]. Smart heating, ventilation, and air conditioning (HVAC) controls can reduce HVAC usage, especially during peak energy demand periods, by limiting power consumption in unoccupied building zones, detecting and diagnosing issues, and limiting energy consumption. Smart buildings offer great comfort and increase safety for building occupants, improve energy efficiency, and lower facility running costs via automation, sensors, and remote features. Smart buildings deploy IoT sensors to detect and analyze several factors in building parameters that can be used to improve buildings' environments and activities. Smart buildings, which use the Internet of Things (IoT) to connect building operations,and monitor building temperature, security, and maintenance, are easier to control via smartphones and tablets. Buildings are becoming smarter due to the IoT, which is capable of integrating thousands of sensors and enabling real-time data collecting and analysis, making them more efficient and user-friendly [4]. One of the most key technologies to consider when designing smart buildings is a fire alarm system. An IoT-based fire alarm system is essential to ensure the protection of people's lives and to reduce the amount of damage as much as possible. In [5] the author explained behaviors and energy consumption trends using the machine learning algorithm (also known as J48) and the Weka API and then classified it according to energy consumption. For home comfort, security, and energy-saving, HEMS-IoT, a smart energy management system that is based on the big data for the home and machine learning, was proposed. Machine learning and big data are crucial because they allow the system to track and classify energy usage efficiency, recognize user behavior patterns, and keep the buildings occupants comfortable. In [6] the authors start by exploring the numerous security issues that IoT applications face, second, to address current security concerns, the authors conducted a survey. Away for developing smart building applications that link the IoT with smart building web services is described in [7]. Ref. [8] demonstrate how the IoT can be applied to design smart buildings; the team employed a smartphone app and also open-platform servers. As a result, they devised a system for controlling the devices that included relays and a low-cost microcontroller Arduino board. An Android smartphone application is also included with the smart system, and users can interact with it. Ref. [9] present an overview of the application of machine learning techniques for the achievement of a global implementation of the IoT. A discussion is performed on some of the essential strategic technologies and application fields that are supposed to drive Internet of Things research in future years. In [10] an intelligent controller for commercial and residential HVAC systems was developed by the authors using machine learning techniques. It is presented in [11] that IoT networks must make contextual and situational customized resources and managerial decisions regarding the allocation of resources difficulties.