In this paper, a novel mathematical optimization model for the optimal load scheduling in smart buildings is presented. The proposed building energy management system uses the optimization model to make a quick and optimal load scheduling. Analysis of the results shows the stability of the propose model when solving the problem in residential smart buildings. Minimization of the use of the grid's power was achieved, which also led to a reduction in the electricity bill up to 26% for one specific user. Demand peaks were avoided and the demand curve was flattered at the end of the scheduling process. Moreover, the propose optimization model considers a fair payment constraint of the electrical bill for all users.