Skip to content

Commit 3264d01

Browse files
Add extra digit to Oregon Scientific for AWR129 (#2446)
1 parent 336ee28 commit 3264d01

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/devices/oregon_scientific.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#define ID_RGR968 0x2d10
2323
#define ID_THR228N 0xec40
2424
#define ID_THN132N 0xec40 // same as THR228N but different packet size
25-
#define ID_AWR129 0xec41 // same as THR228N
25+
#define ID_AWR129 0xec41 // similar to THR228N, but an extra 100s digit
2626
#define ID_RTGN318 0x0cc3 // warning: id is from 0x0cc3 and 0xfcc3
2727
#define ID_RTGN129 0x0cc3 // same as RTGN318 but different packet size
2828
#define ID_THGR810 0xf824 // This might be ID_THGR81, but what's true is lost in (git) history
@@ -51,7 +51,9 @@ static float get_os_temperature(unsigned char *message)
5151
{
5252
float temp_c = 0;
5353
temp_c = (((message[5] >> 4) * 100) + ((message[4] & 0x0f) * 10) + ((message[4] >> 4) & 0x0f)) / 10.0F;
54-
// Correct 0x0f to 0x08:
54+
// The AWR129 BBQ thermometer has another digit to represent higher temperatures than what weather stations would observe.
55+
temp_c += (message[5] & 0x07) * 100.0F;
56+
// 0x08 is the sign bit
5557
if (message[5] & 0x08) {
5658
temp_c = -temp_c;
5759
}

0 commit comments

Comments
 (0)