Thoughts on making Tags more first class citizens?

I have a need to temporarily store arbitrary data about a CPE in GenieACS. Right now, I’m using Tags and splitting on the _ in the tag name to encode multiple pieces of information. This works, but is kind of hacky. Now I also need to store the date of the event and so I end up with a really long and ugly Tag: Diag_Download_CAF_2019-01-17T17-48-47Z

The pieces of information I need to store are event type (Diagnostic), diagnostic to be performed (Download), initiator of the diagnostic event (CAF) and the time the event was requested. I need to store the time so I can know when a diagnostic event has not completed in the expected time and do the appropriate action.

So I guess my request would be for either a better way to externally add structured information to a device instance, or maybe turning Tags into first class citizens in the data model by making them full objects with _timestamp, _type, _value, etc.


Have you considered using a virtual parameter and encode that data as JSON?

I have, except as far as I know there is no way to create a v-param from an external system.


Oh I see what you mean. You can edit an existing vparam through the API though. However it’ll require the device to be online.

How do you change the value of an existing v-param via the API? Via SetParameterValue?

Yes. The vparam needs to have writable: true for this to work.

When I try to edit the value of the v-param from the gui I get a too many commit iterations error.


Can you share your vparam script or a simpler version of it?

return {_writable:true, value:["", “xsd:string”]};


Should be “writable”, not “_writable”. In any case this isn’t what’s causing the fault. I’ll test this later.

I tried writable. When I use just writable, I can’t change the value from the GUI. If I use _writable I can.


You got a fault because the returned value after the set operation doesn’t match the declared value, so it kept trying.

This works for me using latest master:

// args: [{declare timestamps}, {declare values}, {current timestamps}, {current values}]
let value;
if ("value" in args[1]) // Set declared value
  value = args[1].value;
else if ("value" in args[3]) // No declared value, keep current value
  value = args[3].value;
else // No current value, use default
  value = ["default value", "xsd:string"];
return {"writable": true, "value": value};

Thank you for your help on this! This works perfectly!

You’re welcome! On your original suggestion, I have been thinking of replacing tags with a ‘metadata’ structure which is a flat key-value map. Just like tags, this structure can be updated through the API without having to reach the device. Does that sound like what you originally had in mind?

If the value can be complex, I.e. and object, then it would work perfectly for me.

Speaking of reaching the device, I notice when I update the vparam via SPV, genie does a connection request to the CPE, but doesn’t do any other actions on the device. Probably an artifact of how things work under the covers, and not a huge deal.


I’m thinking value is a simple string but you should be able to encode JSON objects.

Yes, tasks can only run during a session.

The more I think about this, while JSON would work, it create a lot of extra work from the perspective that I then have to manage the entire JSON payload. I.e., instead of doing a deleteObject for some sub-item (Metadata.Diagnostics.DSL.Line1), I would have to manage all of that in my app, and make sure I don’t collide with another session (i.e., read all of the Metadata.Diagnostics data in, decode the JSON, add/delete/modify anything I need to, then do a SPF).

I don’t know how difficult it would be to make the Metadata structure be able to complex object (much like the rest of the TR-069 data model), but if its not a lot of work, that would be my preference.


It sounds like you’d be better off storing that in its own database and integrate using an extension. Because even if this metadata idea comes to fruition it’ll probably be a simple key-value map.