SNMP GET Opaque data type results in hex values

I’m using the SNMP binding with OH2 and trying to get that battery value from my UPS connected through my Synology DiskStation.

I can read out OctetString and Integer values, but when it comes to Opaque, I get hex values back.

I’ve tried both Number and String, but only String actually return values…

String NAS_UPS_BATT "Battery on the UPS [%s %%]" { snmp="<[192.168.x.x:public:.]" }

Any ideas on this?


I have exactly the same problem. Nodody else with that problem?

It’s been a while since this was posted, but since it showed up in my search, it might in others’ too.
The hex values are an encoded float, see You can do the conversion via a JavaScript transform:

(function(input) {
    var bytes = input.split(":");
    if(bytes.length != 7 || bytes[0] != "9f" || bytes[1] != "78" || bytes[2] != "04") return input;
    var view = new DataView(new ArrayBuffer(4));
    for (i = 0; i < 4; i++) {
       var byteValue = parseInt("0x" + bytes[3 + i]);
    return view.getFloat32(0);

Save this as opaqueFloat.js in the transform folder. Then you can use it as follows:

Number UPS_BatteryLevel "UPS Battery Level [%d %%]" {snmp="<[nas:public:]"}