{'fraction_non_alphanumeric': 0.024361998713274716, 'fraction_numerical': 0.004739438129959254, 'mean_word_length': 5.232424485431703, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Integration of Legacy Appliances into Home Energy Management Systems

The progressive installation of renewable energy sources requires the coordination of energy consuming devices. At consumer level, this coordination can be done by a home energy management system (HEMS). Interoperability issues need to be solved among smart appliances as well as between smart and non-smart, i.e., legacy devices. We expect current standardization efforts to soon provide technologies to design smart appliances in order to cope with the current interoperability issues. Nevertheless, common electrical devices affect energy consumption significantly and therefore deserve consideration within energy management applications. This paper discusses the integration of smart and legacy devices into a generic system architecture and, subsequently, elaborates the requirements and components which are necessary to realize such an architecture including an application of load detection for the identification of running loads and their integration into existing HEM systems. We assess the feasibility of such an approach with a case study based on a measurement campaign on real households. We show how the information of detected appliances can be extracted in order to create device profiles allowing for their integration and management within a HEMS.


Introduction
The transition of our energy system from non-renewable energy to sustainable and renewable energy sources takes place at various levels in the grid, including consumers at household level. Here, energy might be generated locally (e.g., via a photovoltaic system) or usage can be optimized, reduced or shifted in order to match the energy demand to the current grid situation [1]. Therefore, the usage of devices with significant energy consumption must be coordinated. Carlson [2] shows that in American households 12 appliance types are responsible for 80% of household electricity consumption, where white goods such as refrigerator, dishwasher and washing machine demand a higher amount of energy than brown goods (e.g., TV). At household level, this demands for a better coordination of energy resources, aiming at lowering overall energy consumption and thus costs. To handle the coordination effort for a number of household devices with significant energy consumption, there is a need for a home energy management system (HEMS) to automatically manage energy resources in building environments. Networking and operating the components of such a HEMS can be difficult, since we have to cope with (i) smart appliances [3] from different vendors, (ii) legacy appliances, i.e., non-smart, legacy devices without a control or communication interface, and (iii) potential changes in the system due to addition or replacement of devices.
This paper describes an open architecture for the integration of different device types. In particular, we propose a layered model that allows to integrate legacy and smart devices and to represent them with an ontology-based appliance and usage model. By adding a non-intrusive load monitoring (NILM) mechanism we approach the problem of legacy device integration with a detection approach based on power measurements. This way, we present a complete and extendable HEMS solution providing the basis for energy management applications such as advanced monitoring to increase energy awareness, insert-coin applications to reduce energy consumption, and load shifting approaches to better utilize renewable energy sources or to take advantage of time-based tariffs.
Section 2 presents a system architecture describing the different interacting components and mechanisms in a five-layer model, from electric layer up to application layer. Smart and legacy devices are handled by driver components that provide a unified mapping of these devices to the upper layers. Section 3 addresses privacy aspects within this architecture. Section 4 describes data modeling and management within the architecture. The concept for a unified modeling and representation of smart and legacy devices is explained in Section 5. Section 6 explains how a NILM approach allows for the identification of legacy devices. Section 7 describes implementation experiences on the presented approaches. Section 8 summarizes the main contributions to our HEMS architecture and concludes the paper.

The HEMS at a glance
A HEMS is a system of computing components that can be employed for optimizing energy resources in building environments. Typically, a HEMS should be able to collect consumption information of devices, as well as monitoring local production from renewable energy sources (e.g., photovoltaics). This section provides an overview of common components in a HEMS and introduces a novel HEMS architecture allowing for the seamless integration of heterogeneous components.

Components of a HEMS
Typical building blocks of home energy management systems are: • Smart meter: The presence of a smart meter results in the possibility to increase the resolution of consumption data. On one hand, this offers a feedback mechanisms to residents, who can get a better understanding of energy use in the building environment. Furthermore, energy can be provisioned under adaptive prices, which can reflect the energy available in the grid in order to keep the grid balanced. On the other hand, utilities can use demand data to improve the pricing and billing mechanism, as well as to monitor the status of the grid and extract valuable knowledge that can improve decision making.
• Smart appliances: A smart appliance is a device that embeds a computing unit and a network interface, which allows for the interaction with users and other appliances. Smart appliances are aware of consumed power, based on local measurement units or built-in profiles [3]. In order to interoperate with other devices in the network, smart devices need to provide a machine-readable description of their features and properties. This way, smart building applications can be realized controlling distributed digital sensors and actuators, which can dynamically join and leave the network.
To cope with mobility and volatility of nodes, service discovery mechanisms are necessary A typical example is given by electric vehicles, which are disconnected for use and eventually reconnected for charging.
• Legacy electrical devices: Although a smart building can be realized from the composition of intelligent devices, building management systems need to consider the presence of non-smart devices. A possible solution is to connect sensing units to loads and track their consumption. So-called smart outlets and smart plugs form a network of distributed sensing nodes, which normally provide also the possibility to remotely switch loads (on/off). Since current market solutions do not support identification of connected loads, any processing of consumption data has to be done at application level.
• Home gateway: A residential gateway is used in building automation systems to bridge the home network to the wide-area network. Thus, the gateway represents the connection point between the private network and the internet, and as such, it plays a crucial role in ensuring security and privacy. In addition, the gateway is also the point where interconnection and interoperation between heterogeneous technologies takes place. Subnetworks using specific technologies, such as automation fieldbuses and Zigbee networks, can be managed from the gateway in order to provide a uniform interface to access resources. Beside the integration of networked devices working under different technologies and standards, the gateway should also allow for the integration of legacy devices. Figure 1 sketches an architectural model of a HEMS that integrates a load disaggregation unit to detect legacy appliances. In the architecture, specific  Figure 1: Overview of the HEMS architecture driver components allows for the detection and management of sub-networks, thus acting as a proxy to integrate networked devices, smart devices and legacy devices. The model is implemented over the following 5 layers:

HEMS architecture
1. Electrical layer: Electrical devices are connected to a common local power distribution network. This layer allows devices to deal with electrical power measurements. A classic meter works at this level.

Network layer:
This layer provides network connectivity to embedded devices. A typical example is given by automation field-buses and wireless sensor networks, such as building automation systems and wireless smart outlets (e.g., ZigBee and WiFi). Management of the sub-network requires a specific driver to interface it to the HEMS.
3. Service layer: In order to be automatically usable by other devices in the network, smart devices are required to provide a machine-readable description of their features and properties. The service layer includes the mechanisms by which devices can describe and advertise their features, so that functionalities can be discovered and exploited by other devices [4].

Data layer:
The data layer provides an abstract representation of data and functionalities managed by the individual drivers, by providing a homogeneous interface to access this resource. This also includes the management of the device profiles, which are datasheets reporting static information of devices (e.g., sensor accuracy, type) and could be stored on the manufacturer's servers. In addition, a data model could be employed to perform a basic processing of raw data collected from the drivers, so as to produce a more abstract context representation, which can be stored in a knowledge base.

5.
Application layer: User applications are run in the application layer. For instance a decision maker might rely on the context representation stored in the data layer to react to environment changes. A query engine provides an interface between the data and the application layer. On the other hand, the network API provides application-level interoperability to the architecture, thus representing a communication interface between applications running on different computing environments.
With exception of the electrical layer, all layers could be implemented locally to the building environment or on remote servers. For instance, a smart appliance is a device that embeds a computing unit and a network interface. In order to be integrated in a HEMS a smart appliance should implement the first three layers (electrical, network and service), although the device could scale to the application layer in case data management and decision making at appliance level were necessary. A HEMS is required to deal with distributed resources, built by different manufacturers using different technologies. As seen, component-level interoperability of networked devices can be achieved by separating the component interface from implemented functionalities. To achieve such a loose coupling between components in the architecture it is necessary to provide means for: • Service discovery: A service is a self-contained collection of functionalities that is homogeneously provided to users and applications. Service discovery concerns the discovery and naming of network entities so as to enable resource sharing. Generally, service advertisement can be done using broadcast and multicast (e.g., ARP, UPnP), using centralised service registries (e.g., DNS, LDAP, UDDI) or exploiting logical overlays such as with distributed hash tables (e.g., Chord, Kademlia) [5]. An extensive overview of service discovery mechanisms for embedded systems is provided in [6].
• Service description: Providing a simple interface to the service allows for encapsulation of the service complexity and operation. Services are described in terms of their I/O interface: i) possible operations, ii) constraints on data given and iii) communication protocol. To ensure format interoperability, service descriptions can rely on formats such as XML or JSON.
• Service coordination: Complex services can be built by combining individual services. The two main service composition approaches are service orchestration and service choreography. In the former, the overall dynamics are defined by an orchestrator component which controls the specific service components. In the choreography approach the global goal of the system is implemented as local rules in the individual services. Choreography definition languages can be used to automatically generate rules for individual services given the overall business process.
• Resource description: While the plug&play property [7] can be achieved from the description of computing components, data interoperability is still an open issue. [8,9,10] suggest to semantically annotate sensor data using principles of the semantic web and the linked data initiative. Beside the Internet of linked documents, the initiative proposes the use of the Resource Description Framework (RDF) to describe data in terms of relationships. Specifically, in the RDF data model, the basic information unit is a subject, predicate, object triple. Data can be related to concepts defined in well-defined vocabularies (i.e., ontologies) so as to be interpretable by all entities sharing the same definition. The semantic sensor network ontology (SSN-XG) represents a step to this end. Ontologies for data modeling in HEMS are presented in Section 4.1.

Privacy aspects
Privacy concerns arise from handling private information, as it might results in theft and alteration. Appliances act in a private environment and alteration of consumption and price information in demand response scenarios would entail more than just discomfort on residents activities. Moreover, smart appliances might be delegated tasks from users to act on their behalf, for instance a smart fridge might be allowed to directly buy goods using a credit card. Besides, privacy concerns arise from the increasing availability of fine-grained power consumption data in the context of smart metering. [11] reviews the impact on privacy of different stakeholders, such as the energy utility, marketing/advertisement partners, creditors, the press, and criminals [12]. Energy consumption data allows for the extraction of usage patterns, describing time of use of devices, and leading to activity recognition and user profiling [13,14]. An extreme example of the power of smart metering data analysis was shown in [15]. Therein, the authors have shown the possibility to identify multimedia content, such as the program currently watched on the TV. Load hiding techniques were presented to alter device operation so as to preserve privacy in households and ensure ownership of energy information. These techniques can be divided into battery load hiding (BLH) and load based load hiding (LLH) approaches [16]. BLH approaches obfuscates metering data using a controllable battery. The battery is charged and discharged at strategic times to flatten the household's energy demand. In contrast, LLH uses controllable energy-intensive loads to introduce noise in the daily overall household power draw and obfuscate metering data. For the purpose, devices used daily and not directly operated by users are favoured in order to minimize the discomfort produced by their altered operation.

Data Management
As seen in Sect. 2.2, HEMS can benefit of a data-driven abstraction. A data manager is intended to provide a homogeneous interface to access static and dynamic data describing the environment (see Fig.1). This requires modeling the environment in which the system operates, using a shared vocabulary to provide semantics. Static information includes device profiles, reporting characteristics and functionalities, as well as usage models that can be exploited at application level. Dynamic information represents the environment state. Sensor measurements are represented abstract context representation that can be utilized by decision makers in a unified way.

Data Modeling
To achieve data interoperability between data producers and consumers it is necessary to model both data and environment dynamics. Ontologies can be employed as a unified approach to the semantic annotation of devices, processes, user preferences and activities. Typically, a HEMS requires the specification of the following domains: • Building information: This includes modeling of the dwelling, such as building geometry and insulation information [17].
• User information and preferences This includes living processes in terms of appliance operation and system settings (e.g., for thermal comfort) [21].
• Energy management: This includes modeling of energy generation, management [22] and optimization through rule-based reasoning [23].
• Weather and climate modeling: This includes modeling of both climate and weather conditions, as well as weather forecasts [24].
The use of an ontologies for interpretation of data reuse and integration of existing ontologies to extend the ontological framework to a large scale.

Interfaces and Query Languages
The use of knowledge representation technologies in the semantic web context made tools for the description and retrieval of data widely available. The SPARQL Protocol and RDF Query Language (SPARQL) is a query language to handle data within the RDF framework, allowing for the addition, deletion, and modification of data triples. As triples can be added or modified as consequence to the arrival of specific events, SPARQL can also be used to perform complex event processing, by defining rules and constraints over data using the SPARQL Inferencing Notation (SPIN). While SPARQL was designed for static networks, such as the web, data collected in real environments tend to be high dynamic and demand for different query languages able to tackle such a volatily. Various alternatives have been proposed: C-SPARQL, SPARQLstream, EP-SPARQL, and CQELS.

Integration of Legacy and Smart Appliances
In this section we identify the main requirements for the integration of electrical devices within a HEMS. This includes the detection of operating loads and the description of sensed and inferred information using the technologies identified in the previous section.

Appliance proxy in the HEMS
The component providing a uniform representation of physical devices is the Device Stub. The Stub acts as a proxy for remote devices, which are monitored through NILM, sub-metered methods or directly connected through specific network interfaces (e.g., smart appliances). This allows for keeping a locally mapped representation of remote objects, describing their characteristics and status. In this way, the information can be provided to the upper data management layer and combined to the environmental data (i.e., context) to be used by applications. Information of smart devices can be directly retrieved through the network, whereas legacy devices need i) to be detected and distinguished from the smart devices already known and ii) to be described in terms of a device profile (static information) and status. At a service level, the appliance proxy can act as a collection of dummy smart appliances, by modeling their interface definition using a predefined structure, and making it available within the network.

Inferring appliance information from consumption data
Consumption data allows for the extraction of status information of electrical loads, thus giving the possibility to track consumption and build basic profiles. For instance, a profile could gather data representing operational states of the device, which can be characterized by the energy demanded. In addition, the profile could also keep track of appliance usage in order to extract a model of inhabitants to be used for energy management applications. Modern HEMS can be equipped with appliance-level sensing units measuring consumption of connected loads. Another possibility to collect consumption data is provided by the increasing availability of smart meters. NILM is the problem of identifying individual loads from the overall household power draw. Table 1 shows aspects that can be extracted using NILM compared to the ones explicitly provided by smart appliances. In the table, intrusive load monitoring (ILM) represents the case in which a monitoring unit is connected to each load. Clearly, the complexity of the ILM problem scales to a NILM problem when groups of devices (e.g., circuits) are monitored using the same unit. While a smart appliance can provide a complete description (), load disaggregation can only infer information related to the operation of appliances, with an uncertainty that depends on the used technology (∼). Moreover, NILM does not allow for appliance control. While a smart appliance can provide full controllability, a smart outlet/plug (ILM) can provide only partial controllability of loads. As indicated in [2] on American households, white goods are critical for the success of demand response programmes. In order to tailor this approach to the Central European area, the considered appliances are based on an analysis of Austrian and Italian households [29], which identified typical consumption scenarios and formulated conservation strategies tailored to the region. Based on these data, Table 2 lists important appliances that should be identified and integrated in a HEMS, including smart and legacy devices detected through NILM and ILM approaches. Devices are classified according to their controllability and the presence of a user. Another aspect considered in the table is the extent to which the device should be controlled within energy management applications. Many legacy devices such as stove, water kettle or microwave are user-driven appliances and therefore, they are not good candidates for load control. Furthermore, the possibility to switch on/off devices is not sufficient for managing appliances where the starting point has to be scheduled, as smart outlets/plugs cannot pause connected devices. For instance a washing machine can not be controlled via a smart outlet because of its multiple operation states, that is, the device would stay in stop mode or start from the beginning when the power is restored. In conclusion, to optimize development and energy costs the design of home energy management systems should consider the necessity Type Controllable User-dr. Tested

Management and representation of appliance data
The proposed approach considers the management of contextual information, which encompasses both static and dynamic data, such as appliance models and sensor data collected across the physical environment. A first aspect to consider is the format and locality of such data, in order to provide applications with a unique representation for data access. Context information can be maintained locally to the building or managed by a context provider acting as trustworthy intermediator to application providers [10]. As shown in 4.1, ontologies can be used as shared vocabularies to model data and allow for interoperability between different entities. This means that the agreement of shared vocabularies is fundamental to extend the data management framework to a wide scale. We are focusing on the integration of legacy and smart electrical devices, and to this end it is necessary to model the following aspects: • Measurement values: Dynamic data includes time varying information, such as measurement data collected from the physical environment. Managing this kind of data requires copying with different requirements. First of all, the load disaggregation component deals with time series representing power profiles. As the memory required is directly proportional to the sampling frequency, alternative representations such as event-based models should be considered. For example, storing edges of the signal, i.e. changes of power exceeding a device-dependent threshold helps reducing the memory consumption to handle time series where the highest frequencies are sparsely present However, introducing a threshold constitutes a trade-off between information and memory used, as selecting a large threshold leads to coarse grained data and high information loss which complicates the reconstruction of the signal. Consequently, the threshold impacts the effectiveness of NILM algorithms and therefore of the whole interoperability process.
• Appliance profiles: Appliance characteristics are critical for the integration of devices, including both interface description and load disaggregation. Manufacturers of smart appliances could provide appliance profiles (i.e., datasheets) describing the device within the communication network. Information such as manufacturer, type, energy rating and user controllability can be provided beforehand. As an alternative, profiles could be provided by a certified trustworthy entity (e.g., profile provider) or annotated by residents and shared via a common platform An appliance profile (see Fig. 2) describes the operation of an electrical device, by defining its electrical characteristics. Electrical devices operate in the physical environment, offering a physical service. A physical service defines the operation of the device for a specific task, such as a certain washing cycle for a washing machine. This includes the signature describing the operation of the device, as well as the energy demanded and the current status. Here we distinguish between devices with permanent consumption, such as fire alarms, and devices, which can operate in multiple states. It is important to remark that device profiles allow for the management of appliances. Accordingly, a state is defined in terms of peak active power, tolerance to power variations, duration, and two discomfort factors: i) a delay sensitivity (in seconds) determining the responsiveness of the device and ii) an interruption sensitivity (in seconds) describing the tolerance to interruptions of the state. For instance, the start of a coffee machine should not be postponed from its request because of an extremely low delay sensitivity, while its water heating state should not be interrupted because of a low interruption sensitivity. The status of a service describes the operation (i.e., on, off, or paused), as well as its progress in terms of start time and elapsed duration.
Furthermore, smart appliances might expose a virtual service within a network, for instance to retrieve temperature values. A virtual service is hence described as a reference to a machine-readable interface. A smart appliance may implement various M2M technologies to provide both physical, virtual and smart services.
As seen in Section 5.2, a load disaggregation unit can extract information of detected appliances in order to build appliance profiles. In this way, applications can seamlessy access device information for both smart and legacy devices.
• Appliance identification models: In order to detect running devices, the load identification component needs to deal with appliance models describing the behavior of devices through a set of observable states.  Specifically, each device observation is described by a set of features, such as current and power, as well as outgoing transitions to other observable states. In addition, certain models can also express the typical duration of a device observation (e.g., Hidden Semi-Markov Models (HSMM)). To model device dynamics, transitions connecting two observations are generally associated to a transition probability. Fig. 3 reports the ontology for electrical appliances, showing both the device profile and the load identification model.
• Appliance usage models: The problem of mining appliance usage patterns concerns the extraction of models of how appliances are used by residents, given a sequence describing changes on their operational state. Given logged data describing status changes of appliances, representing relationships between the usage of different devices can be solved by data mining algorithms. In [30], we apply Bayesian network to learn the usage model of a coffee machine based on real consumption data. As models strictly depend on end-user applications, their construction and management needs to be done at application level. The details of applying data mining for generating appliance usage models is beyond the scope of this paper.

Appliance detection and classification
To monitor and integrate legacy devices into a HEMS, we can distinguish three monitoring and detection possibilities: a single meter approach (NILM), a multiple meter approach at device level (ILM) and a multiple meter approach for device groups.

Non-intrusive load monitoring -NILM
NILM is the problem of disaggregating running loads from overall consumption data. NILM is a single-meter approach. The approach was first introduced by Hart [31]. The method detects running appliances according to specific characteristics of their power signature. State-of-the-art NILM algorithms can be distinguished into supervised and unsupervised approaches. Supervised techniques are based on labeled data and can be divided into optimization and pattern recognition based algorithms. In the latter case, the NILM problem is considered as an optimization problem: a total power consumption and a database of known power profiles of appliances are given. A composition of devices' power profiles are chosen from the database to approximate the total power consumption with minimal error [32,33,34]. Pattern recognition techniques include clustering approaches [31], Bayesian approaches [35], neural networks algorithms [36] and support vector machines [36,37]. The disadvan-tage of supervised learning and classification is the need of labeled data during a training phase, which implies greater development costs and effort. Lately, recent research in load disaggregation is focusing on unsupervised algorithms. Unsupervised algorithms are not using any labeled data and consequently, no training phase. Recent NILM algorithms are based on k-means clustering [38], Fractional Hidden Markov Model (FHMM), and its variants [39,40,41,42]. State-of-the-art NILM approaches are highly dependent on the used sampling frequency and have several limitations. According to [43], it is possible to detect approximately 10 different appliances with a sampling frequency of seconds. The higher the sampling frequency, the more meaningful are the device features and the more accurate is the appliance classification. Currently, there exists no load disaggregation technology which can solve the problem in all its aspects. Open challenges and limitations are: 1. Noise interference: presence of noise, which is typical to a measurement process, affects the quality of extracted device features; 2. Appliance modelling: differences in type, characteristics and manufacturer make the modeling of devices more complex. This means that a model of a washing machine does not allow a load disaggregation algorithm to correctly detect another type of washing machine with different characteristics.
3. The quality of extracted features is directly proportional to the sampling frequency [43].
4. Similar appliance features: different appliance types can behave in a similar way which makes it difficult to distinguish between them. Therefore, more advanced appliance characteristic features are needed.
5. Unknown appliances in the power draw add uncertainty to the disaggregation process.
6. Degree of overlapping power draws: concurrently operating devices imply overlapping power profiles. Therefore, their number determines the complexity of the classification process.
7. Unpredictable appliance usage: user behaviour introduces further uncertainty to the disaggregation process. Resident's habits, such as time of use and typical duration, tend to be user specific.
8. Unknown number of appliances: the number and types of appliances used vary from home to home.
9. Computational complexity: Each approach has different computational and complexity costs, which have to be considered for the specific application purpose [44].
A disaggregation technique should be selected considering both application and hardware costs, as depending on the selected technique, different limitations and restrictions arise. Zeifman suggests in [35] that a load disaggregation solution should fulfill the following requirements: • Power measurements with 1 Hz sampling frequency; • The minimum acceptable accuracy is 80 to 90%; • No training should be necessary; • Real-time capability should be provided; • 20 to 30 appliances should be detectable; • It should work with different appliance types, such as on/off appliances, multi-state appliances, continuous appliances, as well as permanently operating ones [45].

Multiple-meter load monitoring
The sub-metered approach is intrusive (ILM) as it requires the connection to each device of a monitoring unit, such as a smart outlet/smart plug. Device identification can be performed both by humans, who can specify the type of each connected device, as well as inferred from collected data using the techniques presented in Section 6.1. The presence of device-level consumption information facilitates the appliance classification problem, as the search space is reduced to fewer connected devices [46,47]. This allows for a hierarchical load disaggregation, where results of load disaggregation on appliance groups monitored with ILM can be combined to obtain the overall solution to device classification [48]. The disadvantage of using multiple meters is the resulting cost for the sensing units, which add an overhead for the collection of the data, as well as maintenance costs.

Extracting load identification models
The load identification component requires models describing the operation dynamics of electrical devices. Models can be obtained based on a priori information or can be extracted online from measurements. An example for building appliance models was firstly presented in [31]. This approach clusters appliance events according to active and reactive power to build a finite state machine of the appliances. Another approach was presented by Dong [49]. Major residential load signatures are extracted and can be used for NILM and load condition monitoring. Beside extracting load signatures and building appliance models, Parson [50] uses a general appliance knowledge to disaggregate appliances from the metering data. Recent research on appliance modeling is based on probabilistic graphical models, as they are able to capture both appliance bahaviors, structures and features (e.g.: on/off appliances or multi-stat appliances) as well as user's behavior expressed in a probabilistic way. The HMM is commonly used to model appliances, while variants are employed to incorporate time and other elements. For example [51] uses a semi-HMM to represent more realistic appliance usage models, whose transitions are not geometrically distributed.
7 Implementation experiences

Particle Filter based Load Disaggregator
To meet the requirements for a load disaggregation component (Section 6) we used an online approach based on particle filtering (PF), as in [52]. Each appliance is modeled by a HMM whereas the model is described by its observations and transition behavior between states. The HMM observations are represented by the power demand for each appliance operation state and state transition behavior is described by the operation structure (e.g. on/off appliance with 2 states, multi-state appliance with several operation states) of the appliance. Accordingly, the HMM models the power demand on appliance level. To model the household power demand, we use the FHMM to aggregate each appliance power trend modeled by the HMM. Figure 4 sketches the HMM modelled appliances, the FHMM and the resulting aggregated power demand.  The PF aims to approximate the posterior density of the FHMM to disaggregate each appliance power demand and appliance state from the household demand, according to the current observed consumption and the given appliance models. Therefore, the PF output estimates the household consumption, whereas a simple decision maker based on thresholding and with knowledge of each appliance model decides for each appliance state. The use of PF as load disaggregator is beneficial for three reasons. First, PF can handle non-linear problems presented by non-linear behaving loads such as a driller or a dimmer.
Second, it can handle non-Gaussian noise influences resulting from uncertainty in power trends and consumption data. Third, PF and its performance can be adjusted by the number of used particles. The more particles the PF considers, the better the estimated posterior density. Nevertheless, we want to point that the number of particles can not be chosen arbitrarily due to the computational effort of the approximation process. We empirically identified 1000 particles as an appropriate number balancing the trade-off between the context of computational effort and detection performance for a typical household with ∼ 20 relevant devices. In the following evaluations, on/off and multi-state appliances are considered whereas the PF has the knowledge of the model structure (two or more operating states) and the expected power demand as observation for each state. Knowledge of the transition matrix values is not necessary since the PF is independently estimating the appliance states with an appropriate number of used particles.

Dataset
An appropriate power consumption dataset has to be used to evaluate our test scenario. There exists several publicly available datasets, for example the REDD dataset [53], the AMPds dataset [54], and the Smart* dataset [55]. In order to address power consumption in Austria and Italy, we use the GREEND dataset [30] containing appliance level power measurements of Austrian and Italian households. The dataset offers appliance-level active power measurements at 1Hz resolution. In total 9 houses with 9 typical household appliance were monitored, although our evaluations relies on 7 appliances in house 0 ( Table 2). We have chosen the devices according to their contribution to the household power demand as in [2]. Figure 5 presents a plot of the aggregated power demand of seven appliances.

Test Scenarios
To show how the selected load disaggregator could be used to integrate legacy appliances we defined three different test scenarios: 1. Disaggregation of overall household (NILM). To simulate an approximated overall household demand, the power consumption for each appliance listed in Table 2 is aggregated over time. The load disaggregator aims to disaggregate the appliance level consumption data based on predefined appliances models (HMM). This test scenario should depict the common household case where one energy meter with corresponding aggregated consumption data is available.
2. Appliance groups. It is conceivable that more than one energy meter in form of smart plugs/ smart sockets are available in a household. These meters are monitoring a group of connected appliances. Therefore, the energy demand of appliances are monitored in groups resulting in a reduction of the appliance number aggregating their power demand. The complexity of the disaggregation problem is decreased. In order to confirm this assumption, we arbitrarily choose two groups of four and three appliances, aggregate their consumption data and give this information with the appliance models as input to the load disaggregator.
For all three test scenarios, 7 consecutive days with 1 second measurement granularity are considered. To make statements how the load disaggregator is performing for the different test scenarios, we are defining the following commonly used evaluation metrics: • Accuracy (ACC). The accuracy is defined as the number of correctly detected events for the case when a device is on (TN. . .true positive) or off (TN. . .true negative) over all possible events and is defined as: where N represent the number of all consumption samples.
• Normalized root mean square error (RMSE). The RMSE is the error between real and estimated power signal normalized by the difference between minimum and maximum power in the signal. The RMSE is formulated as: where Θ represents the true total power load,Θ the estimated total power load produced by PF and max(Θ) and min(Θ) the maximum and minimum power value of the total power load.  Figure 6: Sketch of the household energy partition on appliance level for the measured and estimated case are shown • Energy disaggregation error The percentage error of the estimated energy with respect to the real consumed energy, over the duration of the experiment.

Results
As described before, we considered different test scenarios for our evaluations. The first one deals with the aggregated power demand of seven appliances listed in Table 2. In Table 3 the evaluation results are presented. The reached ACC, RMSE and disaggregation error depend on the complexity of devices (e.g.: on/off or multi-state appliances) and the similarity of devices regarding their power demand. For example, the set of TV, fridge and washing machine yields a decreased ACC and RMSE due to their appliance type and their similarity of consuming power. In Figure 6 the energy partition on the real and the estimated energy computation on appliance level is shown. The estimated energy values and their corresponding percentages on the overall energy demand show again the dependence of the load disaggregator on the appliance type and the similarity between appliances.
In the second test scenario appliances are grouped to decrease the number of appliances. The results of ACC and RMSE are shown in Table 4 and are improved compared to Table 3. As reason we assume the decreased number of appliances and the corresponding decreased probability to have similar appli-  Figure 7: Sketch of the household energy partition on appliance level for the measured and estimated case are shown in which appliances are formed into group 0 (TV, vacuum cleaner, washing machine)   Table 4: Results for test scenario 2 ances in the same appliance group. Figure 7 and 8 show the energy partitions of the submetered demand for the real and the estimated energy values. As in the previous test scenario, similar appliances influence the result of the disaggregator. In summary, a load disaggregator could be used to disaggregate appliances from the aggregated household power demand. The performance is mainly affected by the number of considered appliances, the type of appliances and their similarity. Note that the presented load disaggregator is aware of the appliance type/model and the number of appliances. Although it is one of numerous NILM approaches applicable for this problem, the presented approach appears to be a good choice fulfilling the requirements given by Zeifman. Nevertheless, to achieve full integration of legacy devices in a HEMS, a load disaggregator has to combine appliance detection with signature extraction approaches. While appliance detection provides information of appliance status and allows for the inference of device profiles (see Sect. 5.3), signature extraction allows for the inference of device models, to be used for improving the appliance detection process.

Annotation of inferred information
In order to model device profiles and device models, we used the the open source tool Protégé 1 to build models in the ontology web language (OWL). The resulting ontology is available for use at the MONERGY project webpage 2 . Fig. 9 shows an example profile for a water kettle. The device is user driven and has a physical service to heat water. The service demands 0.03 KWh and is currently in the OFF status. The service takes place over one state, requiring 1800 W with 5% tolerance being insensitive to interruption and start delay. Fig. 10    identify the device, this model describes OFF and ON observations, using active power as a feature. As noticeable, device dynamics are captured using transition probabilities.

Conclusions
This paper addressed the problem of device and data interoperability in HEMS.
In particular we analyzed building blocks of a HEMS to identify main challenges.  We put ahead a general architecture for HEMS, where requirements and characteristics are presented. Although the current standardization effort will soon provide technologies to design smart appliances, many energy consuming and producing devices will be non-smart. Replacing all legacy devices by smart devices would be economically infeasible in many situations. Therefore, such legacy devices are assumed to have a significant impact on the energy consumption and thus, deserve consideration within energy management applications. We discussed the application of load detection for the identification of running loads, as well as the integration of inferred information into HEM systems. We advocate for a common description for smart and legacy devices, as it would offer a uniform interface to access features and data, with consequent complexity reduction for application developers. A case study is provided to show the effectiveness of a load disaggregation algorithm on real data collected from a living environment. We carried out two different approaches to monitoring and disaggregating appliances where the load disaggregator inputs the aggregated power profile of i) all appliances and ii) grouped devices. A state-of-the-art load detection algorithm was applied to identify which monitoring approach is suitable to integrate legacy appliances into a HEMS. Our results demonstrate that each monitoring approach allows for the correct detection and therefore integration of appliances, according to the requirements defined. We pointed out different advantages and disadvantages of these approaches, which should be considered during the design of the HEMS. We also showed how similarities between electrical devices affect the disaggregation process negatively. Finally, we exercise how information from detected appliances can be annotated to be exchanged within a HEMS. To the best of our knowledge, this is the first paper showing how the integration of legacy devices into the HEMS could take place, what requirements should be fulfilled and which limitations and challenges need to be considered.

Acknowledgments
This work was supported by Lakeside Labs GmbH, Klagenfurt, Austria and funding from the European Regional Development Fund and the Carinthian Economic Promotion Fund (KWF) under grant KWF-20214 | 22935 | 24445.