Feature Request: Virtual Water Sensor

My Elk alarm system has water sensors on it. They show up as contact sensors, so it's not ideal for HSM. Can we get a virtual water sensor?

Doing this on my phone - modifying a virtual motion sensor posted by @cwwilson08, so I hope it's correct. I think it is:

metadata {
	definition (name: "Virtual water sensor with Switch", namespace: "cw", author: "cwwilson08") {
		capability "Sensor"
		capability "Water Sensor"
        capability "Switch"
	}   
}

def on() {
    sendEvent(name: "water", value: "wet")
    sendEvent(name: "switch", value: "on")
}

def off() {
    sendEvent(name: "water", value: "dry")
    sendEvent(name: "switch", value: "off")
}

def installed() {
}

Edit: Tested it - it works as designed.

6 Likes

Just found this driver, works fine for me too. Thanks!

1 Like