Skip to content

Commit

Permalink
Initial support of Bresser 8-in-1 weather sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-bs committed Jan 27, 2025
1 parent f181d10 commit 1b79671
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ const uint8_t testData[][MSG_BUF_SIZE-1] = {

// #10: Air Quality (HCHO/VOC) Sensor
{0x0c, 0x1c, 0xc4, 0xa5, 0xaa, 0xaf, 0xb1, 0xaa, 0xa8, 0xaa, 0xa8, 0xaa, 0xa8, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xe9, 0xff, 0xaa, 0xaa, 0x00}
0xaa, 0xaa, 0xe9, 0xff, 0xaa, 0xaa, 0x00},

// #11: 8-in-1 Weather Sensor
{0x6E, 0xA7, 0xC8, 0xEB, 0x88, 0x2A, 0xD8, 0xAD, 0xAA, 0xFD, 0xAA, 0xA8, 0x98, 0xAA, 0xBF, 0xFC, 0x3E, 0xAA, 0x82,
0x22, 0xAA, 0xAA, 0xBE, 0x3A, 0xAA, 0x00}
};

WeatherSensor ws;
Expand Down Expand Up @@ -127,7 +131,7 @@ void loop()
// Timeout occurs after a small multiple of expected time-on-air.
DecodeStatus decode_status = ws.decodeMessage(&testData[idx][0], MSG_BUF_SIZE-1);

idx = (idx == 10) ? 0 : idx+1;
idx = (idx == 12) ? 0 : idx+1;
Serial.printf("testData[%d]\n", idx);

if (decode_status == DECODE_OK) {
Expand Down
1 change: 1 addition & 0 deletions src/WeatherSensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
#define SENSOR_TYPE_LIGHTNING 9 // Lightning Sensor
#define SENSOR_TYPE_CO2 10 // CO2 Sensor
#define SENSOR_TYPE_HCHO_VOC 11 // Air Quality Sensor (HCHO and VOC)
#define SENSOR_TYPE_WEATHER2 13 // Weather Station (8-in-1)


// Sensor specific rain gauge overflow threshold (mm)
Expand Down
6 changes: 3 additions & 3 deletions src/WeatherSensorDecoders.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// WeatherSensorDecoder.cpp
// WeatherSensorDecoders.cpp
//
// Sensor data decoding functions
//
Expand Down Expand Up @@ -752,7 +752,7 @@ DecodeStatus WeatherSensor::decodeBresser7In1Payload(const uint8_t *msg, uint8_t
sensor[slot].complete = true;
sensor[slot].rssi = rssi;

if (s_type == SENSOR_TYPE_WEATHER1)
if ((s_type == SENSOR_TYPE_WEATHER1) || (s_type == SENSOR_TYPE_WEATHER2))
{
int wdir = (msgw[4] >> 4) * 100 + (msgw[4] & 0x0f) * 10 + (msgw[5] >> 4);
int wgst_raw = (msgw[7] >> 4) * 100 + (msgw[7] & 0x0f) * 10 + (msgw[8] >> 4);
Expand Down Expand Up @@ -1026,4 +1026,4 @@ DecodeStatus WeatherSensor::decodeBresserLeakagePayload(const uint8_t *msg, uint

return DECODE_OK;
}
#endif
#endif

0 comments on commit 1b79671

Please sign in to comment.