An IoT-Driven Predictive Energy Optimisation Framework for Maximum Demand Management