How to use bitmask

Hi,

I need help with adding parameters to a new z-wave device.
I have added xml-file, and a lot of 1-byte parameters, but how do I add 4-size parameters? I know I must use bitmask for this, but I need a “For dummies-guide” on how to do it.
This is from the device manual:

Parameter Number 13, Parameter Size 4. Multilevel Switch on
single press for device 1 (button #1)
Configuration of the initial ON or OFF values sent to an
associated Multilevel Switch device when button # 1 is
activated.
Value Description
Byte 1: Enable / Disable
0 Disabled – When single pressing the button, nodes
associated to group 6 won’t be switched.
1 Enabled – When single pressing the button, nodes
associated to group 6 will be switched between the
configured upper and lower switch values. (Default)
Byte 2: Upper switch value
0 – 99, 255 When single pressing the button for ON, a
Multilevel Switch Set with this value will be send to
devices in association group 6. (Default = 255)
Byte 3: Lower switch value
0 - 99 When single pressing the button for OFF, a
Multilevel Switch Set with this value will be send to
devices in association group 6. (Default = 0)
Byte 4: Not used – must be set to 0.

I suggest going to the database and making an entry for your device, if it doesn’t already exist. You could then download the XML directly, if you’d like to manually add it into the binding for testing. I’ve been meaning to make a post on how to do this, so let me know if that would help.

The device was not in the database, so I uploaded XML to add this device.
But the parameter list, and Association Groups was empty, I had to manually add every parameter.
So far so good, but when I came to add 4 size parameters and use bitmask, I don’t know how I do that. 1-byte parameters and Association Groups in added, but how do I add 4-byte?

The XML does not contain these, so they will not be populated by the import. It’s always a manual process to add them in.

You can set the byte size when configuring the parameter :wink:

Yes, this part is ok.
This is from the device manual:

Parameter Number 13, Parameter Size 4. Multilevel Switch on
single press for device 1 (button #1)
Configuration of the initial ON or OFF values sent to an
associated Multilevel Switch device when button # 1 is
activated.
Value Description
Byte 1: Enable / Disable
0 Disabled – When single pressing the button, nodes
associated to group 6 won’t be switched.
1 Enabled – When single pressing the button, nodes
associated to group 6 will be switched between the
configured upper and lower switch values. (Default)
Byte 2: Upper switch value
0 – 99, 255 When single pressing the button for ON, a
Multilevel Switch Set with this value will be send to
devices in association group 6. (Default = 255)

How do I define Byte 1, 2 3 and 4? I guess I must use bitmask?
It is 4 different choices in one parameter number

Ah… in the parameter, add Options…

If you run into trouble, send a link to the device in the db and I will take a look.

This is the device:
https://www.cd-jackson.com/index.php/zwave/zwave-device-database/zwave-device-list/devicesummary/846

It is parameter 13-18.
I have written the options under Overview, but must add them as a real option…

Sorry, I misled you with using Options for this. Here is another device where something similar was setup (parameter 101). I don’t think this will work (well) for your device though, since it just provides a freeform number field and the user needs to calculate the value. Maybe @chris has another suggestion.

I found this device, parameter 19, maybe this is the correct way to do it?

1 Like

Firstly, apologies - I missed this thread until now…

So what needs to be done is to add 2 parameters -:

Parameter 1:
Parameter 13, min=0, max=1, bitmap=00000001
Options 0 = Disabled, and option 1 = enabled.

Parameter 2:
Parameter 13, min=0, max=99, bitmap=0000ff00
Also add an option called “On” with value 255, and also tick the field called “Free form entry” (I think that’s what it’s called). This allows the user to add values between min and max that are not defined as actual options.

I hope that makes sense? If not, please let us know…

Chris

Thank you, I am now adding some options :slight_smile: