Background: The Distributed Energy Resources (DERs) are beneficial in reducing the electricity bills of the end customers in a smart community by enabling them to generate electricity for their own use. In the past, various studies have shown that owing to a lack of awareness and connectivity, end customers cannot fully exploit the benefits of DERs. However, with the tremendous progress in communication technologies, the Internet of Things (IoT), Big Data (BD), machine learning, and deep learning, the potential benefits of DERs can be fully achieved, although a significant issue in forecasting the generated renewable energy is the intermittent nature of these energy resources. The machine learning and deep learning models can be trained using BD gathered over a long period of time to solve this problem. The trained models can be used to predict the generated energy through green energy resources by accurately forecasting the wind speed and solar irradiance. Methods: We propose an efficient approach for microgrid-level energy management in a smart community based on the integration of DERs and the forecasting wind speed and solar irradiance using a deep learning model. A smart community that consists of several smart homes and a microgrid is considered. In addition to the possibility of obtaining energy from the main grid, the microgrid is equipped with DERs in the form of wind turbines and photovoltaic (PV) cells. In this work, we consider several machine learning models as well as persistence and smart persistence models for forecasting of the short-term wind speed and solar irradiance. We then choose the best model as a baseline and compare its performance with our proposed multiheaded convolutional neural network model. Results: Using the data of San Francisco, New York, and Los Vegas from the National Solar Radiation Database (NSRDB) of the National Renewable Energy Laboratory (NREL) as a case study, the results show that our proposed model performed significantly better than the baseline model in forecasting the wind speed and solar irradiance. The results show that for the wind speed prediction, we obtained 44.94%, 46.12%, and 2.25% error reductions in root mean square error (RMSE), mean absolute error (MAE), and symmetric mean absolute percentage error (sMAPE), respectively. In the case of solar irradiance prediction, we obtained 7.68%, 54.29%, and 0.14% error reductions in RMSE, mean bias error (MBE), and sMAPE, respectively. We evaluate the effectiveness of the proposed model on different time horizons and different climates. The results indicate that for wind speed forecast, different climates do not have a significant impact on the performance of the proposed model. However, for solar irradiance forecast, we obtained different error reductions for different climates. This discrepancy is certainly due to the cloud formation processes, which are very different for different sites with different climates. Moreover, a detailed analysis of the generation estimation and electricity bill reduction indicates that the proposed framework will help the smart community to achieve an annual reduction of up to 38% in electricity bills by integrating DERs into the microgrid. Conclusions: The simulation results indicate that our proposed framework is appropriate for approximating the energy generated through DERs and for reducing the electricity bills of a smart community. The proposed framework is not only suitable for different time horizons (up to 4 h ahead) but for different climates.