A way to detect water on floor

yep that works

(something similar mentioned there Using two wires to detect water - making your own water sensor - #5 by Peter_I)