Increasing energy demand in buildings in the last decade has led to more efficient usage of renewable energy. Building integrated photovoltaic/thermal systems is one of the effective ways of reducing energy consumption in buildings by providing heating, cooling, ventilation, hot water, and air. The enhancement of photovoltaic cell temperature reduces the electrical efficiency of photovoltaic panel systems. In this regard, the effects of cooling with air and phase change material layer are investigated in this study. The simulation of BIPV/T, PV, and heat pump was done in TRNSYS. As the main novelty of recent simulation, for the calculations of phase change material layer, MATLAB coupled with the TRNSYS, and Python software was used for the prediction process under the weather conditions of Sharurah, Saudi Arabia for 2022. Also, the performance of a building integrated photovoltaic/thermal system with a phase change material layer is predicted for 2024 and 2025 by the Random Forest machine learning method. The R squared, Root Mean Squared Error, and Mean Absolute Error are utilized for checking the accuracy of the model. Also, for more certainty, a validation was done on the simulated results of TRNSYS and the results showed high conformity of data. The simulated data for the first six months of 2022 showed that the maximum cooling effect happened in June with 25.47 °C and a 37.87 % reduction in photovoltaic cell temperature. Also, the best electrical efficiency improvement was 1.26 % while the thermal efficiency ranged from 29.65 % to 59.40 %, respectively. The predicted data was confirmed by R2, RMSE, and MAE equal to 96.64 %, 0.06 and 0.04. According to the simulation and predictions done, the annual electrical production of the building is achieved. The results indicate that, for the simulated system, about 29.7 %, 29.8 %, and 29.6 % of total energy utilization could be supplied by BIPV/T cooled with phase change material in 2022, 2024, and 2025, respectively.