Real-time Multi-scale Smart Energy Management and Optimisation (REMO) for buildings and their district