Most stormwater control measures (SCMs) are designed to passively capture, retain or remove water through infiltration or evapotranspiration. In many types of SCMs, underdrain systems are utilized to avoid flooding, ensure the ponded water is drained within a certain time, and make capacity available for consecutive events. However, the existence of underdrain can reduce the effectiveness of SCMs by creating a bypass route during high flow conditions and therefore reducing the retention time in such systems. Active control systems based on weather prediction can be a cost-effective solution to optimize the performance of SCMs. Using such systems, water can be retained in the system for a longer period when there is no precipitation in the forecast and can be released with a rain event is expected. In this research, we evaluated the degree of effectiveness of a forecast-based real-time control in reducing the peak runoff out of an SCM. A baseline model of a dual bioretention system was first calibrated based on real hydraulic data. Then we added features representing real-time control of the water release through underdrain pipes. Various schemes for control of the release based on aggregate quantities representing future rain were developed, and their impact on peak flow and volume reduction was tested. For this purpose, we used the agile OpenHydroQual framework for the simulation of the hydraulic processes in the contributing catchment areas and within the bioretention system and also for optimizing the control rules to maximize the long-term effectiveness of the bioretention system.