## 5 Discussion  
Within this work, a Plus-Energy settlement with 23 residential buildings equipped with decentralized heat pumps and PV systems in the German municipality of Wustenrot was introduced. The buildings are connected to a low-temperature DHC network and a novel agrothermal heat source: a geothermal collector at depths of around 2 m that allows heat withdrawal and agriculture usage at the same time. A broad overview of the lessons learned, monitoring results, and the application of DR and DSM on the building level combined with a simulation-based prediction and optimization approach was given. Investigations of the low-temperature DHC network with decentralized heat pumps showed that heating and cooling energy can be produced efficiently at an average annual heat pump COP of approximately 4. With the subsidies granted within the research project, a competitive heat price of 0.21 \(\upmu\)kWh for the end user was achieved. It is expected that with progressing maturity of the technology, competitive heat prices can also be reached without subsidies. The geothermal monitoring showed that there is a significant impact on the specific heat yield by groundwater resulting in more than 100 kWh/m\({}^{2}\) due to high moisture and the energy transfer generated by the groundwater. This leads to a reduction of the collector field size. In the case of the Plus-Energy settlement in Wustenrot, a low-temperature DHC network also has proven to be very suitable since it is situated in a less dense, more rural area with highly efficient buildings and available wider open areas for collector installment. Within the settlement, the agrothermal collector, and the low-temperature DHC network, a comprehensive monitoring system was installed. Especially within six of the buildings, data of all the relevant thermal and electrical energy flows are gathered in great detail, and the heat pumps  
Figure 28: Daily electricity cost development (flexible electricity tariff). are controllable. For monitoring and control, mainly ModBus TCP and ModBus RTU protocols are used. Data is collected in a cloud-based MySQL database and accessed by a dedicated monitoring solution. On the building level, an approach for the prediction of building demand and production as well as optimization of heat pump operation was developed to increase self-consumption, apply flexible electricity tariffs, and also participate in power markets. Thereby, the individual thermal load forecast and the behavior of the building systems was realized via white box simulation models, whereas the prediction of household electricity and DHW demand was done by an algorithm based on DTR, kNN, and k-means clustering, constantly trained by previous measured data. The prediction and optimization was realized in the simulation environment INSEL and in Python. The implementation was so far carried out for only one building but will in the future include six buildings of the Plus-Energy settlement. Validation has shown an MAPE of the heat pump system of 22.8% (daily basis), an MAPE of the PV system of 22.1% (hourly basis), and MAPE values of the household electricity prediction of 47.0% (hourly basis) and 28.1% (daily basis). Thereby, it was found that user behavior poses the biggest inaccuracy and problems while weather forecast inaccuracy is acceptable, especially for thermal demand predictions. For optimization purposes of the heat pump's operation, it was decided to apply GA because of its suitability for this specific problem e.g., compared to PSO or rule-based heuristic approaches. Optimization for 24 h in advance with 2500 simulation runs resulted in approximately 2.5 h of computation time, which was mainly due to the white box thermal demand prediction. This optimization time could be reduced by a factor of 10, utilizing an RC (resistance capacity) model for thermal demand prediction, but would also result in more prediction inaccuracy.