This study presents a smart energy management system (SEMS) to optimise the operation of the microgrid. The SEMS consists of power forecasting module, energy storage system (ESS) management module and optimisation module. The characteristic of the photovoltaics (PV) output in different weather conditions has been studied and then a 1-day-ahead power forecasting module is presented. As energy storage needs to be optimised across multiple-time steps, considering the influence of energy price structures, their economics are particularly complex. Therefore the ESS module is applied to determine the optimal operation strategies. Accordingly, multiple-time set points of the storage device, and economic performance of ESS are also evaluated. Smart management of ESS, economic load dispatch and operation optimisation of distributed generation (DG) are simplified into a single-object optimisation problem in the SEMS. Finally, a matrix real-coded genetic algorithm (MRC-GA) optimisation module is described to achieve a practical method for load management, including three different operation policies and produces diagrams of the distributed generators and ESS.