Leviton issues since recent update

I have 9 of the Leviton VRPD3 modules working with HE since last March. My modules were all detected as fan controllers but there is more...

What I found (keep in mind this occurred over many HE firmware versions) is:

  1. The Generic Zwave dimmer driver works but I found the action report from the module was sometimes missed by HE.

  2. The Leviton Fan controller was very reliable.

  3. When the Fan controller was fine tuned for use with a fan, I used the converted ST dimmer driver to HE (simple search and replace). I've been using this driver for a few days now an it seems to be reliable.

My only guess is the Generic Zwave driver has some timing differences compared to the ST driver, and some network variable makes the Generic sometimes miss the module report.

The SmartThings drivers can be found here: ST Drivers

I guess this would explain the random mis-reporting of light status in cloud dashboard I have been seeing. (Lights turn on and off to selected tiles but light status does not update sometimes on cloud dashboard.)

OK, first try at this. I went to the smart-things link, copied the code, and tried to save. Got about 10-12 errors, sample
"physicalgraph.zwave.commands.basicv1.BasicSet @ line 155, column 16. unable to resolve class physicalgraph.zwave.commands.switchmultilevelv1.SwitchMultilevelReport @ line 159, column 16. unable to resolve class" type of errors.
Can I just safely remove the offending lines or is there more to the import?

Sorry, thought you might know....

simply replace: "physicalgraph" with "hubitat"

should be good to go :slight_smile:

OK, thanks. This is my first import. I will play some more to see if I can make it work. No hurry as my lights are currently working. I'll have to get back to Maxwell and let him know the Generic selection may not be the best.
Thanks again

OK, I got less errors:
unable to resolve class Hubitat.zwave.commands.basicv1.BasicReport @ line 151, column 16. unable to resolve class Hubitat.zwave.commands.basicv1.BasicSet @ line 155, column 16. unable to resolve class Hubitat.zwave.commands.switchmultilevelv1.SwitchMultilevelReport @ line 159, column 16. unable to resolve class Hubitat.zwave.commands.switchmultilevelv1.SwitchMultilevelSet @ line 163, column 16. unable to resolve class Hubitat.zwave.Command @ line 167, column 22. unable to resolve class Hubitat.zwave.commands.hailv1.Hail @ line 176, column 16. unable to resolve class Hubitat.zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport @ line 180, column 16. unable to resolve class Hubitat.zwave.commands.switchmultilevelv1.SwitchMultilevelStopLevelChange @ line 191, column 16. unable to resolve class Hubitat.zwave.commands.crc16encapv1.Crc16Encap @ line 195, column 16. unable to resolve class Hubitat.zwave.Command @ line 205, column 16.

What should I look for next? Are there doc files to look for about conversions? (my Google-Foo seems weak tonight)

Just looking back at your example and realized I capitalize Hubitat when you didn't. Hopefully that's not the error.

I think Hubitat needs to be hubitat (no caps)
at any rate here is the driver code I'm currently using:

    /**
 *  
 * https://github.com/SmartThingsCommunity/SmartThingsPublic/tree/master/devicetypes/smartthings/zwave-dimmer-switch-generic.src 
 *
 *  originally was SmartThings "switch - dimmer" driver.
 *   2018-12-09 - in process of converting to Hubitat for WD500Z-1 dimmers (never completed)
 *	 2019-01-18 - Installed to work the Leviton Dimmer Modules VRPD3
 * Copyright 2015 SmartThings
 *
 *  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:
 *
 *
 *
 */
metadata {
	definition(name: "Z-Wave Dimmer Switch Generic (Leviton)", namespace: "smartthings", author: "SmartThings") {
		capability "Switch Level"
		capability "Actuator"
		capability "Health Check"
		capability "Switch"
		capability "Polling"
		capability "Refresh"
		capability "Sensor"
		capability "Light"

		fingerprint inClusters: "0x26", deviceJoinName: "Z-Wave Dimmer"
		fingerprint mfr: "001D", prod: "1902", deviceJoinName: "Z-Wave Dimmer"
		fingerprint mfr: "001D", prod: "3301", model: "0001", deviceJoinName: "Leviton Dimmer Switch"
		fingerprint mfr: "001D", prod: "3201", model: "0001", deviceJoinName: "Leviton Dimmer Switch"
		fingerprint mfr: "001D", prod: "1B03", model: "0334", deviceJoinName: "Leviton Universal Dimmer"	// this matches our Leviton
		fingerprint mfr: "001D", prod: "1001", model: "0334", deviceJoinName: "Leviton 3-Speed Fan Controller"
		fingerprint mfr: "001D", prod: "0602", model: "0334", deviceJoinName: "Leviton Magnetic Low Voltage Dimmer"
		fingerprint mfr: "001D", prod: "0401", model: "0334", deviceJoinName: "Leviton 600W Incandescent Dimmer"
		fingerprint mfr: "0039", prod: "5044", model: "3033", deviceJoinName: "Honeywell Z-Wave Plug-in Dimmer (Dual Outlet)"
		fingerprint mfr: "0039", prod: "5044", model: "3038", deviceJoinName: "Honeywell Z-Wave Plug-in Dimmer"
		fingerprint mfr: "0039", prod: "4944", model: "3038", deviceJoinName: "Honeywell Z-Wave In-Wall Smart Dimmer"
		fingerprint mfr: "0039", prod: "4944", model: "3130", deviceJoinName: "Honeywell Z-Wave In-Wall Smart Toggle Dimmer"
		fingerprint mfr: "0063", prod: "4944", model: "3034", deviceJoinName: "GE In-Wall Smart Fan Control"
		fingerprint mfr: "0063", prod: "4944", model: "3131", deviceJoinName: "GE In-Wall Smart Fan Control"
		fingerprint mfr: "0039", prod: "4944", model: "3131", deviceJoinName: "Honeywell Z-Wave Plus In-Wall Fan Speed Control"
		//fingerprint mfr: "014F", prod: "5744", model: "3530", deviceJoinName: "Linear In-Wall Dimmer"
	}  // --- end of definition ---

}  //  --- end of metadata ---s
/*
WD500Z-1
deviceType: 17495
inClusters: 0x26,0x2B,0x2C,0x27,0x73,0x70,0x86,0x72
deviceId: 12340  
manufacturer: 335  (0x014F)

Z-Wave Product ID: 0x3034   <--- fingerprint seems to be :  low byte, hi byte
Z-Wave Product Type: 0x4457
*/


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, offlinePingable: "1"])
	def commands = refresh()
	
/*
	if (zwaveInfo?.mfr?.equals("001A")) {
		commands << "delay 100"
		//for Eaton dimmers parameter 7 is ramp time. We set it to 1s for devices to work correctly with local execution
		commands << zwave.configurationV1.configurationSet(configurationValue: [1], parameterNumber: 7, size: 1).format()
	} else if (isHoneywellDimmer()) {
		//Set ramp time to 1s for this device to turn off dimmer correctly when current level is over 66.
		commands << "delay 100"
		//Parameter 7 - z-wave ramp up/down step size, Parameter 8 - z-wave step interval equals configurationValue times 10 ms
		commands << zwave.configurationV1.configurationSet(configurationValue: [1], parameterNumber: 7, size: 1).format()
		commands << "delay 200"
		commands << zwave.configurationV1.configurationSet(configurationValue: [0, 1], parameterNumber: 8, size: 2).format()
		commands << "delay 200"
		//Parameter 7 - manual operation ramp up/down step size, Parameter 8 - z-wave manual operation interval equals configurationValue times 10 ms
		commands << zwave.configurationV1.configurationSet(configurationValue: [1], parameterNumber: 9, size: 1).format()
		commands << "delay 200"
		commands << zwave.configurationV1.configurationSet(configurationValue: [0, 1], parameterNumber: 10, size: 2).format()
	}
*/
	response(commands)
}

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, offlinePingable: "1"])
}

def getCommandClassVersions() {
	[
		0x20: 1,  // Basic
		0x26: 1,  // SwitchMultilevel
		0x56: 1,  // Crc16Encap
	]
}

def parse(String description) {
	def result = null
	if (description != "updated") {
		log.debug "parse() >> zwave.parse($description)"
		def cmd = zwave.parse(description, commandClassVersions)
		if (cmd) {
			result = zwaveEvent(cmd)
		}
	}
	return result
}

def zwaveEvent(hubitat.zwave.commands.basicv1.BasicReport cmd) {
	dimmerEvents(cmd)
}

def zwaveEvent(hubitat.zwave.commands.basicv1.BasicSet cmd) {
	dimmerEvents(cmd)
}

def zwaveEvent(hubitat.zwave.commands.switchmultilevelv1.SwitchMultilevelReport cmd) {
	dimmerEvents(cmd)
}

def zwaveEvent(hubitat.zwave.commands.switchmultilevelv1.SwitchMultilevelSet cmd) {
	dimmerEvents(cmd)
}

private dimmerEvents(hubitat.zwave.Command cmd) {
	def value = (cmd.value ? "on" : "off")
	def result = [createEvent(name: "switch", value: value)]
	if (cmd.value && cmd.value <= 100) {
		result << createEvent(name: "level", value: cmd.value == 99 ? 100 : cmd.value)
	}
	return result
}

def zwaveEvent(hubitat.zwave.commands.hailv1.Hail cmd) {
	createEvent([name: "hail", value: "hail", descriptionText: "Switch button was pressed", displayed: false])
}

def zwaveEvent(hubitat.zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport cmd) {
	log.debug "manufacturerId:   $cmd.manufacturerId"
	log.debug "manufacturerName: $cmd.manufacturerName"
	log.debug "productId:        $cmd.productId"
	log.debug "productTypeId:    $cmd.productTypeId"
	def msr = String.format("%04X-%04X-%04X", cmd.manufacturerId, cmd.productTypeId, cmd.productId)
	updateDataValue("MSR", msr)
	updateDataValue("manufacturer", cmd.manufacturerName)
	createEvent([descriptionText: "$device.displayName MSR: $msr", isStateChange: false])
}

def zwaveEvent(hubitat.zwave.commands.switchmultilevelv1.SwitchMultilevelStopLevelChange cmd) {
	[createEvent(name: "switch", value: "on"), response(zwave.switchMultilevelV1.switchMultilevelGet().format())]
}

def zwaveEvent(hubitat.zwave.commands.crc16encapv1.Crc16Encap cmd) {
	def versions = commandClassVersions
	def version = versions[cmd.commandClass as Integer]
	def ccObj = version ? zwave.commandClass(cmd.commandClass, version) : zwave.commandClass(cmd.commandClass)
	def encapsulatedCommand = ccObj?.command(cmd.command)?.parse(cmd.data)
	if (encapsulatedCommand) {
		zwaveEvent(encapsulatedCommand)
	}
}

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

def on() {
	delayBetween([
		zwave.basicV1.basicSet(value: 0xFF).format(),
		zwave.switchMultilevelV1.switchMultilevelGet().format()
	], 5000)
}

def off() {
	delayBetween([
		zwave.basicV1.basicSet(value: 0x00).format(),
		zwave.switchMultilevelV1.switchMultilevelGet().format()
	], 5000)
}

def setLevel(value) {
	log.debug "setLevel >> value: $value"
	def valueaux = value as Integer
	def level = Math.max(Math.min(valueaux, 99), 0)
	if (level > 0) {
		sendEvent(name: "switch", value: "on")
	} else {
		sendEvent(name: "switch", value: "off")
	}
	delayBetween([zwave.basicV1.basicSet(value: level).format(), zwave.switchMultilevelV1.switchMultilevelGet().format()], 5000)
}

def setLevel(value, duration) {
	log.debug "setLevel >> value: $value, duration: $duration"
	def valueaux = value as Integer
	def level = Math.max(Math.min(valueaux, 99), 0)
	def dimmingDuration = duration < 128 ? duration : 128 + Math.round(duration / 60)
	def getStatusDelay = duration < 128 ? (duration * 1000) + 2000 : (Math.round(duration / 60) * 60 * 1000) + 2000
	delayBetween([zwave.switchMultilevelV2.switchMultilevelSet(value: level, dimmingDuration: dimmingDuration).format(),
				  zwave.switchMultilevelV1.switchMultilevelGet().format()], getStatusDelay)
}

def poll() {
	refresh()
}

/**
 * PING is used by Device-Watch in attempt to reach the Device
 * */
def ping() {
	refresh()
}

def refresh() {
	log.debug "refresh() is called"
	def commands = []
	commands << zwave.switchMultilevelV1.switchMultilevelGet().format()
	if (getDataValue("MSR") == null) {
		commands << zwave.manufacturerSpecificV1.manufacturerSpecificGet().format()
	}
	delayBetween(commands, 100)
}
//   --- eof ---

of course that was it. changed all and got a clean save

@patrick after the latest firmware update
I HAVE 3 Leviton DZ15S-1BZ that have stopped reporting manual switching states to HE
they work fine for commands from HE though and If I push refresh or poll for each switch then they report their current states.

But my 2 Leviton DZ1KD-1BZ dimmer switches appear to still work fine

What driver are you using for this device?

I used the code above from JohnRob and functionality is now restored. Works with Alexa, works under devices in Hubitat and works in my dashboard again.

I was using the hubitat generic zwave switch which was working
then I tried my old custom switch driver with the same results
I also tried to do a zwave repair with no luck.
I did a factory reset with 2 of the 3 switches but now I have to rejoin them.
I ran out of time I will have to look at them tomorrow.

The generic zwave switch driver didn't change in any recent release, certainly not in 2.0.9, and there were no zwave platform changes.

thanks I should have tried rebooting the hub before factory resetting the 2 switches.
I will try in the morning.
Just strange 3 of the exact same model switches stopped at the same time but it could happen.
I will remote in and have the hub do a reboot then check when I get home.

Just a thought - the behavior you are seeing is typical of these switches (and the dimmers) if you don't upgrade the firmware to the latest version . They will work with the generic z-wave but not the z-wave plus driver. Its a pain - but you may want to consider this if things don't function as you expect. Odd that you are only seeing this with the new firmware.

thanks I have updated the firmware on all the switches last one a few months ago
likely just the hub needing a reboot or another zwave device causing interference
I do have a GE zwave switch that had caused issues with my zwave locks before whenever I manually pressed it's switch. I factory reset this problem switch and relocated it to an outlet that never gets used manually but maybe it is getting worse and causing issues.

Have you checked they actually updated? Several of mine took a couple or three attempts before it worked? Wasn't clear that it failed during the process but on going back they were shown to have not change.

yes they all were at version 1.20 firmware.
looks like rebooting the hub fixed the issue
had to rejoin the 2 I factory reset but they are working now as well.
very strange it was only affecting those model types.

thanks

I know its working for you but these switches should be using the Generic Zwave Smart Switch driver as they are z-wave plus. Otherwise I believe the instant status updates may not work properly.

1 Like

thanks they were using Generic Zwave Smart Switch driver but I actually didn't notice until you mentioned it that there was a Generic Zwave Switch (non smart) driver so good to know.