I can’t seem to pull VirtualParameter details to show in the chart. Is there a specific way this should be done? I am attaching what I have tried so far without success. I am trying to use a Virtual Parameter as we use multiple modules of devices that each show their PCI in a different variable.
Chart Code:
online_PCI_24:
label: "'Online Status PCI 24'"
slices:
1_onlineNow:
color: "'#31a354'"
filter: Tags.DEPLOYED = true AND VirtualParameters.phyCellID = 24 AND Events.Inform > NOW() - 5 * 60 * 1000
label: "'Online now'"
2_past24:
color: "'#ffde24'"
filter: Tags.DEPLOYED = true AND VirtualParameters.phyCellID = 24 AND Events.Inform > (NOW() - 5 * 60 * 1000) - (24 *
60 * 60 * 1000) AND Events.Inform < (NOW() - 5 * 60 * 1000)
label: "'Offline in past 24 hours'"
3_others:
color: "'#ff2424'"
filter: Tags.DEPLOYED = true AND VirtualParameters.phyCellID = 24 AND Events.Inform < (NOW() - 5 * 60 * 1000) - (24 *
60 * 60 * 1000)
label: "'Offline over 24 hours'"
Virtual Parameter Code: VirtualParameters.phyCellID
let result = '';
let keys = [
'Device.Cellular.Interface.1.X_ZYXEL_PhyCellID',
'InternetGatewayDevice.WANDevice.X_BEC_COM_ModuleA.PhyCellID'
];
for (let key of keys) {
let k = declare(key, {value: Date.now()});
if (k.size) {
result = k.value[0];
break;
}
}
return {writable: false, value: [result, "xsd:string"]};