Adding a Description to a Command

Is there a way to provide users with a description of a command? I know you can add a description of a parameter (and use it a lot) and for preferences you can display a description of the preference (including HTML to make it look nice, small, or highlight parts)... but I cannot find one for commands and realized I had never done it before.

The use case I have is:
Simple child device that really only has one set of commands... Arming/Disarming it's parent. It also counts as a switch so has on/off. I would like to add a description that on = Arm and off = Disarm.

There is a similar child that does an Enable/Disable (but has many other commands) tied to the on/off (because Enable/Disable are it's most important usable functions for a switch).

Can you make a command in the metadata and define it to do what you want later in the code?

 command "AnythingIwant"

And then

void AnythingIwant () {
//the actual command you want to use//

Not in this case, no. I already have commands that users can actuate in the Rules "ArmSystem" and "DisarmSystem". Those are obvious. The problem is for the "switch" capability. It creates "on" and "off" commands. I can have those do whatever, as you mention... but I HAVE to have them. They also appear on the driver details page but are only labeled "On" and "Off". Without a description it is not obvious that they would have the same effect as "ArmSystem" and "DisarmSystem".

Most of the users are used to it and I have it commented in the drivers... but I was hoping there was an easy way to do it. Maybe something like:

command "on", [ description: "Will Arm system that the device is connected to" ]
command ( name: "on", description: "Will Arm system that the device is connected to" )

But that does not work of course. With a custom command I know I can add parameters with a description, but that is not useful in this case because the command does not have parameters (the parent needs them, but the children already know who they are to arm/disarm, so do not need a value). Example:

command "ArmSystem", [ [ name: "NetworkID", type: "NUMBER", description: "Enter a NetworkID to arm (blank arms all)" ] ]

hmmm, right I see what your trying to do.

Maybe this would suffice?

 command "AnythingIwant" , [[name:"Can do a little description here if you want???"]]

Thanks! That works. It is a little strange because of the ":" and tooltip that pops up, but the command still works without error and now there is something there for users to see to help figure it out.

1 Like

Awesome, glad I could help! My Blink App works great btw :grinning: