Hex Payload Decoder
The Hex Payload Decoder allows you to convert incoming hex string payloads into valid JSON data
Last updated
function decoder(input) {
// Your decoding logic here
}{ "payload_hex": "7B2274656D7065726174757265223A32352C2268756D6964697479223A36302C227072657373757265223A313031332C2262617474657279223A39307D" }function decoder(input) {
// Extract values from the input bytes array
// First byte represents temperature
let temperature = input.bytes[0];
// Second byte represents humidity
let humidity = input.bytes[1];
// Third & Fourth bytes represent pressure (16-bit value)
let pressure = (input.bytes[2] << 8) | input.bytes[3];
// Fifth byte represents battery level
let battery = input.bytes[4];
// Return an object containing the decoded values
return { temperature, humidity, pressure, battery };
}{
"temperature": 123,
"humidity": 34,
"pressure": 29797,
"battery": 109
}