Unable to query or read multiple parameters at once

Hello,

I’m trying to read the names of multiple WanIPConnections via the provisioning scripts but it doesn’t seem to be working correctly. I can get the value of one of the paramters names, but not the others.

I have 3 connections, ie: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1-3

I am trying to query with this: InternetGatewayDevice.WANDevice.1.WANConnectionDevice...*.Name
to get this:
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1-3.WANIPConnection.1.Name

and I get the name of the first connection, but I cannot iterate through it to see multiple. I have tried a number of things but just can’t seem to get it to work. Such as changing the path to 5 for multiple entries.

let wanConnectionNames = declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.*.*.*.Name", {path: Date.now(), value: Date.now()});
log(wanConnectionNames.value)
log(Object.keys(wanConnectionNames))
log(JSON.stringify(wanConnectionNames))

for (var key of Object.keys(wanConnectionNames)) {
       log(key + " -> " + wanConnectionNames[key])
}

here is the log output for that code:
Script: 1_TR069_INTERNET_R_VID_,xsd:string
Script:
Script: {}

Thank you!

1 Like

@cingelj16

Have you tried as:

let wanConnectionNames = declare(
  "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.*.*.*.Name",
  { path: Date.now(), value: Date.now() }
);
for (const a of wanConnectionNames) {
  log(`${JSON.stringify(a.value)} ${JSON.stringify(a.path)}`);
}
1 Like

That did it! Thank you!