Smart Grid 2.0 (SG 2.0) implementation constitutes an additional challenge in the industry and research fields. Energy consumption decreases when producers exchange excess energy consumers, including intelligent consumers, Distributed Generation (DG), such as wind and solar, and Electric Vehicles (EVs). By utilizing Demand Response (DR) based on Real-Time Pricing (RTP), the operation of every device in a smart home can be scheduled. Allowing users to trade energy directly with other energy producers (prosumers) rather than exclusively relying on the grid, peer-to-peer (P2P) energy trading in smart homes lowers energy prices for users. This article focuses on how the DR P2P energy trading affects consumers. The study conducted utilizes a two-stage scheduling technique to reduce consumers' electricity expenses. The initial stage involves arranging each device in the smart home based on RTP employing a deep learning method. The P2P energy trading between consumers in the second phase is made more accessible by the DR and the simulation results exhibit that energy trading decreases electricity bills in smart homes. Utility companies can reduce load during peak hours using DR-based P2P energy trading.