How can I dynamically set configuration items?

Oliver Kraitschy okraits at arcor.de
Sat May 14 04:01:23 EDT 2016


On Fri, May 13, 2016 at 10:24:07AM -0600, Philip Boulton wrote:
> Dear gentle genieacs UI users, I am wondering if there is a way to
> dynamically set configuration items using arbitrary algorithms or
> results from external queries.
> 
> For example, say I want to set a made-up-parameter called
> Device.WIFI.SSID to be 'Philip' + last 6 characters of MAC address
> for all devices that meet the conditions for a preset.  How would I
> do that?
> 
> If the UI doesn't provide a way to do this, can you point me to
> where in the code it would make sense to hook that in?  I'm not
> afraid to node.

I think custom commands are what you are looking for. Take a look at
custom_commands-sample.json and the files in config/custom_commands. The
mechanism is described at https://genieacs.com/docs/.

> Possibly-related: What exactly is an object, and can somebody show
> me an example object that might get added to a device and explain
> what that does?

In my understanding, an object is an instance of a subtree of the
parameters tree. For example (i don't know the exact parameter path from
memory):

InternetGatewayDevice.Dynmasq.StaticLeases.1. contains all parameters for
the first dhcp static lease.
InternetGatewayDevice.Dynmasq.StaticLeases.2 contains all parameters for
the second dhcp static lease.

So basically InternetGatewayDevice.Dynmasq.StaticLeases. is an object for
configuring dhcp static leases.

Greetings,
Oliver


More information about the Users mailing list