The integration of artificial intelligence (AI) into energy networks significantly advanced short-term forecasting, particularly in smart meter applications. However, as distributed energy resources proliferated and energy systems grew in complexity, traditional centralized approaches to data analysis became insufficient in addressing privacy-preserving challenges. Federated learning (FL) emerged as a promising solution, leveraging distributed data sources while safeguarding user privacy. Nonetheless, FL encountered inherent vulnerabilities to adversarial attacks during model training, undermining its reliability and effectiveness. Existing techniques to eliminate these attacks often required additional frameworks for detection, imposing an added burden on devices. To address this issue, we proposed a novel method called federated random layer aggregation (FedRLA). It aggregated only one randomly chosen neural network layer on the server in a privacy-aware manner, leaving the remaining layers unchanged. FedRLA exhibited superior resilience against adversarial attacks by confining attackers to a single neural network layer. Our simulations, focusing on household energy consumption, demonstrated that FedRLA achieved 3.56 times less data transmission compared to FedAvg during global model training. This enhanced efficiency translated to improved energy usage and resource conservation. Furthermore, FedRLA performed better in the presence of differential privacy under attack and no attack conditions.