Cooperative Energy Management of HVAC via Transactive Energy
Abstract
Heating, Ventilation, and Air Conditioning (HVAC) energy consumption accounts for a significant part of the total energy consumption of buildings and households. The ubiquitous adoption of distributed renewable energy and smart meters helps to decarbonize the HVAC energy consumption and improve energy efficiency. However, how to scale up HVAC energy management for a group of users while persevering users’ privacy remains a big challenge. In this work, we utilize the concept of transactive energy to build a cooperative energy management system for independent HVAC units in a distributed manner. Specifically, we develop a distributed energy trading algorithm that consists of two layers based on the alternating direction method of multipliers method. The distributed energy trading algorithm achieves optimal trading performance and also preserves users’ privacy. Furthermore, we evaluate the performance of the distributed trading algorithm by extensive simulations with real-world data. Simulation results show that the energy trading algorithm converges fast and the cooperative energy platform reduces the user’s individual cost by up to 50% and lowers the overall cost of all users by 23%.
I INTRODUCTION
Heating ventilation and air conditioning (HVAC) is an indispensable component of modern buildings; however, HVAC energy use accounts for a significant portion of energy consumption in buildings and households [1]. Recent research interests have been focusing on how to decarbonize the HVAC energy consumption. The ubiquitous deployment of smart meters and renewable energy generators enables us to develop energy management systems for HVAC units powered by a high penetration of renewable energy. As an essential part of the smart city, residential users (e.g., smart homes) [2] are expected to manage their energy consumption to improve the energy efficiency of appliances (and the HVAC in particular). This paper aims to study the following key problem: can residential users further reduce their HVAC expenses by merely utilizing the existing grid and renewable energy? To this end, transactive energy emerges as a prospective solution [3] in both smart grid academia and industry.
In smart homes, the energy management system schedules the energy usage of appliances including HVAC to reduce energy costs yet keeps the indoor comfortable [4]. To further improve the energy efficiency, users are encouraged to cooperate in the energy management of their renewable supply, HVAC, and other load. By enabling users to share surplus energy and cooperatively schedule their energy usage, cooperative energy management can effectively reduce the individual user’s cost and enhances the efficiency of the system. However, the following challenges must be addressed before a cooperative energy management system that involves multiple users in a community. First, the cooperative energy management system should improve the system efficiency while incentivizing the users to join the trading by providing them enough benefit. Second, privacy-preserving is critical for cooperative energy management since users’ power usage information can be exploited by malicious parties for their own interests.
Recently, many research works on HVAC energy management have been published to address the above challenges. A data-driven modeling method for HVAC was proposed in [5] to achieve the optimal HVAC energy scheduling. In [6], the authors suggested a robust evolutionary algorithm to optimize the power consumption of centralized HVAC. In [7], the authors investigated the solar-assisted HVAC model and proposed a stochastic optimization method to reduce energy consumption. However, references [5, 6, 7] only studied standalone energy management of HVAC in a single house. A cooperative energy management that involves multiple households was studied in [8], in which the authors employed a mixed-integer linear programming method but assumed a fully centralized model that causes privacy concerns. Reference [9] reports the vulnerability of users’ privacy in transactive energy, and [10] presented a method to exploit privacy information from users’ smart meter data. The trade-off between users’ privacy and the performance of HVAC energy management is modeled and analyzed in [11], and the authors suggested a noise injection method to enhance privacy.
In this paper, we designed a cooperative energy management system for HVAC with a novel distributed P2P (peer-to-peer) energy trading algorithm to address the challenges as mentioned earlier. The main contributions of this work are as follows.
-
1.
We develop an efficient and trustable cooperative energy management platform for HVAC based on transactive energy. The developed platform enables energy trading among users and handles the supply/demand matching while preserving users’ privacy.
-
2.
We design a P2P energy trading algorithm that improves the system efficiency and minimizes users’ HVAC costs. The proposed energy trading algorithm enables participated users to interact in a distributed manner to gain benefits from trading, and also does not require users to reveal private parameters.
-
3.
We evaluate the distributed P2P energy trading algorithm with extensive simulation using real-world data. To test the feasibility of the energy trading algorithm in practice, we validate the trading platform and algorithm using realistic renewable and load data. The results show that the system cost is reduced by 23% and the users’ costs are reduced by up to 50%.
The rest of the paper is organized as follows. Section II introduces the HVAC energy management model on the transactive energy platform. Section III formulates an optimization problem for the cooperative energy system. Section IV elaborates on the design of the distributed P2P energy trading algorithm for HVAC. Section V evaluates the proposed P2P energy trading system with extensive simulations and Section VI concludes our work.
II SYSTEM MODEL
We consider multiple houses interconnected via the power grid, as shown in Fig. 1. We denote the users in this energy management model by the set . The system can be split into two layers: 1) the internal energy scheduling layer, in which each user schedules the energy use for the HVAC; and 2) the external energy trading layer facilities energy exchange among users to further utilize local renewables and reduce operational costs. Exchanging surplus energy with other users is encouraged during the operation of the energy management system. The residential users have diverse preferences for their household energy usage including HAVC (e.g., target temperature); therefore the users may benefit each other by trading energy in a peer-to-peer manner. The system model of the user’s smart house is described in Fig. 1.

II-A Internal Energy Scheduling Layer
Each residential user is equipped with renewable generation (e.g., solar panel and wind turbine), HVAC, and other appliances as shown in Fig. 1. The model of the smart house has two parts. The first part is the supply model that includes the electricity from both the grid and local renewable energy; the second part is the load model that consists of HVAC and other appliances. Let denotes the operational horizon of the system. The load model of user describes the energy consumption of the user’s HVAC and other appliances. Specifically, we denote the amount of energy that user purchases from the grid by , and denote the renewable energy by in time slot . Therefore, the energy supply terms and should satisfy the following constraints:
(1) | ||||
(2) |
where and are non-negative and upper-bounded by the available renewable generation and power capacity from the grid per time slot, respectively.
To model the realistic system, we adopt the two-part tariff billing for the electricity purchased from the grid. Hence, user ’s grid cost is
(3) |
where and denote the unit energy price and peak load price, respectively. The grid cost consists of an energy charge and a peak charge . The peak charge is introduced to shave the peak load of the grid by penalizing the user’s peak load.
The load model includes the HVAC load and other inflexible loads such as the refrigerator and lighting. We let denote the inflexible load, which includes the power consumption of house appliances other than HVAC in time slot . The HVAC system works to adjust the indoor temperature according to user ’s preference. In time slot , the energy consumption of the heating or cooling process incurred by the HVAC system is denoted by . We denote the outdoor temperature as , then the dynamics of the indoor temperature [12] is modeled as
(4) | ||||
where and denote the working parameters of the HVAC unit (and we let and in our simulations). The working mode of the HVAC is represented by the sign of : is positive if the system is cooling, and negative if the system is heating. Through this work, we omit the installation cost and depreciation of all the appliances in the model since our focus is energy management.
Usually, user sets a preferred indoor temperature for the HVAC system; thus any deviation from this value will discomfort the user. The discomfort of user can be modeled by the cost function below
(5) |
where denotes that sensitivity coefficient.
Note that the indoor temperature should also be within a range that human can tolerate, thus we have
(6) |
where the parameters and define the upper- and lower-bounds of user ’s tolerable temperature.
II-B External Energy Trading Layer
Besides scheduling their internal energy, users can also exchange energy externally with each other via the cooperative energy management system. Because users have diverse HVAC use profiles and different renewable energy generations, they can exploit the diversities of supply and load profiles for mutual benefits by transactive energy.
In the cooperative energy management system shown in Fig.1, user can trade with user to exchange energy. The cooperative energy management platform provides a free and open marketplace for users to trade energy and allow participated users to earn profit. Let denotes the amount of electricity traded between user and user in time slot . Note that a positive indicates that user purchases energy from user , and negative indicates user sells energy to user .
Without loss of generality, we omit the electricity loss during the power transfer over the grid, since the users are closely located to each other. To balance the load and supply over the grid, the following constraint applied for all the energy trading pairs:
(7) |
which clears the energy-trading amount between each trading pair of users and in time slot .
III PROBLEM FORMULATION
In this section, we consider the HVAC energy management scenarios without and with energy trading among users. Specifically, in the non-cooperative scenario, all the users optimize their own energy scheduling independently without interacting with other users. In the cooperative scenario, users exchange energy with other users to purchase energy when in a deficit of local supply or sell extra energy to make profits.
III-A Non-cooperative Scenario
In the non-cooperative energy management scenario, the residential users schedule their energy usages individually. Specifically, users schedule their energy supply and energy consumption to minimize the operating costs. User uses the local renewable supply and also purchases from the grid to serve the demand, consisting of HVAC load and the inflexible load . To shorten the notation, we redefine the following variables as , , , and .
During the energy management process, user ’s power supply and demand must be equal in each time slot, which leads to the constraint
(8) |
The left-hand side of (8) represents the total energy supply, and the right-hand side of (8) denotes the total demand from the HVAC load and the inflexible load .
For the non-cooperative energy management, the overall operating cost of user is
(9) |
where denotes the electricity bill from the grid, and denotes the the user’s discomfort cost of HVAC.
The energy management system aims to minimize users’ total cost in (9). Therefore, for a specific user , the energy management problem can be formulated as
EMPi: User ’s Energy Management Problem.
subject to | |||||
variables: |
Based on our analysis, user can locally solve the optimization problem in EMPi since it is a standard convex optimization. We denote the optimal total cost in problem EMPi by and let this value serve as a benchmark cost for the comparison with the costs in the cooperative scenario.
III-B Cooperative Scenario
Unlike the non-cooperative scenario, users not only schedule their internal energy supply and demand but also exchange energy externally with other users when needed in the cooperative scenario. Users with surplus renewable energy can sell their energy to other users via the grid; also, users can purchase energy from their neighbors other than the grid to lower the total costs. Taken the energy trading into account, the load balance constraint becomes
(10) |
where the summation is the total energy traded between user and all other users in time slot .
We assume that the operator of the energy management system does not charge any fees to the users. Therefore, users who purchase energy will pay their counterparts at a time-dependent unit price set by the trading platform. Therefore, user ’s cost during the energy trading process is
(11) |
where is the short notation for .
In the cooperative energy management system, the system overall cost consists of user’s individual operating cost and the trading cost . Therefore, we formulate the cooperative energy management problem CEMP for the platform as follows.
CEMP: Cooperative Energy Management Problem
subject to | |||||
variables: |
We see that Problem CEMP jointly solves the optimal internal energy scheduling (of renewable and HVAC load) and the optimal external energy trading for all the users. However, solving CEMP in a centralized manner may cause severe privacy concerns because the users have to reveal all their parameters to the platform. To preserve users’ privacy and enable cooperative energy management, we aim to solve Problem CEMP in a distributed manner in Section IV.
IV ALGORITHM DESIGN
Distributed solutions have been developed in microgrid energy management [3], data center demand response [13], and electric vehicles [14]. In our work, though users are willing to trade energy for benefits, they have the concern of sharing their private data and system parameters with others. Motivated by the need for privacy-preserving, we design a distributed trading algorithm to solve Problem CEMP. In the distributed algorithm, the users optimize their internal energy scheduling of renewable and HVAC load and communicate with others to determine the external energy trading. Therefore, users do not share their private data in the energy-trading process.
First, we employ the alternating direction method of multipliers (ADMM) method [15] to solve Problem CEMP, as ADMM has a good convergence for convex optimization problems with non-strictly convex objective functions. Here, we introduce the auxiliary variables for energy trading decisions of user , and thus rewrite constraint (7) to its equivalent constraints
(12) | |||
(13) |
To solve Problem CEMP, we decompose it into a lower-level problem and an higher-level problem. To facilitate the decomposition, we introduce dual variables where for constraints (12). We then obtain the augmented Lagrangian for Problem CEMP as
where is a coefficient for the quadratic penalty of constraint (12).
Next, we split the optimization of CEMP into a lower-level problem and an higher-level problem. In the lower-level problem, users minimize their own operating costs in parallel when the dual variables and auxiliary variables are given. The higher-level problem updates the auxiliary variables and dual variables based on the trading decisions submitted by users . The trading algorithm iterates between the lower-level problem and the higher-level problem until it converges to the optimal solution.
Specifically, in the lower-level problem, given the dual variables and auxiliary variables , user solves the following optimization problem:
LLP1i: Lower-level problem of CEMP.
subject to | |||||
variables: |
By solving LLP1, user obtains the energy trading decision and sends to the higher-level problem for the iteration.
The higher-level problem solves the dual variables and auxiliary variables for all users . The higher-level problem of CEMP is formulated as follows:
HLP1: higher-level problem of CEMP
subject to | (13) | ||||
variables: |
and solving HLP1 yields the optimal auxiliary variables
(14) |
and the update rule for the dual variables as
(15) |
We present the distributed transactive energy algorithm in Algorithm 1. Specifically, the algorithm solves the higher-level and lower-level problems for Problem CEMP in an iterative fashion. Each user determines the internal energy scheduling and external energy trading in Problem LLP1i without sharing any private data. Instead, each user only needs to report its trading demand to the higher-level problem. The higher-level problem receives all the users’ trading decisions to update the auxiliary and dual variables in (14) and (15). Then the higher-level problem broadcasts the updated information to all the users. According to [15], our developed distributed algorithm (i.e., representing the higher-level and lower-level problems) converges to the optimal solution of Problem CEMP when we choose the stepsize , in which denotes the number of iteration.

V SIMULATION RESULTS
In this section, we evaluate the cooperative HAVC energy management platform by extensive numerical simulations with real data of renewable generation [16] and load [17]. The simulation data include users’ daily electricity usage, renewable energy generation (e.g., rooftop solar panels and wind turbines), and outdoor temperature during September 6-12, 2016. To validate the energy trading algorithm developed in Section IV, we simulate a group of 10 users and each user has a HVAC unit and local renewable generation.
V-1 Algorithm Convergence
We firstly evaluate the performance of the distributed optimization algorithm in Section IV with 10 users. The convergence error of the distributed trading algorithms is defined as the sum of the absolute deviation between the actual trading decisions (i.e., ) and auxiliary decisions (i.e., ) as in Algorithm 1. We set the threshold for the convergence error to be . We plot the error with respect to the number of iterations in Fig. 3, and we see that Algorithm 1 converges at iteration 26. The result show that the proposed distributed trading algorithm converges fast in practice with real-world data, which is of practical importance.

V-2 Power Scheduling in Energy Trading Scenario
Secondly, we show the optimized hourly day-ahead energy scheduling of 10 users over one week in Fig. 2 in the cooperative scenario. The decisions of users include, as shown in Fig. 2, (a) renewable energy supply, (b) the power purchased from the grid, and (c) the HVAC energy consumption of users. We see in Fig. 2 (a) that users try to utilize their renewable energy generations despite the different capacities and generations of solar energy and wind energy. In Fig. 2 (b), the power purchased from the grid shows a complementary pattern with the renewable power supply, as the users try to reduce the dependence on the grid and thus reduce their costs. As depicted in Fig. 2 (c), the scheduled HVAC load varies with the temperature change to keep the indoor temperature within the comfort zones.


V-3 Energy Trading Performance
We plot the hourly energy trading decisions of all the 10 users over one week in Fig. 4 (a). We see active energy trading among users throughout the whole week, in which positive values denote energy purchase, and negative values denote energy selling. Furthermore, we take user #3 and user #6 as an example to show the different trading patterns of different types of users in Fig. 4 (b) and (c). User #3 is energy self-sustained and thus sells a lot of energy to other users including user #6. By contrast, user #6 is in short of local energy in the daytime and thus often purchases energy from other users. It is demonstrated that our cooperative energy management platform provides an effective platform for users to interact and trade energy for mutual benefits. We compare the gird-purchased power of user #3 and user #6 as an example to show the effects of energy trading. As shown in Fig. 5, both the users’ grid power consumption, particularly the peak power consumption, is effectively reduced in the cooperative scenario compared with that of the non-cooperative scenario.

V-4 Energy Cost Reduction
To evaluate the benefits for users to join the cooperative energy management platform, we compare each user’s cost with and without energy trading. As depicted in Fig. 6, the orange bars indicate the costs of all users if they manage their power usage via Problem EMP in the non-cooperative scenario. The purple bars indicate the users’ costs in the cooperative scenario according to Problem CEMP. Comparing the costs in both scenarios, we see that all the users reduce their costs directly with energy trading. We annotate the percentage of cost reduction between the non-cooperative and cooperative scenarios above the bars. It is shown that all users’ costs are reduced, and the reduction rates range from 15% to 50%, and the total cost of the system including all the users is reduced by 23%.
VI CONCLUSION AND FUTURE WORK
This paper presented a cooperative energy management platform that enables residential users to trade energy with each other to improve the efficiency of their HVAC energy management. We designed a distributed energy trading algorithm that well preserves users’ privacy and encourages users to trade energy to reduce energy costs. We evaluated the distributed energy trading algorithm by extensive simulations using realistic data trace. Simulation results showed that the trading algorithm reduced the costs for all the users ranging from 15% up to 50%, and reduced the system cost (defined as the overall cost of all the users) by 23%. During the research of this work, we found that the proposed distributed trading algorithm well matches the structure of blockchain. In our future, we will explore to integrate blockchain technology with cooperative energy management.
References
- [1] “Annual energy outlook 2016 with projections to 2040,” Technical Report, US Energy Information Administration, 2016.
- [2] W. Tushar, B. Chai et al., “Three-party energy management with distributed energy resources in smart grid,” vol. 62, no. 4, pp. 2487–2498, 2014.
- [3] H. Wang and J. Huang, “Incentivizing energy trading for interconnected microgrids,” IEEE Transactions on Smart Grid, vol. 9, no. 4, pp. 2647–2657, 2018.
- [4] M. Fukuta, K. Matsui, M. Ito, and H. Nishi, “Proposal for home energy management system to survey individual thermal comfort range for hvac control with little contribution from users,” in Proc. IEEE INDIN ’15, Cambridge, UK, July 2015, pp. 658–663.
- [5] A. Kusiak, M. Li, and F. Tang, “Modeling and optimization of hvac energy consumption,” Elsevier Appl. Energy, vol. 87, no. 10, pp. 3092–3102, 2010.
- [6] K. F. Fong, V. I. Hanby, and T.-T. Chow, “System optimization for hvac energy management using the robust evolutionary algorithm,” Elsevier Appl. Therm. Eng., vol. 29, no. 11-12, pp. 2327–2334, 2009.
- [7] H. T. Nguyen, D. T. Nguyen, and L. B. Le, “Energy management for households with solar assisted thermal load considering renewable energy and price uncertainty,” IEEE Trans. Smart Grid, vol. 6, no. 1, pp. 301–314, 2014.
- [8] A. C. Luna et al., “Cooperative energy management for a cluster of households prosumers,” IEEE Trans. Consum. Electron., vol. 62, no. 3, pp. 235–242, 2016.
- [9] J. Lian et al., “Transactive system, part I: Theoretical underpinnings of payoff functions, control decisions, information privacy, and solution concepts,” Pacific Northwest National Laboratory, Tech. Rep. PNNL-27235, December 2017. [Online]. Available: https://www.pnnl.gov/main/publications/external/technical_reports/PNNL-27235Part1.pdf
- [10] G. Eibl and D. Engel, “Influence of data granularity on smart meter privacy,” IEEE Trans. Smart Grid, vol. 6, no. 2, pp. 930–939, 2014.
- [11] R. Jia, R. Dong et al., “Privacy-enhanced architecture for occupancy-based hvac control,” in Proc. ACM/IEEE ICCPS ’17. Pittsburgh, PA, USA: IEEE, April 2017, pp. 177–186.
- [12] S. Cui, Y.-W. Wang, and J.-W. Xiao, “Peer-to-peer energy sharing among smart energy buildings by distributed transaction,” IEEE Trans. Smart Grid, vol. 10, no. 6, pp. 6491–6501, 2019.
- [13] H. Wang and Z. Ye, “Renewable energy-aware demand response for distributed data centers in smart grid,” in 2016 IEEE Green Energy and Systems Conference (IGSEC). IEEE, 2016, pp. 1–8.
- [14] J. Rivera, C. Goebel, and H.-A. Jacobsen, “Distributed convex optimization for electric vehicle aggregators,” IEEE Transactions on Smart Grid, vol. 8, no. 4, pp. 1852–1863, 2016.
- [15] S. Boyd et al., “Distributed optimization and statistical learning via the alternating direction method of multipliers,” Found. Trends Mach. Learn., vol. 3, no. 1, pp. 1–122, 2011.
- [16] H. Wang, “Microgrid generation planning considering renewable energy target,” in 2016 IEEE International Conference on Power and Energy (PECon). IEEE, 2016, pp. 356–360.
- [17] Energy Research, Website, Pecan Street Inc., accessed on 1 Oct. 2019. [Online]. Available: https://www.pecanstreet.org/dataport/