Payload decoder Javascript

I find the issue of my problem, yes.

function decodeUplink(input)
{
  return{
    data: Decode(input.fPort, input.bytes, input.variables)
  };
}

function Decode(fPort, bytes, variables) {
  
  var data ={"Temp1":"",
             "Temp2":"",
             "battery":"",
             "bytes":""};
  data.battery= bytes[1] & 0x0002;
  data.Temp1= (bytes[3] + bytes[2])/10;
  data.Temp2= (bytes[5] + bytes[4])/10;
  data.bytes= bytes;
  
  return data;
}

This is the code that I used to decode the payload of an Adeunis Temp sensor :slight_smile:

1 Like