How to use custom commands

Zaid Abdulla zaid at genieacs.com
Fri Jun 10 17:05:49 EDT 2016


On Mon, 2016-06-06 at 16:08 +0200, Oliver Kraitschy wrote:
> 1. Which functions do i need to implement? I guess set and get? What
> are the functions dset and setdset for?

Those were just some functions I had to implement for a certain edge
case. You can name your functions anything. The only function that you
have to have is "init" which is executed on device bootstrap.

> 2. It seems that custom commands get executed (get function) right
> after device registration. How can i avoid that? My custom command
> depends on a parameter which is unknown at that point of time. Or do
> i simply need to abort execution upon an error?

In the example scripts, the function init calls get. You can provide
different implementations for init and get.

> 3. How can i execute the get function with a preset? With a refresh
> configuration? Which parameter path do i need to use? (See 4.)

There's a special preset configuration for custom commands. You need to
use that.

> 4. What is the parameter path of a custom command? I got a subtree
> InternetGatewayDevice.CustomCommand but it has zero entries. But if i
> look in the mongodb, i see the custom command with its value,
> associated with the device.

It's _customCommands.<command_name>.

-- 
Zaid Abdulla
zaid at genieacs.com



More information about the Users mailing list