Converting Base 64 to Hexadecimal

Here are the docs you need to help

here is the first part

var bytes = msg.payload;
if (bytes[0]==01) {
    var temperature = (bytes[3] << 8) + bytes[2];
    var humidity= bytes[6];
    return { 
        payload: {
            temperature: temperature/10, 
            humidity: humidity/2
        }
    }
}
// else {
//     var power=bytes[2];
//     return {
//         power: power
//     }
// }

return msg;
1 Like