## 3 Framework Implementation
### Local Energy Market
#### 3.2.3 LEM and CDT Integration  
The potential impact of CDT on LEM services is significant due to the integration of consumers' energy flexibility information with supplementary parameters from third-party resources, such as the energy retailer's price. As shown in Figure 5, bidirectional and automatic data flows between the LEM and the CDT platform are enabled by the communication layer, so thus individual parameters that affect the consumer's energy flexibility potential are seamlessly elicited by CDT for each LEM participant, specifically, the participant's energy demand and production, the prioritized DR scheduling based on the participant's preferences and the participant's thermal comfort level. The LEMplatform refers to the energy market and the assets that locally generate electricity while CDT involves information regarding user comfort. The information exchange between the platforms aims at the maximization of users' benefits. To this end, CDT serves as a strong knowledge base for enhancing the efficiency of LEM operations and price discovery mechanism and optimizing energy management services.  
The information exchange between LEM and CDT is critical for the integration of the two platforms and provides the following benefits:  
* Information about the LEM participant's priorities and preferences. CDT employs a multi-criteria methodological framework, as described in Section 3.1, from which the importance level of a family of energy criteria is determined. Thus, the consumer-centrism of LEM is enhanced and LEM operations are personalized.
* Information about LEM participants energy consumption and production. The consumption levels of the consumer are elicited from the IoT devices installed within the domicile, i.e., smart meters and sub-meters, on the desired time scale. The energy production levels from RES are retrieved from the smart sensors installed on household rooftop solar. In addition, CDT analyzes historical consumption data to forecast future energy demand and employs a forecast model for energy production from solar PVs based on the predictive analytics of outdoor weather conditions. For the implementation of LEM, energy demand and generation data are essential for both price discovery and energy scheduling. The forecasted values of energy consumption and production allow LEM to plan its operation in a more efficient way.
* Optimization of Energy Management System (EMS) services. CDT can optimize the EMS services since it contributes valuable information about the behavior of an LEM participant. More specifically, it provides data related to the individual's energy consumption, which is utilized to discover energy consumption patterns and classify consumers into groups. Thus, LEM can be operated in a coordinated manner to initially connect users with similar behavioral patterns, and then seek alternative solutions. In addition, the LEM operator can classify LEM participants based on their flexibility potential, as retrieved from the CDT information. In a nutshell, the LEM-CDT integration can offer a highly scalable and easy-to-implement solution that enables LEM to harness the available flexibility in its ecosystem in an optimal and efficient manner.  
Figure 5: Integration of LEM and CDT.