Skip to content

Commit c2fa4e3

Browse files
authored
Add FineOffset WH0290 extra fields (#1639)
- Note that this is also EcoWitt WH41. - Note that device id matches sticker on device in hex. This is at least true for WH41, and in my view removes the ? about device id. - Decode family and unknown bit in WH0290
1 parent 8151ad4 commit c2fa4e3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/devices/fineoffset.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ static int fineoffset_WH24_callback(r_device *decoder, bitbuffer_t *bitbuffer)
331331
Fine Offset Electronics WH0290 Wireless Air Quality Monitor
332332
Also: Ambient Weather PM25
333333
Also: Misol PM25
334+
Also: EcoWitt WH41
334335
335336
The sensor sends a package each ~10m. The bits are PCM modulated with Frequency Shift Keying.
336337
@@ -339,7 +340,7 @@ Data layout:
339340
FF DD ?P PP ?A AA CC BB
340341
341342
- F: 8 bit Family Code?
342-
- D: 8 bit device id?
343+
- D: 8 bit device id (corresponds to sticker on device in hex)
343344
- ?: 1 bit?
344345
- b: 1 bit MSB of battery bars out of 5
345346
- P: 14 bit PM2.5 reading in ug/m3
@@ -384,7 +385,9 @@ static int fineoffset_WH0290_callback(r_device *decoder, bitbuffer_t *bitbuffer)
384385
}
385386

386387
// Decode data
388+
uint8_t family = b[0];
387389
uint8_t id = b[1];
390+
uint8_t unknown1 = (b[2] & 0x80) ? 1 : 0;
388391
int pm25 = (b[2] & 0x3f) << 8 | b[3];
389392
int pm100 = (b[4] & 0x3f) << 8 | b[5];
390393
int battery_bars = (b[2] & 0x40) >> 4 | (b[4] & 0xC0) >> 6; //out of 5
@@ -397,6 +400,8 @@ static int fineoffset_WH0290_callback(r_device *decoder, bitbuffer_t *bitbuffer)
397400
"battery_ok", "Battery Level", DATA_FORMAT, "%.1f", DATA_DOUBLE, battery_ok,
398401
"pm2_5_ug_m3", "2.5um Fine Particulate Matter", DATA_FORMAT, "%i ug/m3", DATA_INT, pm25/10,
399402
"pm10_0_ug_m3", "10um Coarse Particulate Matter", DATA_FORMAT, "%i ug/m3", DATA_INT, pm100/10,
403+
"family", "FAMILY", DATA_INT, family,
404+
"unknown1", "UNKNOWN1", DATA_INT, unknown1,
400405
"mic", "Integrity", DATA_STRING, "CRC",
401406
NULL);
402407
/* clang-format on */

0 commit comments

Comments
 (0)