# Towards the Real-World Deployment of a Smart Home EMS: A DP Implementation on the Raspberry Pi
## 3 The Case Study  
The proposed technique was illustrated and validated referring to a small electrical grid that encompasses four networked dwellings. Each smart home was equipped with an EMS of the proposedtype, which generated in real time the references for the power flows among the system components: loads, renewable generators, and battery storage systems. Furthermore, a series of previously devised wireless sensors [38] was connected to the electric appliances to send measured data to the EMS and to forward the power references set by the EMS to the power electronic converters that interface system components. The wireless sensors communicated using Message Queue Telemetry Transport (MQTT), a lightweight messaging protocol for the IoT based on the publish-subscribe paradigm. A pictorial view of each smart home is shown in Figure 2.  
The four users (A\(\div\)D) had different habits, hence different load profiles. The main parameters of the system under study are shown in Table 1, and the following working assumptions were made:  
1. The aggregated load profile is considered as an input; if needed, a lower-level control system can shift or schedule each load, while respecting the aggregated load profile.
2. The maximum contractual power for Users A and C is 3 kW, whereas for Users B and D it is 4 kW.
3. Each user has only one renewable generator; in particular, Users A and B have PV generators, whereas Users C and D have micro Wind Energy Conversion Systems (\(\mu\)WECSs).
4. The renewable generators are always operated in the maximum power point for each environmental condition (wind speed, solar irradiance, and temperature) since they are usually equipped with maximum power point trackers (MPPT).
5. Transferring power from the battery to the grid is not allowed by the utility, according to the technical rule for grid-connection in force in some European countries at the time of writing.
6. The battery must be small and affordable for the end user, thus it is not suitable to sustain hours-long islanding; the considered capacity values for each user are given in Table 1.  
Such working assumptions did not affect the general validity of the proposed EMS. With regard to Points 1 and 4, even if slight deviations occurred (e.g., the lower-level control system does not precisely respect the aggregated load profile or the renewable generator does not work exactly in its maximum power point), they were seen as forecasting errors. Hence, using the battery as an energy buffer, they were effectively corrected by the _Online Replanning_ stage of the EMS, as happens for errors due to unexpected weather fluctuations [42]. As for Point 3, in the presence of more than one renewable generator, their power profiles could be aggregated following the same approach used for loads. However, this scenario is highly unusual in the smart home context because it would be very expensive. Finally, with regard to Point 6, the influence of battery size on the EMS performance has been already studied in [42], where a sensitivity analysis has been performed.  
Figure 2: Pictorial view of the smart home under study.  
To send the self-committed GEPP once a day, each of the four smart homes was connected to the data aggregator of the grid manager through a secure Internet connection [13]. The data aggregator received and aggregated the user-committed GEPPs; the resulting profile could be exploited by the utility to improve its policy planning.