Skip to content

Commit

Permalink
Merge pull request #95 from matthias-bs/feature-pool-thermometer
Browse files Browse the repository at this point in the history
Feature pool thermometer
  • Loading branch information
matthias-bs committed Oct 24, 2023
2 parents 416ea49 + 036f91c commit 37d75dc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ To allow automatic handling of all Bresser weather station variants, the decoder
| 7002585 | Weather Station | decodeBresser**6In1**Payload() |
| 7009999 | Thermo-/Hygrometer Sensor | decodeBresser**6in1**Payload() |
| 7009972 | Soil Moisture/Temperature Sensor | decodeBresser**6In1**Payload() |
| 7009973 | Pool / Spa Thermometer | decodeBresser**6In1**Payload() |
| 7009975 | Water Leakage Sensor | decodeBresser**Leakage**Payload() |
| 7009976 | Lightning Sensor | decodeBresser**Lightning**Payload() |
| 7003600 and WSX3001 | Weather Station | decodeBresser**7In1**Payload() **2)** |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
// 20221227 Replaced DEBUG_PRINT/DEBUG_PRINTLN by Arduino logging functions
// 20230624 Added Bresser Lightning Sensor decoder
// 20230804 Added Bresser Water Leakage Sensor decoder
// 20231023 Modified detection of Lightning Sensor
//
// ToDo:
// -
Expand Down Expand Up @@ -83,7 +84,7 @@ void loop()
int decode_status = weatherSensor.getMessage();

if (decode_status == DECODE_OK) {
if (weatherSensor.sensor[i].s_type == SENSOR_TYPE_LIGHTNING) {
if (!weatherSensor.sensor[i].temp_ok && (weatherSensor.sensor[i].s_type == SENSOR_TYPE_LIGHTNING)) {
Serial.printf("Id: [%8X] Typ: [%X] Battery: [%s] ",
(unsigned int)weatherSensor.sensor[i].sensor_id,
weatherSensor.sensor[i].s_type,
Expand Down
17 changes: 12 additions & 5 deletions src/WeatherSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
// 20230814 Fixed receiver state handling in getMessage()
// 20231006 Added crc16() from https://github.com/merbanan/rtl_433/blob/master/src/util.c
// Added CRC check in decodeBresserLeakagePayload()
// 20231024 Added Pool / Spa Thermometer (P/N 7009973) to 6-in-1 decoder
//
// ToDo:
// -
Expand Down Expand Up @@ -644,6 +645,7 @@ DecodeStatus WeatherSensor::decodeBresser5In1Payload(const uint8_t *msg, uint8_t
// - also Froggit WH6000 sensors.
// - also rebranded as Ventus C8488A (W835)
// - also Bresser 3-in-1 Professional Wind Gauge / Anemometer PN 7002531
// - also Bresser Pool / Spa Thermometer PN 7009973 (s_type = 3)
//
// There are at least two different message types:
// - 24 seconds interval for temperature, hum, uv and rain (alternating messages)
Expand All @@ -655,7 +657,7 @@ DecodeStatus WeatherSensor::decodeBresser5In1Payload(const uint8_t *msg, uint8_t
// Moisture:
//
// f16e 187000e34 7 ffffff0000 252 2 16 fff 004 000 [25,2, 99%, CH 7]
// DIGEST:8h8h ID?8h8h8h8h :4h STARTUP:1b CH:3d 8h 8h8h 8h8h TEMP:12h ?2b BATT:1b ?1b MOIST:8h UV?~12h ?4h CHKSUM:8h
// DIGEST:8h8h ID?8h8h8h8h TYPE:4h STARTUP:1b CH:3d 8h 8h8h 8h8h TEMP:12h ?2b BATT:1b ?1b MOIST:8h UV?~12h ?4h CHKSUM:8h
//
// Moisture is transmitted in the humidity field as index 1-16: 0, 7, 13, 20, 27, 33, 40, 47, 53, 60, 67, 73, 80, 87, 93, 99.
// The Wind speed and direction fields decode to valid zero but we exclude them from the output.
Expand Down Expand Up @@ -693,8 +695,8 @@ DecodeStatus WeatherSensor::decodeBresser5In1Payload(const uint8_t *msg, uint8_t
//
// Wind and Temperature/Humidity or Rain:
//
// DIGEST:8h8h ID:8h8h8h8h :4h STARTUP:1b CH:3d WSPEED:~8h~4h ~4h~8h WDIR:12h ?4h TEMP:8h.4h ?2b BATT:1b ?1b HUM:8h UV?~12h ?4h CHKSUM:8h
// DIGEST:8h8h ID:8h8h8h8h :4h STARTUP:1b CH:3d WSPEED:~8h~4h ~4h~8h WDIR:12h ?4h RAINFLAG:8h RAIN:8h8h UV:8h8h CHKSUM:8h
// DIGEST:8h8h ID:8h8h8h8h TYPE:4h STARTUP:1b CH:3d WSPEED:~8h~4h ~4h~8h WDIR:12h ?4h TEMP:8h.4h ?2b BATT:1b ?1b HUM:8h UV?~12h ?4h CHKSUM:8h
// DIGEST:8h8h ID:8h8h8h8h TYPE:4h STARTUP:1b CH:3d WSPEED:~8h~4h ~4h~8h WDIR:12h ?4h RAINFLAG:8h RAIN:8h8h UV:8h8h CHKSUM:8h
//
// Digest is LFSR-16 gen 0x8810 key 0x5412, excluding the add-checksum and trailer.
// Checksum is 8-bit add (with carry) to 0xff.
Expand Down Expand Up @@ -835,13 +837,18 @@ DecodeStatus WeatherSensor::decodeBresser6In1Payload(const uint8_t *msg, uint8_t

moisture_ok = false;

// Pool / Spa thermometer
if (sensor[slot].s_type == SENSOR_TYPE_POOL_THERMO) {
humidity_ok = false;
}

// the moisture sensor might present valid readings but does not have the hardware
if (sensor[slot].s_type == 4) {
if (sensor[slot].s_type == SENSOR_TYPE_SOIL) {
wind_ok = 0;
uv_ok = 0;
}

if (sensor[slot].s_type == 4 && temp_ok && sensor[slot].humidity >= 1 && sensor[slot].humidity <= 16) {
if (sensor[slot].s_type == SENSOR_TYPE_SOIL && temp_ok && sensor[slot].humidity >= 1 && sensor[slot].humidity <= 16) {
moisture_ok = true;
humidity_ok = false;
sensor[slot].moisture = moisture_map[sensor[slot].humidity - 1];
Expand Down
3 changes: 3 additions & 0 deletions src/WeatherSensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
// 20230723 Added SENSOR_TYPE_WATER
// 20230804 Added Bresser Water Leakage Sensor decoder
// 20231006 Added crc16() from https://github.com/merbanan/rtl_433/blob/master/src/util.c
// 20231024 Added SENSOR_TYPE_POOL_THERMO
//
// ToDo:
// -
Expand All @@ -80,6 +81,7 @@
// - Professional Wind Gauge 6-in-1; PN 7002531
// 2 - Thermo-/Hygro-Sensor 6-in-1; PN 7009999
// 3 - Lightning Sensor PN 7009976
// 3 - Pool / Spa Thermometer PN 7000073
// 4 - Soil Moisture Sensor 6-in-1; PN 7009972
// 5 - Water Leakage Sensor 6-in-1; PN 7009975
// 9 - Professional Rain Gauge (5-in-1 decoder)
Expand All @@ -92,6 +94,7 @@
#define SENSOR_TYPE_WEATHER1 1 // Weather Station
#define SENSOR_TYPE_THERMO_HYGRO 2 // Thermo-/Hygro-Sensor
#define SENSOR_TYPE_LIGHTNING 3 // Lightning Sensor
#define SENSOR_TYPE_POOL_THERMO 3 // Pool / Spa Thermometer
#define SENSOR_TYPE_SOIL 4 // Soil Temperature and Moisture (from 6-in-1 decoder)
#define SENSOR_TYPE_LEAKAGE 5 // Water Leakage
#define SENSOR_TYPE_RAIN 9 // Professional Rain Gauge (from 5-in-1 decoder)
Expand Down

0 comments on commit 37d75dc

Please sign in to comment.