## 4 Methodology and Prototype Implementation
### The Smart Grid Traffic Light Concept  
Different parties are interested in utilizing the flexibility that can be provided by DERs. For example, electricity suppliers with access to the wholesale electricity market can use flexibility for cheaper procurement of energy, or distribution system operators that are interested in guaranteeing grid stability can use flexibility to keep voltage within a valid range or to prevent transformer overloads. Due to different parties interested in accessing flexibility provided by DERs, smart grid traffic light concepts provide a model for the interaction between market participants and grid operators. Different definitions of smart grid traffic light concepts exist, such as [22]. A comprehensive discussion of this concept can be found in [38]. In general, following the logic of a traffic light, at least three traffic light phases are defined, with the default being the green phase. During a green phase, there are no restrictions, only incentives. Yellow phases introduce some constraints, and red phases allow massive interference. The yellow or red phase can be activated according to the needs of the electrical grid. Such a need is usually identified by the (distribution) system operator. In the SMGW infrastructure, the implementation of demand response measures requires the role of the aEMP. In our implementation we use one aEMP to transmit the traffic light phases. However, depending on the future system design, it is worth noting that two aEMPs could be used. One could represent an electricity supplier providing time-variable prices being in control in the green and yellow phase, and the other could represent a (distribution) system operator being in control in the yellow and red phase, ensuring grid stability. For our prototype, in the green phase charging is allowed at maximum power without any limitations. In the yellow and red phases, the charging power is limited to individual maximum threshold values. In this paper, we only consider the limitations of the power consumed in the yellow and red phases, which implies grid instability due to insufficient supply. In general, however, the yellow and red phases can also be activated due to oversupply, for instance, as a result of temporary high generation by renewable energy sources. Furthermore, if we added more DERs, the EMS could try to satisfy these constraints without throttling or interrupting the charging process, as it would be sufficient to consider the total demand of all DERs.  
In our prototype implementation, a communicated traffic light phase lasts until another change is communicated by the aEMP. In the green phase, the EMS optimizes based on the daily time-variable electricity prices that are communicated to the EMS from the aEMP via the secure communication channel. It provides electricity prices (in \(\mathfrak{C}\) per kWh) for each of the upcoming 72 h. Based on the provided consumer restrictions (availability of the EV and required energy), the EMS minimizes the charging costs over the respective charging period by gradually choosing the cheapest time intervals for charging until the required energy is reached. In the green traffic light phase, this happens without further limitations. In the yellow traffic light phase, we chose the aEMP to request a fixed power limit; that is, a maximum of 6 kW in our prototype. This limit is then considered by the EMS in its optimization. In the red phase, we chose the aEMP to request the complete interruption of the charging process; i.e., to curtail the charging to 0 kW.