A system, a method and computer-readable media for automating interaction with a host computer. The collection valve includes an inlet connected to the main drain line, and an outlet connectable which can be switched to either a black water drain line or a gray water drain line, depending upon which type of water flow is detected. Each client object and server object is instantiated from a class derived from a base class.