checkInterval from Health Check doesn't seem to work for me

I'm looking for a way to monitor my WaterCop valve connection (without changing the valve position.

I've duplicated what I believe is a feature of the "Health Check" capability (checkInterval).

From the little I could find I was under the impression the checkInterval would create a timer of sorts in Hubitat that would "ping" the WaterCop. While I understand the concept of "ping" in this implementation I'm not sure if the "ping" comes from Hubitat OS or it runs the ping() method in the driver code.

In any case it is not working. There are no logs created after the 32 minutes. I verifies the "checkInterval" line of code was run by using the device panel button "Lucy" forcing the checkInterval code to run.

I've considered there needs to be a capability missing in the WaterCop but don't know.

The valve supports:

  • COMMAND_CLASS_BASIC
  • COMMAND_CLASS_SWITCH_BINARY
  • COMMAND_CLASS_MANUFACTURER_SPECIFIC
  • COMMAND_CLASS_ALARM

Any suggestions will be appreciated.
John

Device driver code:

/**
 *  2020-02-16 WaterCop Z-Wave Driver
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 */
metadata {
	definition (name: "WaterCopValveV2", namespace: "hubitat", author: "various") {
		capability "Actuator"
		capability "Health Check"
		capability "Valve"
		capability "Refresh"
		capability "Sensor"

        command "lucy"   // added for test purposes

		fingerprint deviceId: "0xAA08", inClusters: "0x25,0x72,0x86,0x71,0x22,0x70"
		fingerprint mfr:"0132", deviceJoinName: "WaterCop Valve"
	}
}

def installed(){
// Device-Watch simply pings if no device events received for 32min(checkInterval)
	sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
	response(refresh())
}

def updated(){
// Device-Watch simply pings if no device events received for 32min(checkInterval)
	sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
}

def parse(String description) {
	log.trace description
	def cmd = zwave.parse(description)
    log.trace "cmd=$description"
	if (cmd) {
		return zwaveEvent(cmd)
	}
	log.debug "Could not parse message"
	return null
}

def zwaveEvent(hubitat.zwave.commands.switchbinaryv1.SwitchBinaryReport cmd) {
	def value = cmd.value ? "closed" : "open"

	return createEventWithDebug([name: "valve", value: value, descriptionText: "$device.displayName valve is $value"])
}

def zwaveEvent(hubitat.zwave.Command cmd) {
	return createEvent([:]) // Handles all Z-Wave commands we aren't interested in
}

def open() {
	delayBetween([
		zwave.switchBinaryV1.switchBinarySet(switchValue: 0x00).format(),
		zwave.switchBinaryV1.switchBinaryGet().format()
	], 500)
}

def close() {
	delayBetween([
		zwave.switchBinaryV1.switchBinarySet(switchValue: 0xFF).format(),
		zwave.switchBinaryV1.switchBinaryGet().format()
	], 500)
}

/**
 * PING is used by Device-Watch in attempt to reach the Device
 * */
def ping() {
    log.debug "we be in ping...."
	refresh()
}

def refresh() {
	zwave.switchBinaryV1.switchBinaryGet().format()
}

def createEventWithDebug(eventMap) {
    log.debug " Event Map ${eventMap}"
	def event = createEvent(eventMap)
	log.debug "Event created with ${event?.name}:${event?.value} - ${event?.descriptionText}"
	return event
}

def lucy() {
	log.debug "Lucy"
    updated()
    zwave.basicV1.basicGet().format()
    //zwave.switchBinaryV1.switchBinaryGet().format()
}
// --- eof ---

I'll be curious what staff say (or anyone who happens to know), but my assumptions has always been that this is an accidental inclusion in their docs, perhaps a carryover from SmartThings that they once thought about implementing but never did. I've never seen a stock driver use it as far as I can tell, and the only community drivers I've seen with it were hasty ports from ST.

@bobbyD @mike.maxwell

That would explain the not working part.

Thanks
John

The health check capability doesn't schedule anything in Hubitat.
It's included so ported drivers using it don't blow up.
Honestly I don't know what this does over there, but if all it does is schedule a job, you don't need a capability to do that for you.

1 Like

Thanks Mike.

To schedule a job would I just use "runin" or there other options.

John

use schedule(), which will accept a cron string

1 Like