# A Trustworthy Communication Hub for Cyber-Physical Systems
## 6 Evaluation
### CPS Hub with Services of Automated Dynamic Microgrids  
The evaluation step related to the automated dynamic microgrids (ADMs) is shown in Figure 21. The system considered the energy market service platform (EMSP) of Empower, the simulation-based system of the distributed energy resources, and the CPS hub. The simulation-based approach was selected to enable studying the concepts, algorithms, and real SW systems of automated dynamic microgrids without complex and expensive distributed energy resources (DERs), distribution grid, embedded products HW systems, and a large number of stakeholders and service systems [1]. The demonstration included the following steps related to setting up the CPS hub operation capabilities for the automated dynamic microgrids:  
* Configuration of communication spaces for Empower and VTT resource owners;
* Connecting and authenticating the physical resources of the owners with the CPS hub/XMPP server over TLS connections;
* Presence registration of the real and simulated resources, and visualizing the dynamic presence situation of physical resources. The green rectangles upper right corner of Figure 21 shows that \"Emp\" (Empower EMSP), \"simev\" (simulated electric vehicles 1-3), \"simevse\" (simulated charging stations 1-3), \"CMSim\" (simulated charging manager), \"Apros\" (simulation of the local distribution grid), and \"simui\" (simulation user interface, also shown in the lower right corner of Figure 21) are available in the system;
* Negotiation of the trusted relationship (agreement) between Empower and VTT resources;
* Checking the trust for enabling the delivery of the energy domain/ADM-related specific information-based interaction via XMPP. After these steps, the CPS hub was set up for messaging between the resources. In this case, all the referred ADM specific messaging was exchanged using two methods: first XMPP and then MQTT in the enhanced version in energy flexibility demonstrator. The ADM specific messaging consisted of the following steps:  
* The control unit of the ADM simulation entity/charging manager reported the amount of combined capacities (estimations of the day ahead numbers) of the controllable DERs for both consumption and production to EMSP, which is allowed to be used by the EMSP;
* EMSP knows the day ahead situation in the larger distribution grid, energy market prizes, and gives control commands, guidelines for consumption/production, to the control unit of the ADM simulation entity accordingly for the next day (24 h);
* The control unit of the ADM simulation entity uses the control/guideline values according to the EMSP control commands and the results of the actions can be monitored via the simulation system;
* The control unit of the ADM simulation entity reports the measured consumption and production levels to EMSP on an intra-day basis;
* EMSP can send intra-day control commands to ADM simulation entity if there is need to do so. The evaluation indicates that including the simulated entities as the resources in the CPS hub proved to be a very useful capability, because then the complex scenario can be executed without having all the real physical resources present in the system. In addition, the presence services of the CPS hub/XMPP server enabled dynamic changes in the availability of the distributed energy resources. The application of virtual communication spaces to host the resources of each owner seems to be essential in resource identification, especially when speaking about mobile DERs such as Electric Vehicles (EVs.) The trust checking service of CPS seems to be essential in ensuring that ownership of resources, as well as the agreements and value sharing between owners, can be taken properly in concern. It is estimated that these capabilities are essential in enabling energy communities between a variable numbers of stakeholders with a dynamic set of DERs in various aggregator types of energy business set-ups. A challenging part of the ADM is related to the information-based interaction between distributed energy resources and EMSP.