This paper presents an approach to the energy management and control of the effective cost of energy in real-time electricity pricing environment. The strategy aims to optimise the overall energy flow in the electrical system that minimises the cost of power consumption from the grid. To substantiate these claims different cases of time-of-use (TOU) and renewable energy electricity tariff, i.e. in summer and winter seasons, and the robustness of system is analysed. A given energy demand for commercial usage in the city of Tshwane (South Africa) is used to investigate the behaviour of the designed method during low and high demand periods. As grid integrated renewable energy resources, photovoltaic (PV) is an important consideration in assuring excellent power supply and environmental issues in the commercial building. An adaptive optimal approach in the framework of model predictive control (MPC) is designed to coordinate the energy flow on the electrical system. The results show that the proposed adaptive MPC strategy can promote the new approach of an optimal electrical system design, which reduces the energy cost to pay the utility grid by about 46% or more depending on the set target.