# Virtual Parameters - PPPoE

**URL:** <https://forum.genieacs.com/t/virtual-parameters-pppoe/3902>\
**Category:** Uncategorized\
**Created:** [April 28, 2023, 7:07pm UTC](https://forum.genieacs.com/t/virtual-parameters-pppoe/3902 "2023-04-28T19:07:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Magnospeed](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@Magnospeed](https://forum.genieacs.com/u/Magnospeed)\
**Post date:** [April 28, 2023, 7:07pm UTC](https://forum.genieacs.com/t/virtual-parameters-pppoe/3902/1 "2023-04-28T19:07:33Z")

</div>

Hey Guys!

I’m trying to add pppoe information in Listen Devices, but I’m having difficulties because different CPEs have different parameters, and I’d like to find a way to add them all, I found some provided on VirtualParameters, but when I tried, the page was blank. Can someone help me and see if there’s something wrong…  
Uploading: image.png…

Virtual Paramater  
pppUsername  
let result = ‘’;

if (declare(“Tags.Bridged”, {value: 1}).value !== undefined) {  
log(‘CPE is bridged, setting PPPoE username to null’);  
} else if (“value” in args[1]) {  
result = args[1].value[0];  
} else {  
let keys = [  
‘InternetGatewayDevice.WANDevice._.WANConnectionDevice._.WANPPPConnection._.Username’,  
'Device.PPP.Interface._.Username’  
];

```
result = getParameterValue(keys);

```

}

return {writable: true, value: [result, “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 '';

```

}

Provisons

declare(‘VirtualParameters.pppUsername’, {path: Date.now(), value: Date.now()});

Editing index page

- label: “‘PPPoE’”  
parameter: VirtualParameters.pppUsername

Uploading: Sem título.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:** [April 28, 2023, 8:39pm UTC](https://forum.genieacs.com/t/virtual-parameters-pppoe/3902/2 "2023-04-28T20:39:13Z")

</div>

Your declare is wrong.

```auto
declare('VirtualParameters.pppUsername', {value: Date.now()}, {value: 'the_user_name'});

```

---

<div class="post-metadata">

**Author:** ![Magnospeed](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@Magnospeed](https://forum.genieacs.com/u/Magnospeed)\
**Post date:** [April 29, 2023, 5:26pm UTC](https://forum.genieacs.com/t/virtual-parameters-pppoe/3902/3 "2023-04-29T17:26:19Z")

</div>

> [@akcoder](#):
>
> `ters.pppUs`

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

I tried, but without success too! is there anything else i can do?

---

<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:** [May 1, 2023, 5:05pm UTC](https://forum.genieacs.com/t/virtual-parameters-pppoe/3902/4 "2023-05-01T17:05:12Z")

</div>

And how did you try? You need to include code and logs.
