This study examines the vital role of accurate load forecasting in the energy planning of smart cities. It introduces a hybrid approach that uses machine learning (ML) to forecast electricity usage in homes, improving accuracy through the extraction of correlated features. The accuracy of predictions is assessed using loss functions and the root mean square error (RMSE). In response to increasing interest in explainable artificial intelligence (XAI), this paper proposes a framework for predicting energy consumption in smart homes. This user-friendly approach helps users understand their energy consumption patterns by employing shapley additive explanations (SHAP) techniques to provide clear explanations. The research uses gradient boosting and long short-term memory neural networks to forecast energy usage. In the context of sustainable urban development, it emphasizes the importance of conserving energy in homes. The paper explores AI and ML methods for predicting residential energy use, aiming to make socially meaningful impacts. It highlights the need to understand the factors affecting predictions to improve the accountability, reliability, and justification of decisions in energy optimization. Explainable AI techniques are used to gain insights into the prediction models and identify factors influencing household energy consumption. This research aids in decision-making processes related to electricity forecasting, advancing discussions on intelligent decision-making in power management, especially in smart grids and sustainable urban development.