[SmartThings Edge] Issue with default function to send Z-Wave configuration parameters

Hi @carter.swedal

Doing the driver of the Z-Wave parameter configurator I have seen that smartthings default libraries to allow the sending of negative values.
This means that if the parameter is:

  • 1 Byte (0xFF): positive from 0 to 127 and negative from -1 to 128
  • 2 Byte (0xFFFF): positive from 0 to 32767 and negative from -1 to 32768

So far everything perfect, but still disallow sending unsigned values

Some devices like old fibaro, fibaro relay, I do not know if there will be more cases in more manufacturers or models, need send these values:

  • Parameter: 4
  • value : 0 to 65535
  • Size: 2 Bytes

Others like Aeotec Nano Shuter in their driver zwave-window-treatment:

  • parameter: 35
  • value : 5 to 255
  • Size: 1 Byte

As I mentioned in above post, I solved it in my modified drivers by sending the complement to 2 for values ​​> 127 (with 1 Byte) 0 > 32767 (with 2 Byte)
The fibaro devices continues to work fine althoughthe value shown in the CLI when reading is -32768 instead of 65535, because it sends the value in hexadecimal and the device interprets it well, but the CLI and libraries default does not decode fine these values to shown It when received with configuration parameter Get function. Always interprets it as signed values.

In the drivers that do not have this modification like some yours stock, when they send values ​​> 127 (1Byte) or > 32767 (2 Byte) it will give this fatal error and the device will not be configured:

2022-08-13T09:41:26.362964862+00:00 ERROR Z-Wave Device Config Mc Fibaro Single Relay thread encountered error: [string "st/dispatcher.lua"]:233: Error encountered while processing event for <ZwaveDevice: e062ff99 -4cfc-47c2-be7f-91881fdc3a8c [1F] (Fibaro Single Relay)>:
    arg1: table: 0xa56778
[string "st/utils.lua"]:188: bad argument #2 to 'pack' (integer overflow)

The most modern devices I have seen that for values ​​0 to 255, they have a size of 2 bytes and for values ​​0 to 65535 they have a size of 4 bytes

2 Likes