Can a Flood Sensor be flipped to Alert when there is NO WATER?

@celblazer I have tried cutting and pasting your no water code and get Metadata definition not found.

I am not a coder so any pointers very welcome

I worked it out in the end by trial and error to the below
/*** No Water

Could you post the code that worked? I have tried the first couple with different errors from the IDE.

Since I’m lazy I copied the code from the Template > Flood Alert! and switched it to ‘dry’ with my device ‘Aeon Labs DSB45 Water Sensor’. Here’s the code:

definition(
name: “Dry Alert!”,
namespace: “smartthings”,
author: “SmartThings”,
description: “Get a push notification or text message when water is NOT detected.”,
category: “Safety & Security”,
iconUrl: “https://s3.amazonaws.com/smartapp-icons/Meta/water_moisture.png”,
iconX2Url: “https://s3.amazonaws.com/smartapp-icons/Meta/water_moisture@2x.png
)

preferences {
section(“When there’s NO water detected…”) {
input “alarm”, “capability.waterSensor”, title: “Where?”
}
section(“Send a notification to…”) {
input(“recipients”, “contact”, title: “Recipients”, description: “Send notifications to”) {
input “phone”, “phone”, title: “Phone number?”, required: false
}
}
}

def installed() {
subscribe(alarm, “water.dry”, waterWetHandler)
}

def updated() {
unsubscribe()
subscribe(alarm, “water.dry”, waterWetHandler)
}

def waterWetHandler(evt) {
def deltaSeconds = 60

def timeAgo = new Date(now() - (1000 * deltaSeconds))
def recentEvents = alarm.eventsSince(timeAgo)
log.debug "Found ${recentEvents?.size() ?: 0} events in the last $deltaSeconds seconds"

def alreadySentSms = recentEvents.count { it.value && it.value == "dry" } > 1

if (alreadySentSms) {
	log.debug "SMS already sent within the last $deltaSeconds seconds"
} else {
	def msg = "${alarm.displayName} is dry!"
	log.debug "$alarm is dry, texting phone number"

	if (location.contactBookEnabled) {
		sendNotificationToContacts(msg, recipients)
	}
	else {
		sendPush(msg)
		if (phone) {
			sendSms(phone, msg)
		}
	}
}

}