Abstract: In order to meet the increasing growth of energy demand, integration of renewable resources into residential applications appears to be a viable solution. In the proposed model,a residential house is considered where the consumer is able to generate his own energy from a microgrid consisting of solar panels and wind turbines. In this study, an optimization method is employed to minimize the overall electricity bill of a residential home over a periodof 24 hours. In smart grids, energy management is imperative in reducing the electricity cost of consumers under a real time pricing approach. Nowadays, learning-based modeling methods are utilized to build a precise forecast model for renewable power sources. In this paper, we propose a long short-term memory (LSTM) recurrent neural network-based framework, which is one of the most popular techniques of deep learning. This technique predicts day ahead solar irradiation and wind speed data. We also consider an energy storage system (ESS) for efficient energy utilization. Optimization is done and from the obtained results a substantial reduction in electricity bill is observed