My water heater sits on top of a rubber pan and has a standalone battery operated water detector sitting on the edge. It will sound an alarm if water is detected. It's about $12 for two in Amazon. Low tech and it works.
My washing machine sits on the floor in the bathroom, but Danish apartment building regulations require there to be a floor drain (which is just the shower drain in this case) in case of a leak.
Even lower tech!