For example:
02010612FF590080BC4A0101A10A3F00FFFFFFFFFFFF
Where the battery voltage remaining is: 0x014A (3.3V) and the temperature is 0x0AA1 (27.21).
I've been working through this trying to use a function to split the message with the intent of recombining then converting to decimal, but I'm guessing there is a much better way.?
The first function on the left extracts the payload. This outputs the following:
02010612FF590080BC39010020064C00FFFFFFFFFFFF
The next function “temperature_hex_part1” extracts the first part of the payload:
var temper_hex_part1 = msg.payload.substr(24, 2);
msg.payload = temper_hex_part1;
return msg;
The one below it in the flow, “temperature_hex_part2” grabs the 2nd part of the payload I need
Finally, the join combines the output of these two in the correct order to produce a string. For example:
0620
This is a hex value that I need to convert that to decimal and, as you say, /100. This will be the temperature reading from my sensor in degrees Celsius, it should be:
15.68
I've got to do the same several times over to extract battery voltage and device ID.