 The increasing price of and demand for energy has led to the development of intelligent strategies for energy tracking, control, and conservation. One such strategy is demand side management, which seeks to reduce energy consumption by adjusting customer energy consumption patterns and responding to energy-saving algorithms and directives. To this end, the Internet of Things, IoT, is being used to create a smart energy management system for smart environments. This system combines an energy controller with an IoT middleware module to monitor and optimize energy consumption from air conditioning systems. The energy controller collects data from multiple devices and sends it to the cloud server for processing and analysis. The system is then able to make decisions about when to turn off or adjust the settings of air conditioners depending on the ambient temperature and operational dynamics of the building. The system was tested in four buildings and demonstrated significant energy savings of up to 49%. These savings were achieved by optimizing the energy consumption of air conditioning systems and providing real-time monitoring, advanced algorithms, and user-friendly interfaces. This article was authored by M. Usman Saleem, Mustafa Shaker, M. Rehan Usman, and others. We are article.tv, links in the description below.