This paper develops an optimal control strategy for power dispatch of the grid-tied photovoltaic (PV)–battery–diesel system to power
heat pump water heaters (HPWH). The system consists of the PV modules, grid, battery, HPWH, diesel generator (DG) and other
domestic appliances. The PV can simultaneously feed in the excess power to the grid and supply the loads. The battery is used as storage
of cheaper-to-buy off-peak grid energy, dependent on the time-of-use (TOU) electricity tariff, while the DG is a backup power source to
the HPWH. The objective function of the model is to minimize energy and fuel cost while maximizing PV energy trade-off for incentives.
The TOU is an important control parameter in this model. The power flows from each power source are the control variables. The optimal
control shows a great potential to realize a practical net zero-energy building and demand side management. This model meets both
the technical and operational constraints. A case study is done based on a 3 16 kW HPWH installed at a Pretoria Hotel in South
Africa. Simulations run over a year on selected seasonal dates using the actual measured demand of the HPWH. The optimal control
problem is solved using a mixed integer non-linear program and the results show how TOU affects the power dispatch to the
HPWH. The energy and cost savings are presented in this paper.