[GUIDE] Writing Z-Wave Drivers for S2

I took a bit of a different approach with S2 to address the problem of devices that don't support S2 properly, while still allowing my S2 driver code to be used with those that do. I found that, for certain devices, S2 was simply broken. For others (several of my HomeSeer dimmers / switches), the device received the Supervision message, but then sent back the wrong S2 status code.

So, what I did was put together my own S2 sending library, but in the driver, you can define two simple mapping function (one for devices that completely mess up supervision, one for which it is poorly supported ) which returns a list of manufacturer /deviceType / deviceID codes and if the device is on the list the library either doesn't supervise at all, or simply ignores the status code and assumes all went well.

The code is also a bit simpler in that there is really only one main sending function "advancedZwaveSend" which compares cmd.CMD to a list of commands that should be supervised and only supervises those on the list. If a command isn't on that list, it is always sent unsupervised.

I am preparing this as a "community" library. If this approach might help you, the library is here: GitHub - jvmahon/HubitatDriverTools and a full wiki page describing how to use it is here: sendReceiveTools · jvmahon/HubitatDriverTools Wiki · GitHub

Look in the "customizations" section of the wiki to see how to customize the mapping functions I mentioned.

I'm still adding / clarifying the documentation.

The wiki identifies the specific commands that will get supervised. It would be great to have a complete list of the ones that should be, so if anybody is interested in using this code and wants to augment the list, please post as a github issue.

4 Likes