The building sector's energy consumption remains a significant problem, requiring the development of powerful energy management systems to improve energy efficiency. The main aim of this research is to forecast energy use through indoor temperature, relative humidity, time, and time lag as crucial factors. The research project aims to enhance power consumption forecasting throughout the operating phase of buildings by using advanced machine learning (ML) regression models such as XGBoost, LightGBM, Extra Trees, and Random Forest. The dataset includes 10 days during which the building's operation testing took place, illustrating the complexities of real-world conditions. The inclusion of time-related characteristics and time delay arises as a critical element in enhancing prediction accuracy, emphasizing the temporal sensitivity of power use. A hyperparameter tuning method was used to improve the performance of the implemented ML algorithms. The results emphasize the effectiveness of Extra Trees as the most suitable model for forecasting power consumption in building operations with an accuracy of 88.41%.