Automatic optimal multi-energy management of smart homes

Residential and commercial buildings are responsible for approximately 35% of carbon emissions in industrialized countries. Making buildings more efficient and sustainable is, therefore, a fundamental step toward a low-carbon energy society. A key to achiev-ing sustainability is by leveraging on energy storage systems and smart technologies to switch between energy carriers in order to optimize environmental impact. However, the research on energy management in buildings has mostly focused on its economic aspect, overlooking the environmental dimension. Additionally, the concept of energy system flexibility has been mostly proposed as the ability to shift demand over time or, at most, to curtail it, aiming at reducing the system’s operating costs. We propose a multi-energy multi-objective scheduling model to optimally manage the supply, demand, and interchange of multiple energy carriers, based on dynamic price and carbon emission signals. Our holistic and integrated approach is applied to a group of 200 smart homes with varying thermal and electric loads, and equipped with different types of smart technologies. The effectiveness of the approach in reducing the home carbon footprint, while remunerating the users, is evaluated using historical and statistical data of three European countries


Introduction
"Create technologies and services for smart homes that provide smart solutions to energy consumers" is one of the ten strategic actions identified in 2015 by the European Commission to accelerate the transformation of the entire energy system (European Commission 2015). In fact, this is crucial as residential buildings are responsible for 22% of regulated energy consumption and 17% of CO 2 emissions (UN Environment and International Energy Agency 2017). Smart homes can be major players towards a more efficient and sustainable energy future. At the same time doing so is not straightforward. Smart homes produce a vast amount of raw and heterogeneous data; they have many operation possibilities and control choices that can be performed; and they should operate to satisfy residents' safety and needs. Smart homes are not easy to be manually controlled by the average user and, even more complex is the task of optimal control, even for simple daily tasks . Fiorini and Aiello Energy Informatics (2022) 5:68 To support the design and usability of smart homes we propose a multi-energy multiobjective scheduling model to optimally manage the supply and demand of multiple energy carriers, taking into account both dynamic prices and CO 2 -emission intensity (CO 2 -EI). Our holistic and integrated approach considers the interdependencies in energy generation and consumption of devices, promoting not only load shifting over time, but also energy shifting between energy carriers, with the aim of minimizing energy costs and/or carbon emissions, while satisfying users' comfort preferences. The main research question we address is: To what extent and under which conditions can the integration of multiple energy carriers and technologies in smart buildings contribute to reduce their environmental footprint, while remunerating the building users? To answer this question, we model a group of 200 smart homes realistically by considering, depending on size and the season, them having up to five appliances and varying thermal and electric loads.
We focus on how the coordinated management of multiple technologies and energy carriers can reduce the environmental impact in terms of CO 2 emissions, while facilitating monetary and energy savings. To this end, we propose a model of the smart home as a multi-energy system equipped with several smart home technologies for production, transformation, storage, and consumption of energy, which are coordinated by a home energy management system (HEMS) according to dynamic prices and CO 2 -EI signals coming from the power grid. Such smart homes are configured as multi-energy systems, which supply electric and thermal loads by means of multiple technologies, namely a gas-fired system boiler (SB), a gas-fired combined heat and power (CHP) system, solar photovoltaic panels (PVs), an electric heat pump (EHP), and an immersion heater (IH). The role of electric storage systems in the form of a static home energy storage (HES) or a plug-in electric vehicle (PEV) is investigated as well. The optimization problem to be solved by the HEMS is subject to several uncertainties, due to errors in forecasting prices, emission factors, weather conditions, and electricity and hot water demand. The HEMS we propose employs a rolling horizon to adjust the optimal scheduling based on new available information.
This work contributes to the field of smart grids and energy informatics by laying the foundation for future smart home automation systems that can effectively contribute towards decarbonization. The proposed multi-energy management encourages the coupling of energy carriers and services, thus further enhancing the flexibility of demand. At the same time, by following a combination of dynamic prices and CO 2 -EI signals, the proposed system finds a trade-off between economic and environmental objects, thus enabling cost savings, while improving the sustainability of the home environment. This work is a major extension of the conference publications (Fiorini and Aiello 2019b) and . Namely, the preliminary model presented in Fiorini and Aiello (2019b) has been extended in  to include PV panels and an uncontrolled electric load. Additionally, the HEMS proposed in Fiorini and Aiello (2020) relies on marginal CO 2 -EI signals instead of the average CO 2 -EI of the generation mix used in Fiorini and Aiello (2019b). The current work further expands upon the smart home model by adding a micro-combined heat and power ( µ-CHP) system and an additional storage device in the form of PEV. Moreover, the economic model accounts for the self-consumption and feed-in of renewable energy, according to incentive schemes of three European countries. Finally, the current results are based on a full one-year simulation and not just four representative days, as it was the case in the conference papers, hence offering more insights on the effectiveness of the proposed approach.
The remainder of the paper is organized as follows. "Related work" section discusses the related work; "Smart home model" section presents the multi-energy smart home model; "Multi-energy multi-objective operation scheduling" section formulates the multi-objective problem that the HEMS aims at solving; "System implementation and simulation setup" section describes the implementation of the proposed approach and details the simulation setup. Results are presented and discussed in "Discussion of the results" section, followed by conclusions in "Conclusions" section

Related work
Buildings are responsible for more than one third the energy consumption and CO 2 emissions in most industrialized countries. In spite of several studies on the economy of energy management in buildings, the environmental aspect has most often been overlooked (Etedadi Aliabadi et al. 2021). The most common approach is to formulate the energy management problem as a single economic objective function to be optimized within a defined time horizon (Fiorini and Aiello 2019a). Minimizing the system operating costs (Good and Mancarella 2017;Neyestani et al. 2015;Salpakari and Lund 2016) or the consumer's energy bills (Mohsenzadeh and Pang 2018;Sheikhi et al. 2016) are the most common goals of the optimal scheduling of energy resources.
A few studies consider the environmental impact of energy consumption (Fiorini and Aiello 2019a). In these cases, the equivalent cost of pollutants is accounted for in the main economic goal (Setlhaolo et al. 2017) or their amount in tons constitutes an alternative or additional objective function of the optimization problem (Fiorini and Aiello 2018;Brahman et al. 2015;Tabar et al. 2017;Imran et al. 2020). The emissions tied to the energy consumption is commonly assessed using the average CO 2 -EI of the generation mix, either defined as a constant (Chen et al. 2022;Setlhaolo et al. 2017;Imran et al. 2020;Tabar et al. 2017;Brahman et al. 2015) or as a hourly value (Fiorini andAiello 2018, 2019b). However, the generation output of the power plants composing the generation mix does not adjust evenly to a load variation owning to multiple technical and economic factors. The power plant that reacts to a change in the electricity demand is referred to as marginal; it may correspond to a single power plant, to a group of them, or to a cross-boarder flow (Graff Zivin et al. 2014). The environmental impact of a change in the electricity demand is, therefore, tied to the emission factor of the marginal power plant that increases or decreases its generation, which may vary from hour to hour. The marginal CO 2 -EI is estimated using the marginal power plant method (Graff Zivin et al. 2014), and its use is recommended when investigating the optimal operation of a building (Graabak et al. 2014;Andresen et al. 2017). Yet, very few related work assess the emissions tied to the use of electricity imported from the main grid by means of its marginal CO 2 -EI .
The coordinated management of multiple energy carriers, usually electricity and hot water, has shown potential economic and environmental benefits (Fiorini and Aiello 2019a). The energy carriers coupling is usually sought at the level of the energy generation, often by means of combined heat and power systems, aiming at reducing the import of electricity from the main grid and increasing the flexibility of electricity demand. Yet, a more holistic approach allows for the shifting of energy carriers at all levels. Storage and energy transformation units enable a more dynamic and flexible use of multiple energy carriers, while delivering the same service (Neyestani et al. 2015). Hybrid appliances and hybrid heating systems can support the increasingly complex task of coordination of demand and supply, thanks to their ability to adapt their operation to the energy supply by shifting between energy carriers (Mauser et al. 2016;Stamminger 2008). Other energy carriers, such as hydrogen (Pan et al. 2020), and fuel conversion technologies, such as electrolyzers and methanation (Mehrjerdi et al. 2021), are not included in the proposed smart home model because they are in a pre-commercial, pilot stage for the building environment (Rongé and François 2021). "Hydrogen-ready" boilers could be easily integrated into the proposed model, as they are connected to the same natural gas infrastructure and, hence, would not require a different modeling approach. As for boilers running on 100% hydrogen, they are still in a prototype phase (British Gas 2022).
With respect to the state of the art just overviewed, the present work attempts to fill the following gaps. First, we propose a multi-objective energy management that optimizes, following user's preferences, both system costs and carbon emissions based on dynamic price and marginal CO 2 -EI signals. Second, the homes are modeled as energy system where multiple energy carriers are coupled and can be used interchangeably thanks to the automatic coordination of several smart technologies for production, transformation, storage, and consumption of both electric and thermal energy. Such solutions can be deployed to fully support user needs automatically, without direct user intervention.

Smart home model
The smart home model we propose is illustrated in Fig. 1. According to the classification we defined in Fiorini and Aiello (2019a), PV, SB, and µ-CHP are generation resources; HES, PEV, and thermal store (TS) are storage systems, whereas electric heat pump (EHP) and immersion heater (IH) are transformation resources. The smart home is connected to both the electricity and gas distribution grids. The hybrid heating system is composed of four main units: the SB and the µ-CHP contribute to the supply of hot water to the TS for both space heating and domestic hot water (DHW) demand; the IH installed into the TS contributes to the heating of DHW, whereas the air-to-air EHP is used for space heating and cooling. Electricity is imported from the distribution grid, or locally generated via the PV system and the µ-CHP. Both the HES and the PEV are charged and discharged depending on the house needs. When the smart house features hybrid appliances, they draw hot water from the TS and gas from the distribution grid. The operation of all technologies and controllable loads are coordinated by a HEMS, while optimizing a goal set by the user.
The HEMS generates schedules based on information on future electricity prices, electricity CO 2 intensity, weather conditions, PV generation, and electric and thermal load. In practical application, the HEMS receives the electricity price and CO 2 -intensity signals from the utility, whereas forecasts of weather conditions and PV generation may be provided by an external service, such as the web based Solecast (SOLCAST 2020).
Information on electric and thermal load demand is provided by a load forecasting service based on historical smart meter readings and preferences for indoor conditions and starting time of appliances are set by the user. Based on this information and knowing the current state of the system, the HEMS finds the expected optimal schedule for the resources of the smart home and issues commands to all controllable devices via smart plugs. Designing the HEMS from a software engineering perspective is beyond of the scope of the present work; we refer to our proposal in Georgievski et al. (2020) and Aiello et al. (2021) for a service-oriented energy management system (EMS) for microgrids and general smart energy systems software architectures, respectively.
In this work, we assume that the required information is provided by external services. To tackle information uncertainty, the responsible services regularly provide new, updated information for the hours to come and the HEMS adjusts the optimal schedules accordingly. The scheduling problem is formulated as a discrete-time mixed-integer linear programming (MILP) problem employing a rolling horizon approach, which iteratively finds an optimal schedule over finite overlapping prediction horizon.

Multi-energy multi-objective operation scheduling
The majority of the users care about their energy bills and is keen on reducing them; some of them may also care about the environmental impact of their energy consumption. The HEMS is responsible for the optimal operation of the system, while preserving user's satisfaction and fulfilling environmental and/or economic objectives. The HEMS schedules the supply and demand of multiple energy carriers, namely, electricity, natural gas, hot water, and hot/cold air. The aim is to provide multiple services, namely, electricity, heat, and cooling. If a PEV is present, the transportation becomes an additional service to be provided by the system, as the PEV must be charged before it leaves, while vehicle-to-home (V2H) technologies enhance the flexibility of the system via bidirectional smart charging.
Next, we formulate the multi-objective problem within the rolling horizon framework. For the description and the model of the individual elements of the smart home we refer to Fiorini (2021).

Multi-objective problem
We define a multi-objective problem that consider both the environmental and the economic goals. The environmental objective function accounts for the CO 2 -equivalent emissions due to the consumption of electricity and gas, local solar power generation, and use of electric storage units as follows: where [t 0 , t end ] is the optimization interval; P e,t and P g,t (kW) are the electricity and gas imported from the distribution grids at t, respectively; P PV,t is the PV output at t; EF e,t , EF g , and EF PV are the CO 2 -equivalent emission factor of imported electricity, gas, and electricity locally generated with PV, respectively. EF HES and EF PEV take into account the emissions during the production and construction phase of a HES and a PEV, respectively. We assume that EF e,t varies hourly, while EF g , EF PV , EF HES , and EF PEV are constant.
The economic objective function calculates the operating and maintenance costs of the household, which include the operating cost for buying electricity and gas from the distribution grids, the revenues from consuming and selling self-generated electricity, the maintenance costs of the major units, and the degradation costs of PEV and HES. It is formulated as follows: where: where FIT PV and FIT CHP are the feed-in tariffs for selling the excess of self-generated electricity; SC PV and SC CHP are the compensations for self-consumption of electricity generated via PV ( P SELF PV,t ) and µ-CHP ( P SELF CHP,t ); p e,t and p g are the electricity and gas price, respectively. We assume that the electricity price varies hourly, while the gas (1) (2) price is constant. These are common assumptions when modeling services for the Smart Grid (Fiorini and Aiello 2019a;Pagani and Aiello 2015).
Maintenance and degradation costs are calculated as: where γ m x and γ d x are the maintenance and degradation cost of the resource x, respectively, and Z x,t is the (thermal) power generated by resource x.
We define a multi-objective problem that takes both the environmental and the economic goal into account, and it is formulated as a weighted sum: where w is a weight factor that varies with the user preferences; and c is a scaling factor such that c · ENV and ECO have the same unit. The scaling factor c is calculated as the ratio of the costs obtained by minimizing the emissions to the emissions obtained by minimizing the costs.
Additional constraints define the dynamics of import and export between the smart home and the distribution grids. It is not possible to import from and export to the electricity distribution grid at the same time. Moreover, the imported power is limited in order to take grid's technical characteristics into account. The maximum power that can be imported may be determined either by the type of connection available, as in The Netherlands (ENEXIS Netbeheer 2020), or by contract, as in France (Selectra 2020).

Rolling horizon
The optimization problem defined in the previous section is subject to several uncertainties due to changes in weather conditions, PV production, electricity emission factor and prices, and uncertainty in the users' demand. A real HEMS would adjust the load schedule and the operating point of controllable units as new information becomes available. Our MILP model is formulated and solved at discrete time steps of 15 min and it employs a rolling horizon approach, which iteratively finds an optimal schedule over finite overlapping prediction horizon. Only the actions for the next time step are implemented, and the process is then repeated for the following prediction horizon considering new information.
The main limitation of our approach lies in the underlying assumption that, between two consecutive time steps, the system and all exogenous factors follow the predicted values. In a real system, this may not be the case: in fact, the real-time energy consumption is affected by the unpredictability of the user behavior and final energy prices are set after the physical delivery of the energy. Therefore, the actual state of the system at the beginning of a new optimization run may deviate from the state predicted by the HEMS. In a real system, smart meters, smart plugs, and smart sensors would track the real-time state of all connected loads, of the main ambient parameters, and of the grid signals and communicate them to the HEMS, which, in turn, would adjust the future operation of all devices accordingly. The more frequently the HEMS receives updated information, the lower the impact of unexpected deviation on the future operation of the system.

Rolling horizon parameters
The optimization problem is modeled using time steps of 15 min, and it covers an entire year. The prediction horizon is set to 6 h, i.e., 24 time steps. Only the actions for the first time step are executed before repeating the optimization for the new period. Consequently the simulation of one year corresponds to 35,040 iterations.

Implementation
The MILP model and the rolling horizon framework are implemented using Python 3.7.2 and solved with the GUROBI optimizer (Gurobi Optimization LLC 2020). Smart homes are totally independent from each other, hence, they may be simulated in parallel. The simulations were run on the Peregrine cluster of the University of Groningen, using one CPU Intel Xeon E5-2680 v3, 2.50 GHz, or one CPU Intel Xeon E5-2680 v4, 2.40 GHz, with 1 Gb of RAM. In order to solve the problem over one year, the optimization process goes through 35,040 iterations; the average runtime of one iteration is 81 ms for the French case study, 96 ms for the German one, and 131 ms for the Dutch one. The longest runtime for a single iteration is 1463 ms, while the shortest is 8 ms.

Simulation
To evaluate the proposed multi-energy management approach, we consider a group of 200 independent smart homes, each of them equipped with a HEMS. We model six types of household differentiating on the basis of available technologies, and we define three configurations of the group with varying percentage of household types. We simulate the behavior of these configurations in three scenarios with varying penetration of PV and storage systems, and we consider historical data of energy prices and electricity CO 2 -EI of three European countries, namely, Germany, France, and the Netherlands. These countries are chosen because of their diversity in the energy consumption mix and in their energy policies. Since 2010 the German energy policy, called Energiewende, has been aiming at phasing out both coal and nuclear power plants, while expanding the renewable capacity, in particular, wind and solar (Agora Energiewende 2014). The announced goal is to supply at least 80% of electricity with renewables by 2050. Yet, in 2018, about 65% of the German electricity still came from conventional sources. In France, electricity supply mostly relies on nuclear and hydro power plants, thus having a very low emission factor, while the contribution of renewables to total generation in 2018 was still below one fifth. As for The Netherlands, more than two third of the electricity comes from fossil fuel power plants. The Climate Agreement passed in 2019 has set the targets for carbon emissions to be reduced by 55% compared to 1990 and for phasing out natural gas in the building environment by 2050 (Government of the Netherlands 2021). Fiorini and Aiello Energy Informatics (2022) 5:68 Households and appliances To simulate realistically the behavior of a large group of users, we model several types of households differentiating on the basis on their electric and thermal loads, flexibility, and operation preferences. Statistical national data are used to define the following household characteristics: household size, daily use of private cars (i.e., number of trips per day, average distance per trip, and probability of using a car at a particular time of the day), historical weather data, and annual energy consumption. Ownership probabilities of the most common household appliances, their number of operation cycles per household per week, probabilities of appliance usage, and their power demand profiles are derived from the literature, i.e., Mauser et al. (2016); Stamminger (2008); Destatis (2018); Schmitz and Stamminger (2014); Energuide.be (2021). Seasonal uncontrollable load profiles are derived from the REFIT Dataset (Murray and Stankovic 2016) and adjusted based on statistical national data on yearly energy consumption and usage composition. As for the thermal load, several DHW demand profiles are derived from Roux et al. (2018) and adjusted based on statistical data on hot water consumption. The preferred daytime indoor temperature is set equal to 20 • C . During night time, the indoor temperature cannot drop below 16 °C as recommended in Wookey et al. (2014).
Commercial technologies in Table 1 are used as reference for the simulated devices; missing data are taken from the literature.

Smart home operation modes
Based on the available technologies, we define eight possible smart home configurations and order them by increasing flexibility: • Electricity-based (E): all the appliances are traditional, using only electricity as energy vector. The thermal load is supplied by the EHP and the IH installed into the TS; • Gas-based thermal (G): all the appliances are traditional. The thermal load is supplied by the SB; • Partial hybrid (P): all the appliances are traditional. The thermal load is supplied by a hybrid heating system that consists of a SB, an EHP, and an IH; • Electricity-based with hybrid appliances (EH): all the appliances are hybrid, and the house is connected to the natural gas distribution grid to supply the hybrid oven (OV) and cooker hob (HB). The thermal load is supplied by the EHP and the IH, while no SB is installed; • Gas-based thermal with hybrid appliances (GH): all the appliances are hybrid. The thermal load is supplied by the SB; • Fully hybrid (H): all the appliances are hybrid. The thermal load is supplied by a hybrid heating system; • Partial hybrid with µ-CHP (Pµ ): same as configuration P with the addition of a µ -CHP to generate electricity and supply hot water to the TS; and • Fully hybrid with µ-CHP (Hµ ): same as configuration H with the addition of a µ-CHP to generate electricity and supply hot water to the TS.
The different configurations, summarized in Table 2, promote increasing integration of energy carriers and technologies. Additionally, we define three levels of increasing user flexibility with respect to indoor and DHW temperature, and allowed delay of cooking and wet appliances. These flexibility levels are summarized in Table 3.
We define six configurations for the group of 200 smart homes with varying percentages of smart home configurations and load flexibility; summarized in Table 4. The cases are defined so as to evaluate the impact of energy services coupling and of load flexibility. Case A1 is assumed as the reference case, featuring almost no load   flexibility and the two most common smart home configurations, namely, electricity-based and gas-based thermal operation mode. Case A2 and case A3 feature low and high level of load flexibility, respectively. Case B1 includes some smart homes equipped with a hybrid heating system and some with a µ-CHP system. Case C1 is derived from case B1, assuming that 50% of all smart homes are equipped with hybrid appliances.
The current penetration level of PV and storage technologies significantly varies across European countries. In Germany, according to recent statistics, there are approximately 1.7 million of PV systems, of which 60% has a capacity smaller than 10 kWp, corresponding to about 6 GW (Fraunhofer ISE 2019). Assuming 38 million households, we estimate 2.7% of them being currently equipped with a small-scale PV system. Similarly, we estimate that approximately 7.5% of Dutch households are equipped with PV systems, and 1.3% of French ones too (CBS 2020; Connexion Journalist 2020). As for HES devices, statistics are scarce. In Germany, recent researches estimated that 200,000 residential batteries have been installed by 2020 (Enkhardt 2020). More data are available on vehicles and electric vehicles. In 2019, electric passenger cars, including hybrid electric, battery electric, and plug-in hybrid, accounted for roughly 0.9% of German passenger cars, for 3.7% of Dutch ones, and for 0.4% of French ones (European Automobile Manufacturers Association 2019).
We assume four scenarios with increasing ownership of PV and storage technologies, which we refer to as "current", "realistic future", "optimistic future", and "very optimistic future". In particular, in the current scenario we assume that 5% of smart homes are equipped with a PV system, hence becoming prosumers.
In the realistic future scenario, 15% of smart homes are prosumers and one third of them are equipped with a storage device. In the optimistic future scenario, 50% of smart homes are prosumers and half of them are equipped with a storage device. In the very optimistic future scenarios, 50% of smart homes are prosumers, and all of them are equipped with a storage device Considering two storage technologies, we define six simulation scenarios; summarized in Table 5. An accurate prediction of the deployment of such technologies is beyond the scope of this study.

Emission and price data
Due to large diversities in the energy mix, the CO 2 -EI greatly varies among France, Germany, and The Netherlands, as shown by the data reported in Table 6. The CO 2 -EI values calculated with the marginal method are generally higher than those calculated with the average method. The marginal power plant corresponds to the source that increases or decreases if a marginal change in the load occurs, and it may be a single power plant, a group of them, or a cross-border flow. In a market scenario, the marginal power plant is usually the most expensive generator committed at the time. As such, wind and solar power plants are unlikely to be the marginal power plant, as they enter the market with low marginal costs and have priority of dispatch (Regett et al. 2018). While the average-CO 2 -EI is a good indicator of the share of renewable in the energy mix, the marginal-CO 2 -EI is a better one for the impact of short-term decisions. Several publications recommend the use of the marginal-CO 2 -EI when investigating the short-term effect of a change in the electricity demand (Dandres et al. 2017) and the optimal operation of a building (Graabak et al. 2014;Andresen et al. 2017).
The dynamic electricity prices we use to calculate the operating costs of the smart homes are derived from the day-ahead prices. Table 7 shows the comparison of the minimum, mean, and maximum values of the day-ahead prices of 2018 in Germany, France, and the Netherlands. On top of the hourly values, we add an amount determined by the average taxes and network component paid by residential users in 2018, which are derived from European Commission (2019) and summarized in Table 8. Natural gas prices, on the contrary, are assumed constant; values are taken from Eurostat (2020), including taxes and levies, and are reported in Table 9. As for the incentive schemes supporting prosumers, we identify two main measures: a compensation for feeding-in the excess energy and a compensation for self-consumption of energy generated by PV

Metrics
We define a number of metrics to compare the scenarios and smart home configurations described in the previous section. In particular, the CO 2 emissions are calculated over a period of one year and are due to the consumption of imported electricity and gas, local generation by means of PV panels and the µ-CHP system, and use of the HES and the PEV. Given that the main goal of this study lies in investigating to what extent the optimal multi-energy management of residential buildings can contribute to reduce their carbon footprint, we consider the marginal-CO 2 -EI as the most suitable indicator of the short-term environmental impact of alternative operational choices. The annual energy costs include operating and maintenance costs of the smart home and the degradation costs owning to the use of the storage devices. Carbon emissions and energy costs are used to evaluate the impact of the penetration of technologies, coupling of energy services, and load flexibility.   When a smart home is equipped with PV panels or with a µ-CHP system, we calculate its electricity self-sufficiency, which indicates the share of renewable energy produced by a smart home that it uses to satisfy its total energy demand, and its electricity self-consumption, which indicates the share of renewable energy produced and used by a smart home (Mauser 2017;Williams et al. 2012;Waffenschmidt 2014). Additionally, we look at the energy that a smart home imports from or feeds into the main distribution grid.

Discussion of the results
The simulation results of the three case studies demonstrate the effects of automated energy management for the supply of thermal and electric loads by optimizing the supply and consumption of multiple energy carriers. We now summarize the main findings with respect to the potential benefits of: coupling of energy carriers, penetration of PV panels and storage devices, and automated energy management.

Coupling of energy carriers
The introduction of hybrid heating systems and hybrid appliances diversifies the utilization of energy in smart homes. Depending on the available technologies and the goal set by the users, the HEMS decides how to supply the hot water demand; if by means of a IH, a SB, or a µ-CHP system, all of which are connected to a TS. Similarly, the space heating demand may be supplied either by the hot water coming from the TS or by the hot air generated by an EHP. Hybrid appliances replace part of the electricity with natural gas or hot water, while delivering the same services of traditional appliances. The extent to which coupling of energy carriers may promote a reduction in costs and emissions depends on the case study.
When German users attribute the same importance to the economic and the environmental savings, the hot water demand is mostly satisfied by burning natural gas in the SB, which halves the energy costs and reduces the emission by one third compared to the option of using an IH. Given the low costs of the natural gas, converting electricity to hot water through the IH is economically convenient only when coupled with a co-generation system, which enables the smart home to use the cheap natural gas and, at the same time, to earn a revenue from feeding the excess generation into the distribution grid. In contrast, using electricity to generate hot air for the space heating demand is particularly convenient given the high coefficient of performance (COP) of the EHP. Combining the use of the SB for hot water demand and of the EHP for the space heating demand is also more sustainable than relying on a fully-electricity-based or fully-gasbased heating system. While the combination of the µ-CHP with the IH is economically convenient, the overall efficiency of the conversion process from natural gas to electricity to hot water is such that the carbon footprint of the hot water is higher than if it was produced by a SB. As for the impact of hybrid appliances, they appear to have a positive benefit both in terms of costs (with savings as high as 20%) and the emissions (8%). Additionally, when a µ-CHP is available, hybrid appliances contribute to reaching almost full self-sufficiency and self-consumption.
In the French case, there is a remarkable contrast between the economic and the environmental impact of coupling of energy carriers. On the one hand, a gas-based heating system allows for at least one third lower energy costs compared to a electricity-based one. When a µ-CHP is available, at least 70% of the hot water is produced by burning gas, either in the co-generation system or in the SB. On the other hand, using natural gas has a dramatic effect on the emissions, increasing them by at least 90% and up to 135%. Consequently, hybrid appliances further magnify this contrast, reducing energy costs by up to 10%, while increasing the emissions up to 16%, compared to traditional appliances. Yet when coordinated with a µ-CHP, they have a positive impact on both the electricity self-consumption and self-sufficiency.
As for the Dutch case, using natural gas for supplying the thermal demand is the most economical and sustainable solution, reducing costs by one fourth and emissions by one fifth compared to an electricity-based heating system. The combination of a gas-fired SB for the production of hot water with an EHP for the space heating allows for further savings. The IH enables a reduction in both costs and emissions only when coupled to a µ-CHP. These results are similar to those for the German case study. However, different economic schemes, with natural gas being more expensive in The Netherlands than in Germany, while electricity being cheaper, limit the cost benefits of switching to natural gas. This is particularly evident when looking at the impact of co-generation systems, which are much more remunerative for German smart homes than for Dutch ones, also given the absence of a compensation scheme for µ-CHP systems in The Netherlands. In contrast, the marginal-CO 2 -EI of Dutch electricity is so high that even the double conversion of natural gas to electricity to hot water may reduce the carbon footprint.

PV panels and storage
PV panels enable significant cost savings for all types of smart homes in all case studies, given the FIT schemes available for solar generation. Savings are especially significant in The Netherlands, where a net metering scheme is applied; smart homes with electric heating may reduce their costs by 50%, while those with a gas-bases or hybrid heating system up to 80%. In both Germany and The Netherlands, the combination of PV panels and co-generation allows for a positive net revenue, while this is not the case in France.
As for the environmental impact of PV panels, we see opposite trends between the German and Dutch cases, on the one side, and the French one, on the other. In the former, smart homes producing solar energy reduce their carbon footprint irrespective of their configuration, the only exception being smart homes equipped with a µ-CHP system, as they tend to increase their gas consumption in order to maximize their revenue. In contrast, French smart homes gain a minor sustainability benefit from the availability of PV panels, unless they may replace natural gas used from heating purposes with solar electricity. The effects of storage strongly depend on the type of device: static HES generally increase the energy costs in all case studies and enable little or no reduction in emissions; PEVs significantly reduce both costs and emissions in Germany, whereas they only decrease emissions in The Netherlands. In France, adding storage to PV panels has overall a negative impact, both in terms of costs and emissions.
These differences among the case studies are all the more evident when looking at the total emissions caused by the entire group of 200 smart homes. In Germany and The Netherlands, the progressive penetration of PV panels and storage may significantly contribute to the decarbonization of the residential buildings, especially when hybrid heating systems are not widely available. In contrast, in France PV panels and storage systems have a minor (− 1.5%) or even negative (+ 0.5%) environmental impact, unless coupled with other technologies, such as hybrid heating systems and µ-CHP.

Multi-objective automated energy management
The simulation results show that there are ample opportunities for using both CO 2 -EI and price signals in the landscape of home automation, in order to optimally use diverse energy carriers and coordinate the operation of multiple technologies, so as to achieve an economic or environmental goal, or a mix of them, set by the users. While smart homes operating in more traditional configurations, such as electricity-based or gas-based thermal ones, have little choice between reducing their emissions or their costs, the availability of multiple technologies, such as PV panels or hybrid heating systems, enables larger savings. Depending on the case study, a single smart home equipped with a hybrid heating system may reduce its annual carbon footprint by 10% to 40%, i.e., by 400 kg to more than one tonne of CO 2 emissions. Yet this corresponds to an increase in costs that varies between 25 € and 700 € per year, particularly when a µ-CHP system is used.
It is, therefore, not only possible, but it is useful to consider CO 2 and price signals in the landscape of home automation to remunerate the home users and, at the same time, to decrease the environmental footprint of residential buildings, so as to promote and realize bold, sustainable energy policies.

Using the average-CO 2
When assessing the environmental impact of a change in the electricity consumption of a building, the marginal-CO 2 -EI should be used, since such a variation in the demand translates into an adjustment of the marginal power plant's production (Graabak et al. 2014). The conclusions drawn from the results rely on the assumption of using marginal-CO 2 -EI instead of the average-CO 2 -EI. If average-CO 2 -EI were used, the carbon footprint of the smart homes would obviously be lower in absolute values. In France, for instance, the mean value of the marginal-CO 2 -EI is twice as large as the mean value of the average-CO 2 -EI (see Table 6). In Germany, a strongly renewable-based production mix would likely lead to a marginal generation mostly supplied by polluting coal power plants (Regett et al. 2018(Regett et al. , 2019.
Beside the obvious difference in absolute values, using the average-CO 2 -EI would result in different short-term scheduling decisions. For instance, given that the average generation mix is mostly affected by the increasing availability of solar generation around noon, a HEMS using average-CO 2 -EI would likely scheduled as many flexible appliances as possible to operate around that time, subject to the users' preferences. Consequently, higher peaks in demand would be noticed around midday, as we show in . Such effects shall be taken into account, therefore, when designing future demand response programs based on carbon emissions.

Conclusions
Buildings are responsible for more than one third the energy consumption and CO 2 emissions in most industrialized countries. In spite of several studies on the economy of energy management in buildings, the environmental aspect has often been overlooked or trivially been equated to the economic one. Yet making buildings more efficient and sustainable is a fundamental step of the roadmap toward low-carbon energy systems and a sustainable society. To this end, a smarter and more coordinated use of new, complementary technologies is pivotal. To answer our research question, we focused on residential buildings and, in particular, on smart homes, for which we proposed to model them as multi-energy systems equipped with several smart technologies for production, transformation, storage, and consumption of electric and thermal energy. The model describes the dynamics of users' preferences and comfort conditions. A HEMS is responsible for determining the operation of all the flexible units that enables the achievement of an economical and/or environmental goal.
The effectiveness of the proposed approach in reducing the carbon footprint of smart home energy use, while remunerating the home users, has been evaluated with three representative European case studies based on historical and statistical data from Germany, France, and The Netherlands. The behavior of a large group of smart homes of different size and equipped with different technologies has been simulated in six scenarios with varying penetration of PV panels and storage devices. The results have shown that the extent to which synergies among energy carriers and technologies enable cost savings and reduction in emissions strongly depend on the characteristics specific to the country where such interactions are sought. A hybrid heating system has a major role in the integration of natural gas and electricity. Combining a gas-fired SB for hot water production and an EHP for space heating is often the most cost-effective solution, though an IH enables a significant reduction in costs when coupled to a µ-CHP system. However, the environmental impact of the coupling of energy carriers for heating purposes largely varies across the case studies. In Germany and in The Netherlands, where a large share of the marginal power is generated by fossil fuel-fired power plants, a heating system relying on an SB and an EHP is also more sustainable than a fully-electricity-based or fully-gas-based one. In contrast, the use of natural gas in French smart homes dramatically increases their emissions; the more electricity is used, the lower are the emissions, owing to the fact that most of the marginal power comes from low-carbon hydro and nuclear power plants. Similarly, the impact of the introduction of hybrid appliances depends on the case study, being largely beneficial in Germany and in The Netherlands, while having a negative environmental impact in France. The dual, often opposite nature of the multi-energy management problem is further magnified by the growing penetration of PV panels and storage devices. Current FITs for the excess solar generation make PV panels a remunerative solution for smart homes in all three countries, irrespective of the available technologies. Such compensation schemes aim at incentivizing the installation of small-scale solar capacity, as one of the main measure of the transition toward low-carbon energy systems. Yet, while PV panels significantly contribute to the decarbonization of the smart homes in Germany and The Netherlands, they have a minor or even a negative impact in France, unless coupled with other technologies. As for the storage devices, PEVs offering smart charging service to smart homes appear to be generally more beneficial than HES, though their actual impact varies by country.
The results have shown, therefore, that there is no "one-size-fits-all" solution that can be considered suitable for all countries and all users. Additionally, our multi-objective approach has indicated that using both price and carbon signals in the landscape of smart home automation systems and, in general, of building automation, is not only possible but also useful, given the duality of the problem. Users that aim at minimizing their costs may end up increasing their emissions by up to two thirds, whereas users most concerned with their carbon footprint may pay three times as much as the others. Taking into account both the economic and environmental aspects of the multi-energy management problem is, therefore, of the utmost importance in order to promote the acceptance of technologies among users and to realize their full potential on which bold, sustainable energy policies rely.