Flowmeters and smart toilets will warn of trouble in the treatment train before environmental issues or system failure sets in