Electronic gadget advancements have increased the demand for IoT-based smart homes as the number of connected devices grows rapidly. The most prevalent connected electronic devices are smart environments in houses, grids, structures, and metropolises. Smart grid technology advancements have enabled smart structures to cover every nanosecond of energy use. The problem with smart, intelligent operations is that they use a lot more energy than traditional ones. Because of the growing growth of smart cities and houses, there is an increasing demand for efficient resource management. Energy is a valuable resource with a high unit cost. Consequently, authors are endeavoring to decrease energy usage, specifically in smart urban areas, while simultaneously ensuring a consistent terrain. The objective of this study is to enhance energy efficiency in intelligent buildings for both homes and businesses. For the comfort indicator ("thermal, visual, and air quality"), three parameters are used: temperature, illumination, and CO2. A hybrid rule-based Deep Neural Network (DNN) and Fire Fly (FF) algorithm are used to read the sensor parameters and to operate the comfort indication, as well as optimize energy consumption, respectively. The anticipated user attributes contributed to the system's enhanced performance in terms of the ease of use of the smart system and its energy usage. When compared to traditional approaches in expressions of Multi View with 98.23%, convolutional neural network (CNN) with 99.17%, and traffic automatic vehicle (AV) with 98.14%, the activities of the contributed approach are negligibly commanding.