I have a TG-BT5-OUT and the advertisement is showing the following: 15ff4f090100bf25feff0200faffa1193b2200000064
Based on the documentation the temperature value should be "a119" in a 8.8 fixed point format. However, a119 (1010000100011001) would set the sign bit to a negative temperature. I'm testing in a room with a temperature of around 23C.
UserData is showing 00 which means the encryption is disabled.
Am I missing something or making a mistake or is there a bug or missing documentation on how to obtain the correct temperature?
Here is my nodered code:
Code: Select all
...
//Get Temperature
TempHex = msg.payload.locs[0].tags[i].ed.ad.slice(28, 32);
let TempInt = parseInt(TempHex, 16);
let signed = (TempInt & 0x8000) > 0 ? -1 : 1;
Temp = signed * TempInt / Math.pow(2, 8);
TempHex = a119
Temp = -161.09765625
Here are some extra advertisements:
15ff4f090100e4860000fbffffff211a3c0800000064
15ff4f0901008a760000fdfffcff4019240c00000064
15ff4f090100b2a80100000000004019b00c00000064
15ff4f090100ba3502000300fdff4f19470e00000064
15ff4f090100cf05fdfffcff0100cf1aa71700000064
15ff4f090100898afcfffdfffcff401acf1a00000064
15ff4f09010078eafdfffdff0000cf19e41d00000064
15ff4f090100bf25feff0200faffa1193b2200000064