From customCommands to Presets

Ivo Abreu ivoabr at gmail.com
Mon Apr 4 06:39:15 EDT 2016


Hi Zaid,

Thanks for your help.

I was able to export the set function, and I can see the value of the
custom command on mongdb for the specific deviceId.

Now the question is, how can I set that Value to the CPE? Should I do it on
the Preset Set command? What would be the syntax?

Thanks again,
Regards,
Ivo Abreu

On Sat, Apr 2, 2016 at 9:42 AM, Zaid Abdulla <zaid at genieacs.com> wrote:

> On Fri, 2016-04-01 at 15:06 -0800, Dan Morphis wrote:
> > I'm running a customCommand to set those values and I can see them on
> > MongoDB, but I cannot find a way to set them on a Preset. How can I
> > do this?
>
> I agree with Dan. I'd wait for the next release in a couple of weeks.
> Custom commands will be reimplemented in a more elegant way.
>
> Regardless, you can do that by exporting a set function in your script
> and calling that from a preset using the "Command value" configuration.
> The set function of your script will be called if the value given
> doesn't match the existing value of the custom command. That is, the
> value given in "Command value" configuration not matching the return
> value of "get" function in your script when it was last called. Make
> sure you have custom command name followed by the function name (e.g.
> "mycustomcommand set [any optional args]") in your preset.
>
> > Additionally, is there a way to execute a customCommand on every
> > Inform Event?
>
> Use "Command age" configuraiton and specify a number of seconds that's
> smaller than your inform interval (e.g. 1).
>
> Zaid
> _______________________________________________
> Users mailing list
> Users at lists.genieacs.com
> http://lists.genieacs.com/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genieacs.com/pipermail/users/attachments/20160404/23ac9d4b/attachment.html>


More information about the Users mailing list