Energy shortage is a challenge for many countries, and building energy consumption accounts for a considerable proportion of global energy consumption. The main work of this paper is to optimize the energy consumption of heating, ventilating, and air conditioning (HVAC) systems in buildings based on economic model predictive control (EMPC). The cost in EMPC design includes energy consumption and predicted mean vote (PMV), which is an index that evaluates the thermal comfort of indoor occupants. In order to model the nonlinearity of the PMV index, we propose a lattice piecewise linear (PWL) approximation, which has high approximation precision and facilitates the resulting optimization problem, which is basically a piecewise quadratic programming problem. For the piecewise quadratic programming, we propose a descent algorithm that converges quickly and scales well with the length of the prediction horizon in the EMPC problem. The experimental results demonstrate that the proposed method saves 19.78% of the electricity cost compared to the conventional control strategy and significantly increases indoor comfort. <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">Note to Practitioners</i> — The motivation of this article is to provide a control strategy to reduce building energy consumption and ensure indoor thermal comfort. In most of the existing methods for air conditioning temperature control, the occupants’ comfort hasn’t been considered. In this paper, thermal comfort is described by the PMV index, which is basically nonlinear. In order to model the thermal comfort more accurately, in this paper, the PMV index is approximated piecewise linearly in order to meet the requirements of accuracy and computational efficiency. The resulting optimization problem is not hard to solve, and we provide an efficient algorithm for solving this optimization problem. Preliminary simulation experiments demonstrate that this approach is practical, i.e., it achieves energy reduction and ensures thermal comfort. Our strategy, however, has not yet been deployed in real buildings. In future research, we will propose similar techniques for large-scale systems in order to solve energy optimization problems containing multiple thermal zones and realize the proposed technique in real buildings.