• The hybrid ML approach forecasts optimal EV charging in PV–driven buildings. • Integrated RSM optimization maximizes SSR while minimizing LCOE and CO 2 emissions. • EV charging windows are predicted from minimal, user-friendly input features. • Six ML regressors trained on 315 k + samples for data-driven control decisions. • Ensemble models (RF, XGBoost) achieve R 2 > 0.9923 with low predictive uncertainty. The growing penetration of distributed photovoltaics (PV) and electric vehicles (EVs) in residential buildings calls for intelligent energy-management strategies to increase self-consumption, reduce grid dependence, and limit environmental impacts. This study proposes a multilayer machine learning (ML) framework to forecast optimal EV charging schedules in PV–BESS–driven buildings by combining high-fidelity dynamic simulations, multi-objective optimization, and data-driven predictive control. Practical applicability is targeted through minimal user inputs (daily weather forecasts, calendar features, and EV battery class), while maintaining low computational burden, interpretability, and retrainability across climates, user profiles, and tariff structures. In the optimization stage, Response Surface Methodology (RSM) simultaneously maximizes the self-sufficiency ratio (SSR) and minimizes the levelized cost of electricity (LCOE) and operational CO 2 emissions, guiding optimal system sizing and operating trade-offs. A labeled dataset of 315,360 samples is generated from optimized dynamic simulations and used to train six post-hoc explainable ML regressors (RF, XGBoost, SVR, KNN, FNN/MLP, and TabNet) to predict optimal EV charging windows from the same minimal user-friendly inputs. The results show that the optimization captures the trade-offs inherent in PV–BESS–EV integration, achieving optimal sizing with SSR values above 85% while minimizing LCOE and operational CO 2 emissions. Ensemble-tree models deliver the highest predictive accuracy ( R 2 > 0.9923, U 95 within a ±0.2 score band); correlation matrix and SHAP analyses indicate that SSR dominates the predictions, with economic drivers acting as secondary factors and environmental indicators providing tertiary refinements. Overall, the proposed framework provides an interpretable and scalable tool for intelligent EV charging in residential buildings, integrating techno-enviro-economic objectives. It enables fast, explainable recommendations for residential energy management system (EMS) and user-facing applications, without requiring real-time optimization, thereby improving self-sufficiency and reducing grid dependence.
Selicati et al. (Sun,) studied this question.