Kwikset Lock

Can anyone explain or point me to an explanation of the parameters for interacting through SharpTools for something like setcode? I see three parameters

tagging @joshua_lyon

1 Like

Thanks for the tag @jkp

SharpTools exposes whatever commands are made available by the device. In most cases, these commands follow the capability definitions created by SmartThings and you can find details in the official capabilities documentation or by searching this community.

For example, you can find details on the lockCodes capability in this thread:

And if it’s a community developed device handler, your best resource is usually in the original thread that the DTH was posted in or with the developer of that DTH.

1 Like

Follow on question. I wanted to be able to set codes from Sharptools. I go to set the parameters and choose as an example

  • Parameter 1 - 4 (next available id)
  • Parameter 2 - Test Code
  • Parameter 3 - 0000

It says Success, but the code is not generated.

That’s really more of a question for the specific device handler and how it works. It looks like you have the second and third parameter backwards in your example though. Reading their spec, the first parameter is the code ID, the second is the code, and the third is the code name.

Also make sure the default data types are right. The first is a number, and the second and third are strings.

If that doesn’t help, I would start by checking the attributes mentioned in the other thread
 as well as watching the SmartThings IDE live logs when you send the command.

Reading through the other thread, it sounds like there are various attributes that would be helpful to check including lockCodes, codeChanged, and codeLength.

Thanks for that information @joshua_lyon. The issue when I look in SharpTools is it asks for the parameters for it in the following order and type:

  • Parameter 1 - AZ
  • Paramenter 2 - AZ
  • Parameter 3 - 09

I tried all different kind of iterations to make it work with no luck :frowning:

SharpTools determines the variable type based on what the device handler reports.

In the case that the reported variable types appear to be wrong, you could override the parameters and set them as you desire. To do this in SharpTools, open the menu (... in the top right corner) and check the box for ‘Override Parameters’
 then you’ll have access to change the parameter types by tapping on them and you can add/delete parameters.

Per the specification, it would be:

  1. [09]: 4
  2. [AZ]: 0000
  3. [AZ]: My Cool Code

And that’s assuming that the device driver is actually following the specification!

1 Like

And for reference, here’s the code from the SmartThings GitHub repository for the ‘Z-wave Lock’ device handler - specifically a link to the setCode definition for that handler:

That’s assuming your Kwikset Lock is using this handler, but you can verify in the SmartThings IDE. :smiley:

So, I did not add a specific DTH, so I am guessing it is using the default

Is it possible to use variables for the code and for the name? I’d love to create a profile that creates a code with whatever I enter along with the name and the expiration time.

If you’re referring to Tasker variables when using the SharpTools Tasker plugins, yes.

Just tap the tag icon in the action bar when you are configuring the ‘A Thing’ plugin and you can use Tasker variables as the values. (eg. %myvariable format)