It's such a great idea that it has already gone back in time from your shower experience to say, five years ago when Malcolm Beattie first wrote the B module.
it's a work in progress. Many people are already working on the solution exactly as you say it, and it's not trivial.