# A Trustworthy Communication Hub for Cyber-Physical Systems
## 6 Evaluation
### CPS Hub with Streams-Based M2M Service Platform in the Energy Flexibility Case  
The energy flexibility case is described in the work of [24], and overviewed shortly in the following. There are a number of buildings, each of which have a specific set of energy sensitive resources (white goods, boilers, heating resources), and electric vehicles, which are controlled by multiple energy aggregator services, in turn acting on a local market; Figure 25. The status and load balance in the electrical grid is monitored and compared with the forecast in real time. A distribution service operator (DSO) detects a need for flexibility and asks for bids from the aggregators on the local market every 15 min in a 24 h forecast window. The aggregators make their bids, based on the flexibility capacity of the energy resources they control, considering energy market prizes and restrictions as set by the energy resource owners. The flexibility is related to possibility to shift the energy consumption or production to another timeslot in a controlled way. For example, the energy consumption of white goods, boilers, heaters, or electric vehicle charging can be moved to happen earlier or later, or, if possible, at a lower or higher pace, depending on the constraints the device user has set. The local market can mix and match the aggregator bids to the flexibility asked by the DSO. When a bid is awarded, the aggregator can fulfil the corresponding flexibility by instructing the individual devices. As such, the electrical grid power balance can be maintained better, with flattened, lowered differences between energy production and consumption, in effect having the finer-grain consumers/producers follow the fluctuations of (renewable) energy production. This is beneficial because DSOs can save on energy storage investments; new aggregator businesses can conduct sound, revenue-generating business cases; and households and vehicle owners get energy bill rebates for their flexibility contribution. The experimental case enabled automatic and real-time energy flexibility, which addressed real needs of the energy sector, which is challenged by the introduction of ever more renewable, but intermittent energy sources, and the ever more distributed nature of both production and consumption [24]. Figure 24: Data plane negotiation in the OneM2M case. In this evaluation step, the capabilities of _CPS_ hub to operate with streams based M2M service platform in the energy flexibility case was evaluated. The system included a new small scale external aggregator of VTT (FlexEntities), which aggregated a set of simulated distributed energy resources: electric vehicles and charging stations, as well as some buildings. These simulated DERs were controlled via the stream bridge of Nokia WWS by the higher-level aggregator service/local market. The evaluation focused especially on the operation of the CPS hub with the specific streams-based M2M service platform (Nokia WWS), and simulated distributed energy resources; Figure 26.  
The M2M service platform (Nokia WWS) has a local market entity in the energy flexibility case, which is capable of streams-based interaction with external entities via a specific entity called the stream bridge. The VTT stream proxy was created to establish the required streams, with the sink/source related topic names of the local market entity, towards the stream bridge, and acting as the connector of the CPS hub on behalf of the owner \"Nokia\". After that, the trust relationship with the resources of Nokia and \"vttadm_a\" was established. Finally, the energy flexibility related interaction (FlexRequest, FlexResponse, FlexAllocate, FlexAllocate Response) between the local market and the local VTT aggregator of the simulated distributed energy resources was tested. The limited trial in which the charging/discharging level of a simulated electric vehicle was used to lower the energy consumption according to the flexibility needs of the local market.