This sounds almost feasible if one feels comfortable to install a flow meter and a thermometer into the tap, and to hook it up with a microcontroller. Setting a certain temperature requires more work. I wonder whether there are products on the market for this already.