A sewer pipe that could detect what’s passing through it would actually have all kinds of practical uses!
I wonder how feasible it would be to embed chemical sensors into such an environment.
Governments sometimes analyse waste water for drugs and drug metabolites. You can't pinpoint specific houses' drug use, but you get get trends and general population data.