there are no simple solutions. the leakage can appear anywhere in the system. the discharge can be fast or slow, it can be regular or occur in specific condition (of temperature for example).
the timer is not the solution as it can cut the water when you are just second or third taking shower.
the only way is to implement AI to distinguish leakage loss from normal water consumption.
kind of analysis of presence of crew, times of running for FW and bilge pumps etc.
the only reasonable way is to switch it off when needn't and, when on, watch FW and bilge pumps indicators as you must do for all other things as a responsible sailor under COLREG-72.