This paper presents the modelling and a formal verification approach of energy management control systems for microgrids that are subject to unknown demand and uncertainties in the availability of renewable energy sources. The main objective of this study is to develop a management system for a microgrid composed of renewable and non-renewable energy sources, specifying the different possible modes. A supervisory control method is proposed to autonomously control and monitor a microgrid and maintain more stable energy flows with maximum utilization of available resources. A timed automata network model of the microgrid has been developed by modeling the dynamics of components such as PV, BESS, diesel generator, load, and controller. Possible operating modes in the microgrid between sources and load are derived and classified into allowed and unallowed operating modes. Verification of the designed microgrid models was performed using simulation and formal methods. The advantageous performance of the proposed strategy is illustrated via a numerical example.