How to turn off a switch based on flood sensor input

Take a look at rule machine smartapp