[OBSOLETE] Z-Wave Tweaker

z-wave Tweaker
Version: 0.08 (2017-03-16)
Source: https://github.com/codersaur/SmartThings/tree/master/devices/zwave-tweaker


This is a device handler to assist with interrogating and tweaking Z-Wave devices. It’s designed for end-users who want to tweak their devices and for developers who want to quickly discover and report the functionality of new devices. It is intended to temporarily replace a device’s normal device handler.

Key features in v0.08:

  • Discover association groups, multi-channel endpoints, and configuration parameters.
  • Configure association group members from the SmartThings GUI.
  • Configure parameter values from the SmartThings GUI.
  • Configure Protection and Switch_All modes from the SmartThings GUI.
  • Discover supported meter/alarm/notification/sensor report types.
  • Automatically build a complete list of the Z-Wave commands sent by a device.
  • Support for Z-Wave and Z-Wave Plus devices.
  • Extensive inline code comments to support community development.

Main screens:

Example Output:

General Info:


Discovered Association Groups:

Discovered Endpoints:

Discovered Parameters:

Comands:

Full installation instructions and a user guide can be found on github: https://github.com/codersaur/SmartThings/tree/master/devices/zwave-tweaker

All feedback welcome!

Z

40 Likes

Awesome Sauce! This should make it way easier for noobs to get into developing DTH!

Thanks.

1 Like

Very slick! :sunglasses:

Tagging @duncan @tyler @gausnes @jody.albritton @slagle @Robert_Vandervoort @krlaframboise @adamv @Fuzzyligic @erocm1231

2 Likes

Holy awesome sauce!

1 Like

@zcapr17 Very cool! I was actually working on something similar, but never got around to finishing it. Yours looks much more involved any way so well done. The long term goal I wanted to achieve was to provide developers with a few commands and methods that they could put into their device handlers for the SmartApp to interact with. For example.

command “configurationSet” [“number”, “number”]
command “associateGroup”, [“number”, “list”]

For an example of the method that would need to be placed in a handler you can see Generic Z-Wave Association Handler and the SmartApp Z-Wave Direct Association Tool.

My version was far from finished and I really don’t have time to anyway. Plus what you have done is fantastic work. Not sharing this info as any indication of competing, I just think it would be cool to have a common way to interface your tool with current and new device handlers (in addition to having a temporary tool device handler).

3 Likes

I considered controlling this kind of thing with a SmartApp, but unless there is a widely-adopted standard capability/interface then I can’t see it getting off the ground. Some kind of “Z-Wave Configurable” capability perhaps…?

I think a better solution would be for SmartThings to simply handle tweaking of Z-Wave device parameters and association groups etc. natively as part of the platform (i.e. just another auto-generated section of the settings screen).

3 Likes

First off I want to say awesome job on this. I find my self often temporarily adding code into an existing DTH to try and do just some of what you have done with a UI to boot. I see this becoming one of my regular tools for working with Z-Wave devices. I did find a small bug (it maybe something unique to the device I am working with it seems to be misbehaving in general). Every time it tried to initialize I would get a null reference error. The issue was that the list of command ID’s had a null entry. I added the line “ccIds.removeAll([null])” to the section of the initialize function that parses the fingerprint and it solved the issue:

// Parse fingerprint for supported command classes:
def ccIds = []
if (getZwaveInfo()?.cc) {
    logger("Device has new-style fingerprint: ${device.rawDescription}","info")
    ccIds = getZwaveInfo()?.cc + getZwaveInfo()?.sec
    ccIds.removeAll([null])
}
else {
    logger("Device has legacy fingerprint: ${device.rawDescription}","info")
    // Look for hexadecimal numbers (0x##) but remove the first one, which will be deviceID.
    ccIds = device.rawDescription.findAll(/0x\p{XDigit}+/)
    if (ccIds.size() > 0) { ccIds.remove(0) }
}
2 Likes

Added in v0.08.

1 Like

Yes, I have been wanting this for years . . .

2 Likes

Truly great work putting this amazing (and very helpful) DTH together! Thank you, thank you, thank you.

1 Like

Has anyone tested this with Leviton DZ6HD Dimmers? When I click on Scan General for that kind of device I get:
scanGeneral(): Scanning for common device attributes

And then nothing. Same for Scan Params.

What do you get from the print commands?

For the ‘Print General’ I get:
Device Name: Dining Room
Raw Description: zw:L type:1101 mfr:001D prod:3201 model:0001 ver:1.13 zwv:4.33 lib:03 cc:5E,85,59,86,72,70,5A,73,26,20,27,2C,2B,7A ccOut:82 role:05 ff:8600 ui:8600
Supported Command Classes: [BASIC (0x20), SWITCH_MULTILEVEL (0x26), SWITCH_ALL (0x27), SCENE_ACTIVATION (0x2B), SCENE_ACTUATOR_CONF (0x2C), ASSOCIATION_GRP_INFO (0x59), DEVICE_RESET_LOCALLY (0x5A), ZWAVEPLUS_INFO (0x5E), CONFIGURATION (0x70), MANUFACTURER_SPECIFIC (0x72), POWERLEVEL (0x73), FIRMWARE_UPDATE_MD (0x7A), ASSOCIATION (0x85), VERSION (0x86)]
Security: Device is not using security.
Manufacturer ID: null
Manufacturer Name: null
Product Type ID: null
Product ID: null
Firmware Metadata: Firmware ID: null, Checksum: null
Application (Firmware) Version: null
Z-Wave Protocol Version: null
Z-Wave Library Type: null
Powerlevel: null
Protection Mode: [ Local: null (null), RF: null (null) ]
Switch_All Mode: null (null)

For the ‘Print Params’ I get:
2:42:17 PM: info Parameters [0]:

I doesn’t seem to be able to scan the parameters.

Possibly the tweaker is trying to use security when it shouldn’t. Try editing the DTH code so encapCommand() is as follows:

private encapCommand(physicalgraph.zwave.Command cmd) {
    return cmd
}

Save and re-publish, then try again.

Tried that but the results are the same.

ok, even though the device doesn’t advertise support for security, you could try the opposite (i.e. force security), by changing to:

private encapCommand(physicalgraph.zwave.Command cmd) {
    return zwave.securityV1.securityMessageEncapsulation().encapsulate(cmd)
}

or forcing CRC encapsulation:

private encapCommand(physicalgraph.zwave.Command cmd) {
    return zwave.crc16EncapV1.crc16Encap().encapsulate(cmd)
}

if both those options fail, return the tweaker code to the original, and try excluding and re-adding the device.

1 Like

I’d like to share a success story with Z-Wave Tweaker. Thank you David, it is really awesome!

My setup: I have two lights that I wanted to control with a separate switch. Both lights can be controlled by Fibaro Dimmer 2 modules. Switch is button powered Z-Wave.me ZME_WALLC-S. Neither of these devices by SmartThings natively so for Dimmer 2 I use device handler from David. For switch I use Device Handler made by AdamV.

First attempt to control lights was by Smart Lightning app. It was pretty easy to configure but lights reaction after switch presses were pretty slow and jitter pretty big: from 2 to about 30 seconds.

Second attempt is with Z-Wave associations. I had to read quite a lot to understand how it works.

Gotcha: switch is battery operated device. Easiest way to configure it is to enter management mode (press all buttons at once for about 5 seconds until green light starts blinking) and use 2nd button (top right). This way switch won’t get to sleep for 10 seconds.

It took me some time to find out that I had to hit scan param and association button first. Only after that Z-Wave Tweaker allowed me to set params.

In the end I have ended up with following configuration:

  • Parameter #12: [id:12, scaledConfigurationValue:1, size:1]. Even though manual says it is default my switch had value 2 there.
  • Parameter #14: [id:14, scaledConfigurationValue:1, size:1].
  • Association Group #3: [id:3, maxNodesSupported:10, multiChannel:true, name:Group B, nodes:[00, 03, 01]]. 03 is dimmer’s network id in my network.

Now my lights respond to button pushes under 1 second! And as a bonus I can dim my lights.

Finally a proof: https://youtu.be/5-jAyrgdUso

2 Likes

Excellent! Thank you so much!

Hi all. With the help of @ccheng I’ve been pointed to the Tweaker DH by @zcapr17 to try and get the new Aeotec Nano Dimmer functional in my system.

Was able to get logs of all parameters (had to use Print function in Tweaker).

I understand how to change a few parameters that I need. In my case they are 249, 129 and 130. I was able to change 249 and it immediately synched and showed up in the log.

28bf874c-dac4-4ca0-ab8e-1cac690b3dba 7:14:10 PM: info Parameter #249: Size: 1, Value: 2
28bf874c-dac4-4ca0-ab8e-1cac690b3dba 7:14:08 PM: info Parameter #249: Size: 1, Value: 0
28bf874c-dac4-4ca0-ab8e-1cac690b3dba 7:14:07 PM: info sync(): Syncing parameter #249: Size: 1, New Value: 2

I need to change 129 and 130 to see if i can get the Dim function to work. The Tweaker app shows pending synch and doesn’t change. I’ve left it for 15 min. If i go mess with other functions eventually the synch with turn green but the parameter change i requested isn’t there. Immediately after changing a parameter i get this:

28bf874c-dac4-4ca0-ab8e-1cac690b3dba 7:15:23 PM: info Parameter #129: Size: 1, Value: 0
28bf874c-dac4-4ca0-ab8e-1cac690b3dba 7:15:22 PM: info Parameter #129: Size: 1, Value: 0
28bf874c-dac4-4ca0-ab8e-1cac690b3dba 7:15:22 PM: info sync(): Syncing parameter #129: Size: 1, New Value: 2

Any ideas/suggestions on getting Tweaker to change these two parameters? I’ve tried it with light on and off. I’ve closed apps, restarted, replaced the DH and back to Tweaker. Can’t seem to push a parameter change.

Thanks!