Locating parameters for rule arguments

When constructing a rule which performs an action on a device you will be prompted for one or more arguments. When its a single argument that is usually pretty easy to guess, but when its two or three it gets more tricky. So my question is how does a user go about identifying the values and range of variables given device?

In my specific case it’s a Yale Lock

I ended up using the Lock Code Manager but the basic question is the same. How do I find the information the rules prompt me for?

1 Like

@Gary_Milne, the arguments shown in the action is based on how the command is defined in the device type handler (DTH). So depends on what device handler you are using, it may have different arguments. For example, in ST Z-Wave Lock DTH, setCode takes codeID, code, and codeName (optional) arguments. See below for ST Z-Wave Lock DTH where setCode() is defined.

The SmartThings capabilities documentation is usually a good first place to start:

As James mentioned, the device handler reports back the capabilities as well as custom commands and parameters that it supports. For custom commands, I’d usually recommend checking directly with the device handler developer in their respective community post or taking a look through their code.

The Lock Codes capability is a weird one in that it’s used in a lot of official drivers, isn’t officially documented (but the proposal is on the community), and worse yet it actually reports back the arguments in the wrong order! :open_mouth:

The correct order of commands should be:

codeID (Number)
code (String)
codeName (String, optional)

Unfortunately, some device handlers don’t properly define commands and their parameters, but you can always manually change which parameters are sent (and in which order) using the ‘Advanced’ toggle in the top-right corner of the Device Action card.

image

1 Like

Thanks guys, the link to the smartthings capabilities docs was exactly what I was looking for.

2 Likes