The integration of renewable energy sources (RES) into modern power grids has enabled decentralized energy generation at the community level, fostering peer-to-peer (P2P) energy trading among prosumers and microgrids. Accurate forecasting of household energy consumption and photovoltaic (PV) generation is critical for optimizing energy flows, enhancing grid reliability, and enabling cost-effective trading decisions. This paper presents an intelligent energy trading platform that integrates machine learning-based forecasting, battery-aware decision-making, and blockchain-enabled transactions to facilitate secure and efficient local energy exchange. Using historical smart meter and weather data from London households, multiple forecasting models including GRU, LSTM, Random Forest, and XGBoost were trained and evaluated. The GRU model achieved superior performance in predicting energy consumption, while Random Forest produced the most accurate PV generation forecasts. These predictions were combined with household battery levels to dynamically determine next-day operational roles: Buyer, Seller, Store, or Use Battery. Unlike conventional fixed-threshold approaches, the framework supports user-defined variable battery thresholds, allowing personalized energy management strategies. The proposed decision-making model achieved an accuracy of 90.72 % for one random block, and extended simulations across 29 different random household blocks confirmed its robustness with an average accuracy of 88.69 % (95 % CI: 87.9–89.6 %). In the trading phase, households participate in a decentralized energy trading platform powered by blockchain and smart contracts. Based on the next-day forecasts, a linear programming-based optimization algorithm matches buyer requests and seller offers to minimize the total system cost while ensuring fairness and efficient energy allocation. To assess its performance, the proposed optimization approach was compared against a greedy matching algorithm where sequential matching is done without a cost optimization and a grid baseline scenario where no storage/sharing of energy takes place. The optimized matching consistently achieved substantially lower trading costs across all households demonstrating superior efficiency, fairness, and scalability compared to the benchmark methods. All transactions are executed securely and transparently on the blockchain through Ethereum-based smart contracts, which automate energy trading, pricing, and settlement. A user-friendly web interface was developed to allow participants to monitor and interact seamlessly with the platform. Overall, this battery-aware, community-driven trading framework showcases how intelligent energy forecasting, cost-optimized decision-making, and blockchain-enabled trading can collectively enhance energy autonomy, cost savings, and renewable energy utilization at both the household and community levels.
Elsevier, 2026. Vol. 45, article id 102074