We present and evaluate an IoT-enabled sensing and actuating system for localizing illegal industrial harsh discharges of polluting wastewater in sewer networks. The special conditions of the sewer environment bring special challenges for the design of an IoT system and of its real-time algorithm for anomaly detection and localization in wastewater networks. The proposed design fulfills these requirements by using a new IoT architecture pattern, which we generalize and name Hop-by-hop Anomaly Detection and Actuation (HADA). The distributed anomaly detection and localization algorithm makes predictions over previous sensor measurements, while taking into account seasonality effects of wastewater and noise of the sensors. Based on simulations in a large network with three common illegal industrial wastewater pollutants, the advantages and limitations of the proposed wastewater anomaly localization system are discussed. The IoT system, including its anomaly detection and localization algorithm, was implemented using in a low-power microcontroller and tested in flowing wastewater with different harsh industrial waste.