Haven Connect Z - Hubitat Driver

I've created a driver from the SmartThings "Generic Z-wave lock without codes", which is the driver smartThings used when I was using my Haven Connect Z on that platform. This driver seems to work well and I haven't found any issues with it yet. With that said, this is the first driver I've ever created, so I'm sure there's something that could be done better and I welcome anyone to look it over and change/correct as necessary. I don't know if Hubitat will assign this driver or not when you pair the Haven Lock as I'm unsure on the manufacturer and model fingerprints, but it works just fine if you assign the driver after pairing. Let me know what you think!

2 Likes

I don't have any of these devices, but I decided to take a look at the code anyway. :smiley: If you're curious about a few differences between ST and Hubitat, I noticed a few things you may want to know:

  • The "device health"/"health check" thing from ST does not exist on HE, or at least no example drivers have used it despite the capability still technically being in their developer docs (it is not used by the platform regardless). So, you could remove things like line 24, lines 54-56 and 59-66, line 101, and probably more that I don't see offhand.
  • The "forceForLocallyExecuting" option is not documented on Hubitat for runIn()—everything runs locally here already—though I'm guessing it might gracefully ignore it, making it harmless.
  • Does this lock support S2? If only S0, you'll probably be be OK as-is. If S2 (and paired as such, only supported on a C-7 hub), you might want to switch to using Hubitat's built-in Z-Wave secure encapsulation commands instead of the approach on lines 604-606. This is the zwaveSecureEncap() command new to 2.2.3 and documented in the release notes.

I hope this doesn't seem excessively nit-picky. I can't imagine any of this actually being a problem, and these are things you'll often see leftover in ST ports. It looks like you've figured out all the major things (that would be a problem) already, like the class namespaces.

PS - To get a fingerprint you should just be able to copy and paste as-is into your driver, switch temporarily to Hubitat's built-in "Device" driver, then use the "Get Info" command and look at your logs. It will spit out a line starting with "fingerprint" that should be exactly what you want. (Nothing you couldn't cobble together yourself from the command classes and whatnot of the device, but...a lot easier.) Hope this helps!

3 Likes

Not nit-picky at all! These are exactly the kinds of things I expected I left in place, since I haven't done it before. I appreciate the knowledge and I will update the code. Thank you.

3 Likes

I don't know why, but when I used your drive it wouldn't unlock or lock mine. I had to switch it back to the generic one to get it to work. This is what the log says, but it never does anything.

[DTH] Executing unlock() for device Haven Lock

Hmmm. Honestly I'm not sure I know enough to troubleshoot this for you, beyond the very basics. I've been using it since published with flawless results. I do have my Haven lock paired with SO, NOT S2. I had issues with the S2 pairing initially, before I created the driver, so I abandoned it. If yours is paired with S2, then that could be the issue.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.