Effective energy management requires advanced strategies to optimize consumption, enhance reliability, and promote sustainability. This paper addresses secure and transparent energy management by integrating blockchain technology with machine learning for anomaly detection. We deploy a blockchain architecture to ensure tamper-proof, decentralized data sharing, allowing for anomaly alerts by postcode. This study evaluates four clustering algorithms K-Means, DBSCAN, MeanShift, and Isolation Forest-for detecting anomalies. Automated hyperparameter tuning was applied, and the methods were validated using the Ausgrid dataset, which contains detailed energy consumption records. To establish a robust anomaly detection framework, we employ well-known supervised classification algorithms - Decision Tree, KNN, Logistic Regression, Random Forest, and XGBoost - to evaluate the performance of each clustering method and conduct a comparative analysis to identify the most effective machine learning algorithm. A cross-validation process is undertaken to optimize hyperparameters for each classification method. To address the challenge of imbalanced datasets, we applied SMOTE (Synthetic Minority Over-sampling Technique), which generates synthetic samples for underrepresented classes. The performance of anomaly detection algorithms was compared with and without this technique. The proposed system's scalability, supported by energy-efficient consensus mechanisms such as Proof of Stake, ensures its applicability to large-scale energy management systems. These features demonstrate the framework's potential to enhance grid resilience and support dynamic, decentralized energy networks in real-world scenarios. Overall, our proposed architecture demonstrates significant results, confirming that the combination of blockchain technology and machine learning enhances the security, transparency, efficiency, and resilience of energy management systems.