Energy efficiency is a critical requirement for nations across the globe. In this connection, Smart Grids (SGs) have become a focal point due to the integration of numerous sensors and modern hardware, including smart devices. This research investigates the optimization of energy efficiency in smart grid systems by enhancing wireless communication through advanced machine learning algorithms. Moreover, this study explores the Home Area Networks (HANs) technologies such as ZigBee, Bluetooth, Wi-Fi, 6LoWPAN, and Z-Wave within the SG context. We propose a model to streamline data transmission, improve reliability, and strengthen security measures. Python-based simulations will be conducted to evaluate the model's efficacy, with results presented through various graphical representations. Through the integration of deep learning model, 99% accuracy, 98% precision and 97% recall was achieved. Preliminary results indicate that the integration of machine learning techniques significantly enhances energy optimization