Need suggested driver for Ecolink DWZWAVE2.5-ECO Door Window Contact Sensor

I have an external float switch (normally open) wired to the secondary contacts of an Ecolink Z-Wave Plus Door Window Contact Sensor (DWZWAVE2.5-ECO) to monitor any extremely high water level in my sump pit. Using the Generic Z-Wave Contact Sensor device type, the device appears red (open) in my Hubitat dashboards. I would like to reverse the device status display, i.e. show green when open and red when closed.

Are there any other zwave device drivers with a “reverse status” preference setting compatible with the Ecolink DWZWAVE2.5-ECO?

I know that there are other ways to accomplish this: a) like creating a virtual device and adding rules to set the status of the virtual device, or b) turning the float switch upside down. I just want to simply use another device driver.

You can probably get the AI agent of your choice to code a suitable driver. Here's one from Gemini that permits the contact status to be inverted and also implements configurable debouncing.

You can, if you wish, try this out. It will probably need a few iterations of feedback & vibe-coding to get it work perfectly for your needs.

/**
 *  Ecolink DWZWAVE2.5-ECO Custom Driver (with Inversion and Debounce)
 *  Source/Reference: Hubitat Developer Guidelines
 */

metadata {
    definition (name: "Ecolink DWZWAVE2.5-ECO Custom", namespace: "custom", author: "Community AI", importUrl: "") {
        capability "ContactSensor"
        capability "Battery"
        capability "Configuration"
        capability "Refresh"

        attribute "tamper", "string"

        // Fingerprint for the Ecolink DWZWAVE2.5-ECO
        fingerprint mfr: "014A", prod: "0004", deviceId: "0002", inClusters: "0x5E,0x86,0x72,0x30,0x71,0x35,0x70,0x85,0x59,0x84,0x7A,0x80"
    }

    preferences {
        input name: "invertContact", type: "boolean", title: "Invert Contact Status", description: "If enabled, open reports as closed and closed reports as open.", defaultValue: false
        input name: "debounceDelay", type: "number", title: "Debounce Delay (ms)", description: "Time in milliseconds to wait before committing state change. Set to 0 to disable.", defaultValue: 0
        input name: "logEnable", type: "boolean", title: "Enable debug logging", defaultValue: true
        input name: "txtEnable", type: "boolean", title: "Enable descriptionText logging", defaultValue: true
    }
}

// Parse incoming messages from the device
def parse(String description) {
    if (logEnable) log.debug "parse description: ${description}"
    
    def cmd = zwave.parse(description, [0x20: 1, 0x30: 1, 0x71: 3, 0x80: 1, 0x84: 1])
    if (cmd) {
        return zwaveEvent(cmd)
    } else {
        log.warn "Could not parse description to Z-Wave command: ${description}"
        return null
    }
}

// Handle Sensor Binary Reports (Alternative open/close method)
def zwaveEvent(hubitat.zwave.commands.sensorbinaryv1.SensorBinaryReport cmd) {
    if (logEnable) log.debug "SensorBinaryReport received: ${cmd}"
    def rawValue = (cmd.sensorValue == 0xFF) ? "open" : "closed"
    processContactEvent(rawValue)
    return null
}

// Handle Notification Reports (Standard modern Ecolink open/close & tamper)
def zwaveEvent(hubitat.zwave.commands.notificationv3.NotificationReport cmd) {
    if (logEnable) log.debug "NotificationReport received: ${cmd}"
    
    // Access Control (0x06) manages the contact state
    if (cmd.notificationType == 0x06) {
        if (cmd.event == 0x16) {
            processContactEvent("open")
        } else if (cmd.event == 0x17) {
            processContactEvent("closed")
        }
    } 
    // Home Security (0x07) manages Tamper
    else if (cmd.notificationType == 0x07) {
        if (cmd.event == 0x03) {
            if (txtEnable) log.info "${device.displayName} tamper detected"
            sendEvent(name: "tamper", value: "detected", descriptionText: "${device.displayName} tamper detected")
        } else if (cmd.event == 0x00) {
            if (txtEnable) log.info "${device.displayName} tamper cleared"
            sendEvent(name: "tamper", value: "clear", descriptionText: "${device.displayName} tamper cleared")
        }
    }
    return null
}

// Handle Battery Reports
def zwaveEvent(hubitat.zwave.commands.batteryv1.BatteryReport cmd) {
    if (logEnable) log.debug "BatteryReport received: ${cmd}"
    def val = cmd.batteryLevel == 0xFF ? 0 : cmd.batteryLevel
    if (txtEnable) log.info "${device.displayName} battery is ${val}%"
    return createEvent(name: "battery", value: val, unit: "%", descriptionText: "${device.displayName} battery is ${val}%")
}

// Process state changes including inversion and debounce filtering
def processContactEvent(String rawValue) {
    // 1. Apply inversion rules if preferred
    def targetValue = rawValue
    if (invertContact == true) {
        targetValue = (rawValue == "open") ? "closed" : "open"
        if (logEnable) log.debug "Inversion active. Raw value: ${rawValue} changed to: ${targetValue}"
    }

    // 2. Check if the incoming state is actually a change to prevent repeating events
    if (device.currentValue("contact") == targetValue) {
        if (logEnable) log.debug "Contact state is already ${targetValue}, filtering out event."
        unschedule("commitDebouncedContact") // Cancel any pending conflicting debounce triggers
        return
    }

    // 3. Handle Debouncing logic
    int delay = debounceDelay ? debounceDelay.toInteger() : 0
    if (delay > 0) {
        if (logEnable) log.debug "Debounce active. Scheduling execution of state [${targetValue}] in ${delay}ms"
        // Store target state in transient state to pass into the execution handler safely
        runInMillis(delay, "commitDebouncedContact", [data: [value: targetValue]])
    } else {
        // Instant execution if delay is 0 or unassigned
        commitDebouncedContact([value: targetValue])
    }
}

// Handler execution tasked by Hubitat's job scheduler
def commitDebouncedContact(Map data) {
    def finalValue = data.value
    if (txtEnable) log.info "${device.displayName} is ${finalValue}"
    sendEvent(name: "contact", value: finalValue, descriptionText: "${device.displayName} is ${finalValue}")
}

// Catch-all fallback for unhandled commands
def zwaveEvent(hubitat.zwave.Command cmd) {
    if (logEnable) log.debug "Unhandled Z-Wave command: ${cmd}"
    return null
}

def refresh() {
    if (logEnable) log.debug "refresh()"
    return [
        zwave.batteryV1.batteryGet().format(),
        zwave.sensorBinaryV1.sensorBinaryGet().format()
    ]
}

def configure() {
    if (logEnable) log.debug "configure()"
    return refresh()
}

def updated() {
    log.info "Updating settings..."
    if (logEnable) log.debug "Current preferences - Invert: ${invertContact}, Debounce: ${debounceDelay}ms"
    if (!state.configured) {
        state.configured = true
        return configure()
    }
    return null
}

Thanks. I was hoping for an existing driver that was already debugged and tested. I have never written any drivers or apps for HE.

never used it, but sounds like what you are looking for. If you search for reversible zwave contact in the forum, you may find other options.

If I remember correctly, my driver works with this type of contact (even though it was designed for an older version). It does not have the "reverse" feature, but I could add it in.

That would be great, if it’s not too much trouble. I have tried several of the other drivers recommended but none were as needed. Thanks

Making changes to it now. I will send you a message with a link to one to test. If you try it out and it works, I will ask to have the original thread reopened and officially post it there.

Thanks for all the ideas. All the various driver options seemed to add some complexity that I didn’t want to manage.

So focusing on what I want to accomplish, I’ve decided to continue using the Generic Z-Wave Contact Sensor driver and a virtual device paired with the Mirror app.

No worries. Like most of my drivers, it has added features over time as other people (or myself) think of additional uses, on top of all the basic stuff I include. Sorry it did not make things easier for you.