 The proposed smart hybrid energy system, SHES, combines batteries, photovoltaic, PVA systems, and diesel-slash gas engines to provide reliable electricity supply while reducing carbon dioxide emissions. An economic-slash environmental dispatch optimization algorithm, EDOA, is used to optimize the system's operation in order to minimize costs or emissions. To address the uncertainty of renewable power generation, constraints on loss of load probability, LOLP, and operating reserves for the rechargeable battery are considered. The system can operate in either grid-connected or island modes, depending on the location and needs of the community. Forecast models such as LSTM or XGBoost are used to improve the EEDOA, which further reduces costs and emissions. This article was authored by Wei Wu, Shiche Chou, and Karthikian Vishwanathan.