Abstract: The present invention presents both a method and system for controlling a stormwater management facility to operate in any one of a plurality of operational modes, each of which has differing environmental benefits resulting from its treatment of the stormwater that passes through the facility. A preferred embodiment of this system includes: an actuated control valve, a depth sensor, a valve controller that has internet connectivity and sensor interfaces and a user input means, controller software configured to control the operation of the control valve to operate in one of its plurality of operating modes, and private-cloud-based, internet-accessible, engine software that is configured to utilize weather forecasts to calculate a temporally-varying, targeted depth for the stormwater in the facility that maximizes the volume of stormwater treated in the SWM facility.