# Multi brand - Devices tab

**URL:** <https://forum.genieacs.com/t/multi-brand-devices-tab/5568>\
**Category:** Uncategorized\
**Created:** [June 10, 2024, 10:12pm UTC](https://forum.genieacs.com/t/multi-brand-devices-tab/5568 "2024-06-10T22:12:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![airbytes](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@airbytes](https://forum.genieacs.com/u/airbytes)\
**Post date:** [June 10, 2024, 10:12pm UTC](https://forum.genieacs.com/t/multi-brand-devices-tab/5568/1 "2024-06-10T22:12:16Z")

</div>

Hi guys,

due to different CPE brands, (TP-Link, Mikrotik and Zyxel) I want to have a couple of details on the Devices tab, like PPPoE Username, IP, SSIDs, but those value are on a different interfaces. I tried to use \* sign, but isn’t working, is there a way to sort this out?

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/2X/7/7c44d7ae11aa3df1d4a477bf46dd9ad68278bd41.png)

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [June 10, 2024, 11:21pm UTC](https://forum.genieacs.com/t/multi-brand-devices-tab/5568/2 "2024-06-10T23:21:01Z")

</div>

Use a [VirtualParameter](https://docs.genieacs.com/en/latest/virtual-parameters.html). This vparam will work for both TR-069 and TR-181.

```auto
let username = '';
const now = Date.now();

if ("value" in args[1]) {
    username = args[1].value[0];
    declare('InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.Username', {path: now, value: now}, {value: username})
    declare('Device.PPP.Interface.*.Username', {path: now, value: now}, {value: username})
} else {
    let keys = [
        'InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.Username',
        'Device.PPP.Interface.*.Username'
    ];

    username = getParameterValue(keys);
}

log('PPPoEUsername: ' + username);
return {writable: true, value: [username, "xsd:string"]};

function getParameterValue(keys) {
    for (let key of keys) {
        let d = declare(key, {path: Date.now() - (120 * 1000), value: Date.now()});

        for (let item of d) {
            if (item.value && item.value[0]) {
                return item.value[0];
            }
        }
    }

    return 'UNKNOWN';
}

```

---

<div class="post-metadata">

**Author:** ![elanderson](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/elanderson/32/1579_2.png) [@elanderson](https://forum.genieacs.com/u/elanderson)\
**Post date:** [June 11, 2024, 12:42pm UTC](https://forum.genieacs.com/t/multi-brand-devices-tab/5568/3 "2024-06-11T12:42:06Z")

</div>

Which provision is the ideal to call it? Calling it on default could call several more times than needed.

Check my default:

```auto
const now = Date.now();

const hourly = Date.now(3600000);
const daily = Date.now(86400000);
const weekly = Date.now(604800000);
const informTime = daily % 86400000;

// Refresh basic parameters hourly
declare("InternetGatewayDevice.DeviceInfo.HardwareVersion", {path: hourly, value: hourly});
declare("InternetGatewayDevice.DeviceInfo.SoftwareVersion", {path: hourly, value: hourly});
declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.MACAddress", {path: hourly, value: hourly});
declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.ExternalIPAddress", {path: hourly, value: hourly});
declare("InternetGatewayDevice.LANDevice.*.WLANConfiguration.*.SSID", {path: hourly, value: hourly});
declare("VirtualParameters.*", {value: weekly}, {value: informTime});
// Don't refresh password field periodically because CPEs always report blank passowrds for security reasons
declare("InternetGatewayDevice.LANDevice.*.WLANConfiguration.*.KeyPassphrase", {path: hourly, value: 1});
declare("InternetGatewayDevice.LANDevice.*.Hosts.Host.*.HostName", {path: hourly, value: hourly});
declare("InternetGatewayDevice.LANDevice.*.Hosts.Host.*.IPAddress", {path: hourly, value: hourly});
declare("InternetGatewayDevice.LANDevice.*.Hosts.Host.*.MACAddress", {path: hourly, value: hourly});

```

---

<div class="post-metadata">

**Author:** ![airbytes](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@airbytes](https://forum.genieacs.com/u/airbytes)\
**Post date:** [June 16, 2024, 7:53pm UTC](https://forum.genieacs.com/t/multi-brand-devices-tab/5568/4 "2024-06-16T19:53:45Z")

</div>

For the PPPoE assigned IP, is there any chance of using VirtualParameter?

Thanks

---

<div class="post-metadata">

**Author:** ![martink](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@martink](https://forum.genieacs.com/u/martink)\
**Post date:** [June 17, 2024, 8:22am UTC](https://forum.genieacs.com/t/multi-brand-devices-tab/5568/5 "2024-06-17T08:22:11Z")

</div>

I don’t know if it will work for you, but I use coalesce when I have different parameters on different devices that I want in the same label, for example:

- label: “‘IP’”  
parameter: COALESCE(Device.IP.Interface.3.IPv4Address.1.IPAddress,Device.DHCPv4.Client.1.IPAddress)

---

<div class="post-metadata">

**Author:** ![dustin](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@dustin](https://forum.genieacs.com/u/dustin)\
**Post date:** [June 24, 2024, 4:42pm UTC](https://forum.genieacs.com/t/multi-brand-devices-tab/5568/6 "2024-06-24T16:42:15Z")

</div>

Yes you can.  
Follow the code that akcoder provided and substitute the parameters with those for the PPPoE IP.

Here is another example:

```auto
let ip = "0.0.0.0";
let d = declare("Device.PPP.Interface.1.IPCP.LocalIPAddress", {value: Date.now()});
let igip = declare ("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANIPConnection.*.ExternalIPAddress", {value: Date.now()});
let igd = declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.ExternalIPAddress", {value: Date.now()});

if (d.size) {
  for (let p of d) {
    if (p.value[0]) {
      ip = p.value[0];
      break;
    }
  }
}
else if (igd.size) {
  for (let p of igd) {
    if (p.value[0]) {
      ip = p.value[0];
      break;
    }
  }
}
else if (igip.size) {
  for (let p of igip) {
    if (p.value[0]) {
      ip = p.value[0];
      break;
    }
  }
}

return {writable: false, value: [ip, "xsd:string"]};

```

Hope that helps.

DR
