From 300d2a149541c110b7c32602c6020e7d1be8e67f Mon Sep 17 00:00:00 2001 From: soosp Date: Fri, 22 Sep 2023 23:23:49 +0200 Subject: [PATCH 01/17] Add Lidl Auriol 4-LD6313 temperature/rain sensor --- include/rtl_433_devices.h | 1 + src/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/include/rtl_433_devices.h b/include/rtl_433_devices.h index 1d18eebb1..bb80b0ec9 100644 --- a/include/rtl_433_devices.h +++ b/include/rtl_433_devices.h @@ -254,6 +254,7 @@ DECL(fineoffset_ws90) \ DECL(thermopro_tx2c) \ DECL(tfa_303151) \ + DECL(auriol_4ld6313) \ /* Add new decoders here. */ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index adfafa8e5..b12f6eab0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -55,6 +55,7 @@ add_library(r_433 STATIC devices/archos_tbh.c devices/atech_ws308.c devices/auriol_4ld5661.c + devices/auriol_4ld6313.c devices/auriol_aft77b2.c devices/auriol_afw2a1.c devices/auriol_ahfl.c From 99c0534cde67fcf6191ec4f0d4a996b0d14080a2 Mon Sep 17 00:00:00 2001 From: soosp Date: Fri, 22 Sep 2023 23:51:23 +0200 Subject: [PATCH 02/17] Add Lidl Auriol 4-LD6313 temperature/rain sensor --- src/devices/auriol_4ld6313.c | 95 ++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 src/devices/auriol_4ld6313.c diff --git a/src/devices/auriol_4ld6313.c b/src/devices/auriol_4ld6313.c new file mode 100644 index 000000000..e4ecdc9b2 --- /dev/null +++ b/src/devices/auriol_4ld6313.c @@ -0,0 +1,95 @@ +/** @file + Auriol 4-LD5661 sensor. + + Copyright (C) 2021 Balazs H. + Copyright (C) 2023 Peter Soos + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. +*/ + +/** +This code is heavily based on auriol_4ld5661.c. +It contains minor modifications to support Lidl Auriol 4-LD6313 sensor. + +Data layout: + + II B TTT F RRRRRR + +- I: id, 8 bit: 60 +- B: battery, 4 bit: 0x8 if normal, 0x0 if low +- T: temperature, 12 bit: 2's complement, scaled by 10 +- F: 4 bit: seems to be 0xf constantly, a separator between temp and rain +- R: rain sensor, probably the remaining 24 bit: a counter for every 0.242 mm of rain, counts from sensor power up + +*/ + +#include "decoder.h" + +static int auriol_4ld6313_decode(r_device *decoder, bitbuffer_t *bitbuffer) +{ + int ret = 0; + + for (int i = 0; i < bitbuffer->num_rows; i++) { + if (bitbuffer->bits_per_row[i] != 52) { + ret = DECODE_ABORT_LENGTH; + continue; + } + + uint8_t *b = bitbuffer->bb[i]; + int id = b[0]; + int batt_ok = b[1] >> 7; + + if (b[3] != 0xf0 || (b[1] & 0x70) != 0) { + ret = DECODE_FAIL_MIC; + continue; + } + + int temp_raw = (int16_t)(((b[1] & 0x0f) << 12) | (b[2] << 4)); // uses sign extend + float temp_c = (temp_raw >> 4) * 0.1F; + + int rain_raw = (b[4] << 12) | (b[5] << 4) | b[6] >> 4; + + /* The display unit which comes with this device, multiplies gauge tip counts by 0.242 mm */ + float rain = rain_raw * 0.242F; + + /* clang-format off */ + data_t *data = data_make( + "model", "Model", DATA_STRING, "Auriol-4LD6313", + "id", "ID", DATA_FORMAT, "%02x", DATA_INT, id, + "battery_ok", "Battery OK", DATA_INT, batt_ok, + "temperature_C", "Temperature", DATA_FORMAT, "%.01f C", DATA_DOUBLE, temp_c, + "rain_mm", "Rain", DATA_FORMAT, "%.01f mm", DATA_DOUBLE, rain, + NULL); + /* clang-format on */ + + decoder_output_data(decoder, data); + return 1; + } + + return ret; +} + +static char const *const output_fields[] = { + "model", + "id", + "battery_ok", + "temperature_C", + "rain_mm", + NULL, +}; + +r_device const auriol_4ld6313 = { + .name = "Auriol 4-LD6313 temperature/rain sensor", + .modulation = OOK_PULSE_PPM, + .short_width = 1000, + .long_width = 2000, + .sync_width = 2500, + .gap_limit = 2500, + .reset_limit = 4000, + .decode_fn = &auriol_4ld6313_decode, + .disabled = 1, // no sync-word, no fix id, no checksum + .fields = output_fields, +}; From e48214e43d070c04cc1f83d54a491c0965f1342b Mon Sep 17 00:00:00 2001 From: soosp Date: Sat, 23 Sep 2023 21:41:21 +0200 Subject: [PATCH 03/17] Auriol 4-LD5661 and 4-LD6313 drivers merged into a single file --- .../{auriol_4ld5661.c => auriol_4ld.c} | 41 +++++--- src/devices/auriol_4ld6313.c | 95 ------------------- 2 files changed, 30 insertions(+), 106 deletions(-) rename src/devices/{auriol_4ld5661.c => auriol_4ld.c} (69%) delete mode 100644 src/devices/auriol_4ld6313.c diff --git a/src/devices/auriol_4ld5661.c b/src/devices/auriol_4ld.c similarity index 69% rename from src/devices/auriol_4ld5661.c rename to src/devices/auriol_4ld.c index 3722e144e..96b22e83e 100644 --- a/src/devices/auriol_4ld5661.c +++ b/src/devices/auriol_4ld.c @@ -1,7 +1,8 @@ /** @file - Auriol 4-LD5661 sensor. + Auriol 4-LD5661 and 4-LD6313 sensors. Copyright (C) 2021 Balazs H. + Copyright (C) 2023 Peter Soos This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -10,26 +11,30 @@ */ /** -Lidl Auriol 4-LD5661 sensor. +Lidl Auriol 4-LD5661 / 4-LD6313 sensor. -See also issue #1857. +See also issue #1857 and PR #2633 Data layout: II B TTT F RRRRRR -- I: id, 8 bit: what we've seen so far are 1a, c6 +- I: id, 8 bit: what we've seen so far are 1a, c6 for 4-LD5661 and 60 for 4LD6313 - B: battery, 4 bit: 0x8 if normal, 0x0 if low - T: temperature, 12 bit: 2's complement, scaled by 10 - F: 4 bit: seems to be 0xf constantly, a separator between temp and rain -- R: rain sensor, probably the remaining 24 bit: a counter for every 0.3mm of rain +- R: rain sensor, probably the remaining 24 bit: a counter for every 0.3mm (4-LD5661) or 0.242 (4-LD6313) */ #include "decoder.h" -static int auriol_4ld5661_decode(r_device *decoder, bitbuffer_t *bitbuffer) +static int auriol_4ld_decode(r_device *decoder, bitbuffer_t *bitbuffer) { + const char *model_4ds5661 = "Auriol-4LD5661"; + const char *model_4ds6313 = "Auriol-4LD6313"; + char model[16]; + int ret = 0; for (int i = 0; i < bitbuffer->num_rows; i++) { @@ -42,6 +47,16 @@ static int auriol_4ld5661_decode(r_device *decoder, bitbuffer_t *bitbuffer) int id = b[0]; int batt_ok = b[1] >> 7; + switch (id) { + case 0x1a: + case 0xc6: + strncpy (model, model_4ds5661, strlen(model_4ds5661)+1); + break; + case 0x60: + strncpy (model, model_4ds6313, strlen(model_4ds6313)+1); + break; + } + if (b[3] != 0xf0 || (b[1] & 0x70) != 0) { ret = DECODE_FAIL_MIC; continue; @@ -56,17 +71,21 @@ static int auriol_4ld5661_decode(r_device *decoder, bitbuffer_t *bitbuffer) to be very inaccurate. We did a lot of measurements, the gauge's capacity is about 7.5 ml, the rain collection surface diameter is 96mm, 7.5 ml /((9.6 cm/2)^2*pi) ~= 1 mm of rain. Therefore we decided to correct this multiplier. - See also: https://github.com/merbanan/rtl_433/issues/1837 + The rain bucket tips a 7.2 ml for 4-LS6313. The physical parameters are same. The calculation + and the result is similar: 7.2 ml / ((96 mm / 2)^2 * pi) ~= 1 mm (more exactly 0.995 mm) + See also: https://github.com/merbanan/rtl_433/issues/1837 and + https://github.com/merbanan/rtl_433/pull/2633 */ float rain = rain_raw * 1.0F; /* clang-format off */ data_t *data = data_make( - "model", "Model", DATA_STRING, "Auriol-4LD5661", + "model", "Model", DATA_STRING, model, "id", "ID", DATA_FORMAT, "%02x", DATA_INT, id, "battery_ok", "Battery OK", DATA_INT, batt_ok, "temperature_C", "Temperature", DATA_FORMAT, "%.01f C", DATA_DOUBLE, temp_c, "rain_mm", "Rain", DATA_FORMAT, "%.01f mm", DATA_DOUBLE, rain, + "rain", "Rain tips", DATA_INT, rain_raw, NULL); /* clang-format on */ @@ -86,15 +105,15 @@ static char const *const output_fields[] = { NULL, }; -r_device const auriol_4ld5661 = { - .name = "Auriol 4-LD5661 temperature/rain sensor", +r_device const auriol_4ld = { + .name = "Auriol 4-LD5661/4-LD6313 temperature/rain sensors", .modulation = OOK_PULSE_PPM, .short_width = 1000, .long_width = 2000, .sync_width = 2500, .gap_limit = 2500, .reset_limit = 4000, - .decode_fn = &auriol_4ld5661_decode, + .decode_fn = &auriol_4ld_decode, .disabled = 1, // no sync-word, no fix id, no checksum .fields = output_fields, }; diff --git a/src/devices/auriol_4ld6313.c b/src/devices/auriol_4ld6313.c deleted file mode 100644 index e4ecdc9b2..000000000 --- a/src/devices/auriol_4ld6313.c +++ /dev/null @@ -1,95 +0,0 @@ -/** @file - Auriol 4-LD5661 sensor. - - Copyright (C) 2021 Balazs H. - Copyright (C) 2023 Peter Soos - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. -*/ - -/** -This code is heavily based on auriol_4ld5661.c. -It contains minor modifications to support Lidl Auriol 4-LD6313 sensor. - -Data layout: - - II B TTT F RRRRRR - -- I: id, 8 bit: 60 -- B: battery, 4 bit: 0x8 if normal, 0x0 if low -- T: temperature, 12 bit: 2's complement, scaled by 10 -- F: 4 bit: seems to be 0xf constantly, a separator between temp and rain -- R: rain sensor, probably the remaining 24 bit: a counter for every 0.242 mm of rain, counts from sensor power up - -*/ - -#include "decoder.h" - -static int auriol_4ld6313_decode(r_device *decoder, bitbuffer_t *bitbuffer) -{ - int ret = 0; - - for (int i = 0; i < bitbuffer->num_rows; i++) { - if (bitbuffer->bits_per_row[i] != 52) { - ret = DECODE_ABORT_LENGTH; - continue; - } - - uint8_t *b = bitbuffer->bb[i]; - int id = b[0]; - int batt_ok = b[1] >> 7; - - if (b[3] != 0xf0 || (b[1] & 0x70) != 0) { - ret = DECODE_FAIL_MIC; - continue; - } - - int temp_raw = (int16_t)(((b[1] & 0x0f) << 12) | (b[2] << 4)); // uses sign extend - float temp_c = (temp_raw >> 4) * 0.1F; - - int rain_raw = (b[4] << 12) | (b[5] << 4) | b[6] >> 4; - - /* The display unit which comes with this device, multiplies gauge tip counts by 0.242 mm */ - float rain = rain_raw * 0.242F; - - /* clang-format off */ - data_t *data = data_make( - "model", "Model", DATA_STRING, "Auriol-4LD6313", - "id", "ID", DATA_FORMAT, "%02x", DATA_INT, id, - "battery_ok", "Battery OK", DATA_INT, batt_ok, - "temperature_C", "Temperature", DATA_FORMAT, "%.01f C", DATA_DOUBLE, temp_c, - "rain_mm", "Rain", DATA_FORMAT, "%.01f mm", DATA_DOUBLE, rain, - NULL); - /* clang-format on */ - - decoder_output_data(decoder, data); - return 1; - } - - return ret; -} - -static char const *const output_fields[] = { - "model", - "id", - "battery_ok", - "temperature_C", - "rain_mm", - NULL, -}; - -r_device const auriol_4ld6313 = { - .name = "Auriol 4-LD6313 temperature/rain sensor", - .modulation = OOK_PULSE_PPM, - .short_width = 1000, - .long_width = 2000, - .sync_width = 2500, - .gap_limit = 2500, - .reset_limit = 4000, - .decode_fn = &auriol_4ld6313_decode, - .disabled = 1, // no sync-word, no fix id, no checksum - .fields = output_fields, -}; From e8b2b144088b2c0b2e55957c565ee0c5037dd3ee Mon Sep 17 00:00:00 2001 From: soosp Date: Sat, 23 Sep 2023 21:52:13 +0200 Subject: [PATCH 04/17] Auriol 4-LD5661 and 4-LD6313 drivers merged into a single file --- include/rtl_433_devices.h | 3 +-- src/CMakeLists.txt | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/rtl_433_devices.h b/include/rtl_433_devices.h index bb80b0ec9..97e343bf6 100644 --- a/include/rtl_433_devices.h +++ b/include/rtl_433_devices.h @@ -207,7 +207,7 @@ DECL(acurite_01185m) \ DECL(enocean_erp1) \ DECL(megacode) \ - DECL(auriol_4ld5661) \ + DECL(auriol_4ld) \ DECL(tpms_truck) \ DECL(funkbus_remote) \ DECL(tpms_porsche) \ @@ -254,7 +254,6 @@ DECL(fineoffset_ws90) \ DECL(thermopro_tx2c) \ DECL(tfa_303151) \ - DECL(auriol_4ld6313) \ /* Add new decoders here. */ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b12f6eab0..afde9f346 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -54,8 +54,7 @@ add_library(r_433 STATIC devices/ant_antplus.c devices/archos_tbh.c devices/atech_ws308.c - devices/auriol_4ld5661.c - devices/auriol_4ld6313.c + devices/auriol_4ld.c devices/auriol_aft77b2.c devices/auriol_afw2a1.c devices/auriol_ahfl.c From b565b74e2cd89995e83032bdf0affde7df6cedaa Mon Sep 17 00:00:00 2001 From: soosp Date: Sat, 23 Sep 2023 22:07:12 +0200 Subject: [PATCH 05/17] Added unknown model string --- src/devices/auriol_4ld.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/devices/auriol_4ld.c b/src/devices/auriol_4ld.c index 96b22e83e..e41ba1fbb 100644 --- a/src/devices/auriol_4ld.c +++ b/src/devices/auriol_4ld.c @@ -33,6 +33,7 @@ static int auriol_4ld_decode(r_device *decoder, bitbuffer_t *bitbuffer) { const char *model_4ds5661 = "Auriol-4LD5661"; const char *model_4ds6313 = "Auriol-4LD6313"; + const char *model_unknown = "Unknown model"; char model[16]; int ret = 0; @@ -55,6 +56,8 @@ static int auriol_4ld_decode(r_device *decoder, bitbuffer_t *bitbuffer) case 0x60: strncpy (model, model_4ds6313, strlen(model_4ds6313)+1); break; + default: + strncpy (model, model_unknown, strlen(model_unknown)+1); } if (b[3] != 0xf0 || (b[1] & 0x70) != 0) { From 1fec72b0a17f2c30296399cf5e094dc382feb83e Mon Sep 17 00:00:00 2001 From: soosp Date: Sat, 23 Sep 2023 23:48:09 +0200 Subject: [PATCH 06/17] Corrected some comments and typos --- src/devices/auriol_4ld.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/devices/auriol_4ld.c b/src/devices/auriol_4ld.c index e41ba1fbb..014e555d2 100644 --- a/src/devices/auriol_4ld.c +++ b/src/devices/auriol_4ld.c @@ -23,7 +23,7 @@ Data layout: - B: battery, 4 bit: 0x8 if normal, 0x0 if low - T: temperature, 12 bit: 2's complement, scaled by 10 - F: 4 bit: seems to be 0xf constantly, a separator between temp and rain -- R: rain sensor, probably the remaining 24 bit: a counter for every 0.3mm (4-LD5661) or 0.242 (4-LD6313) +- R: rain sensor, probably the remaining 24 bit: a counter for every 0.3 mm (4-LD5661) or 0.242 mm (4-LD6313) */ @@ -70,14 +70,16 @@ static int auriol_4ld_decode(r_device *decoder, bitbuffer_t *bitbuffer) int rain_raw = (b[4] << 12) | (b[5] << 4) | b[6] >> 4; - /* The display unit which comes with this device, multiplies gauge tip counts by 0.3 mm, which seems + /* The display unit which comes with this devices, multiplies gauge tip counts by 0.3 mm, which seems to be very inaccurate. We did a lot of measurements, the gauge's capacity is about 7.5 ml, the rain collection surface diameter is 96mm, 7.5 ml /((9.6 cm/2)^2*pi) ~= 1 mm of rain. Therefore we decided to correct this multiplier. - The rain bucket tips a 7.2 ml for 4-LS6313. The physical parameters are same. The calculation +i The rain bucket tips at 7.2 ml for 4-LS6313. The main unit counts 0.242 mm per sensor tips. + The physical parameters are same. The calculation and the result is similar: 7.2 ml / ((96 mm / 2)^2 * pi) ~= 1 mm (more exactly 0.995 mm) - See also: https://github.com/merbanan/rtl_433/issues/1837 and - https://github.com/merbanan/rtl_433/pull/2633 + See also: + https://github.com/merbanan/rtl_433/issues/1837 + https://github.com/merbanan/rtl_433/pull/2633 */ float rain = rain_raw * 1.0F; From 539a9ad659512c255a7d64a443ec1b64faa84c1b Mon Sep 17 00:00:00 2001 From: soosp Date: Sat, 23 Sep 2023 23:54:28 +0200 Subject: [PATCH 07/17] Updated the README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 672c59136..b4d32f89e 100644 --- a/README.md +++ b/README.md @@ -283,7 +283,7 @@ See [CONTRIBUTING.md](./docs/CONTRIBUTING.md). [197] Acurite Grill/Meat Thermometer 01185M [198]* EnOcean ERP1 [199] Linear Megacode Garage/Gate Remotes - [200]* Auriol 4-LD5661 temperature/rain sensor + [200]* Auriol 4-LD5661 / 4-LD6313 temperature/rain sensors [201] Unbranded SolarTPMS for trucks [202] Funkbus / Instafunk (Berker, Gira, Jung) [203] Porsche Boxster/Cayman TPMS From 314968d5108df67c6fe95bc7c9d7faaa24941e8d Mon Sep 17 00:00:00 2001 From: soosp Date: Sun, 24 Sep 2023 15:09:54 +0200 Subject: [PATCH 08/17] Keep the original device name and add new one to documentation/comments --- README.md | 2 +- include/rtl_433_devices.h | 2 +- src/CMakeLists.txt | 2 +- .../{auriol_4ld.c => auriol_4ld5661.c} | 36 ++++++------------- 4 files changed, 14 insertions(+), 28 deletions(-) rename src/devices/{auriol_4ld.c => auriol_4ld5661.c} (78%) diff --git a/README.md b/README.md index b4d32f89e..7d271771f 100644 --- a/README.md +++ b/README.md @@ -283,7 +283,7 @@ See [CONTRIBUTING.md](./docs/CONTRIBUTING.md). [197] Acurite Grill/Meat Thermometer 01185M [198]* EnOcean ERP1 [199] Linear Megacode Garage/Gate Remotes - [200]* Auriol 4-LD5661 / 4-LD6313 temperature/rain sensors + [200]* Auriol 4-LD5661/4-LD6313 temperature/rain sensors [201] Unbranded SolarTPMS for trucks [202] Funkbus / Instafunk (Berker, Gira, Jung) [203] Porsche Boxster/Cayman TPMS diff --git a/include/rtl_433_devices.h b/include/rtl_433_devices.h index 97e343bf6..1d18eebb1 100644 --- a/include/rtl_433_devices.h +++ b/include/rtl_433_devices.h @@ -207,7 +207,7 @@ DECL(acurite_01185m) \ DECL(enocean_erp1) \ DECL(megacode) \ - DECL(auriol_4ld) \ + DECL(auriol_4ld5661) \ DECL(tpms_truck) \ DECL(funkbus_remote) \ DECL(tpms_porsche) \ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index afde9f346..adfafa8e5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -54,7 +54,7 @@ add_library(r_433 STATIC devices/ant_antplus.c devices/archos_tbh.c devices/atech_ws308.c - devices/auriol_4ld.c + devices/auriol_4ld5661.c devices/auriol_aft77b2.c devices/auriol_afw2a1.c devices/auriol_ahfl.c diff --git a/src/devices/auriol_4ld.c b/src/devices/auriol_4ld5661.c similarity index 78% rename from src/devices/auriol_4ld.c rename to src/devices/auriol_4ld5661.c index 014e555d2..e7f1d9425 100644 --- a/src/devices/auriol_4ld.c +++ b/src/devices/auriol_4ld5661.c @@ -11,10 +11,13 @@ */ /** -Lidl Auriol 4-LD5661 / 4-LD6313 sensor. +Lidl Auriol 4-LD5661/4-LD6313 sensoris. See also issue #1857 and PR #2633 +There are reports about 4-LD5972 is working with this driver. +See issue #2631 + Data layout: II B TTT F RRRRRR @@ -29,13 +32,8 @@ Data layout: #include "decoder.h" -static int auriol_4ld_decode(r_device *decoder, bitbuffer_t *bitbuffer) +static int auriol_4ld5661_decode(r_device *decoder, bitbuffer_t *bitbuffer) { - const char *model_4ds5661 = "Auriol-4LD5661"; - const char *model_4ds6313 = "Auriol-4LD6313"; - const char *model_unknown = "Unknown model"; - char model[16]; - int ret = 0; for (int i = 0; i < bitbuffer->num_rows; i++) { @@ -48,18 +46,6 @@ static int auriol_4ld_decode(r_device *decoder, bitbuffer_t *bitbuffer) int id = b[0]; int batt_ok = b[1] >> 7; - switch (id) { - case 0x1a: - case 0xc6: - strncpy (model, model_4ds5661, strlen(model_4ds5661)+1); - break; - case 0x60: - strncpy (model, model_4ds6313, strlen(model_4ds6313)+1); - break; - default: - strncpy (model, model_unknown, strlen(model_unknown)+1); - } - if (b[3] != 0xf0 || (b[1] & 0x70) != 0) { ret = DECODE_FAIL_MIC; continue; @@ -74,9 +60,9 @@ static int auriol_4ld_decode(r_device *decoder, bitbuffer_t *bitbuffer) to be very inaccurate. We did a lot of measurements, the gauge's capacity is about 7.5 ml, the rain collection surface diameter is 96mm, 7.5 ml /((9.6 cm/2)^2*pi) ~= 1 mm of rain. Therefore we decided to correct this multiplier. -i The rain bucket tips at 7.2 ml for 4-LS6313. The main unit counts 0.242 mm per sensor tips. - The physical parameters are same. The calculation - and the result is similar: 7.2 ml / ((96 mm / 2)^2 * pi) ~= 1 mm (more exactly 0.995 mm) + The rain bucket tips at 7.2 ml for 4-LS6313. The main unit counts 0.242 mm per sensor tips. + The physical parameters are same. The calculation + and the result is similar: 7.2 ml / ((96 mm / 2)^2 * pi) ~= 1 mm (more exactly 0.995 mm) See also: https://github.com/merbanan/rtl_433/issues/1837 https://github.com/merbanan/rtl_433/pull/2633 @@ -85,7 +71,7 @@ i The rain bucket tips at 7.2 ml for 4-LS6313. The main unit counts 0.2 /* clang-format off */ data_t *data = data_make( - "model", "Model", DATA_STRING, model, + "model", "Model", DATA_STRING, "Auriol-4LD5661", "id", "ID", DATA_FORMAT, "%02x", DATA_INT, id, "battery_ok", "Battery OK", DATA_INT, batt_ok, "temperature_C", "Temperature", DATA_FORMAT, "%.01f C", DATA_DOUBLE, temp_c, @@ -110,7 +96,7 @@ static char const *const output_fields[] = { NULL, }; -r_device const auriol_4ld = { +r_device const auriol_4ld5661 = { .name = "Auriol 4-LD5661/4-LD6313 temperature/rain sensors", .modulation = OOK_PULSE_PPM, .short_width = 1000, @@ -118,7 +104,7 @@ r_device const auriol_4ld = { .sync_width = 2500, .gap_limit = 2500, .reset_limit = 4000, - .decode_fn = &auriol_4ld_decode, + .decode_fn = &auriol_4ld5661_decode, .disabled = 1, // no sync-word, no fix id, no checksum .fields = output_fields, }; From d37ba6746b6fe518d7c5a0b6538a2bf81ea27a85 Mon Sep 17 00:00:00 2001 From: soosp Date: Sun, 24 Sep 2023 15:13:22 +0200 Subject: [PATCH 09/17] Fixed typo --- src/devices/auriol_4ld5661.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/auriol_4ld5661.c b/src/devices/auriol_4ld5661.c index e7f1d9425..92cdddb41 100644 --- a/src/devices/auriol_4ld5661.c +++ b/src/devices/auriol_4ld5661.c @@ -11,7 +11,7 @@ */ /** -Lidl Auriol 4-LD5661/4-LD6313 sensoris. +Lidl Auriol 4-LD5661/4-LD6313 sensors. See also issue #1857 and PR #2633 From 98d81ef0f92c8a8bf3abc11ec0230b42c0613cbf Mon Sep 17 00:00:00 2001 From: soosp Date: Sun, 24 Sep 2023 15:20:13 +0200 Subject: [PATCH 10/17] Updated comment about ID --- src/devices/auriol_4ld5661.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/auriol_4ld5661.c b/src/devices/auriol_4ld5661.c index 92cdddb41..3c0c06117 100644 --- a/src/devices/auriol_4ld5661.c +++ b/src/devices/auriol_4ld5661.c @@ -22,7 +22,7 @@ Data layout: II B TTT F RRRRRR -- I: id, 8 bit: what we've seen so far are 1a, c6 for 4-LD5661 and 60 for 4LD6313 +- I: id, 8 bit: factory hardcoded random ID - B: battery, 4 bit: 0x8 if normal, 0x0 if low - T: temperature, 12 bit: 2's complement, scaled by 10 - F: 4 bit: seems to be 0xf constantly, a separator between temp and rain From 1d8c989f3eda57f147b32a2b52fe7cb7cb33c02e Mon Sep 17 00:00:00 2001 From: soosp Date: Sun, 24 Sep 2023 19:50:22 +0200 Subject: [PATCH 11/17] Added Auriol 4-LD5972 --- README.md | 2 +- conf/rtl_433.example.conf | 2 +- src/devices/auriol_4ld5661.c | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7d271771f..c594efe4a 100644 --- a/README.md +++ b/README.md @@ -283,7 +283,7 @@ See [CONTRIBUTING.md](./docs/CONTRIBUTING.md). [197] Acurite Grill/Meat Thermometer 01185M [198]* EnOcean ERP1 [199] Linear Megacode Garage/Gate Remotes - [200]* Auriol 4-LD5661/4-LD6313 temperature/rain sensors + [200]* Auriol 4-LD5661/4-LD5972/4-LD6313 temperature/rain sensors [201] Unbranded SolarTPMS for trucks [202] Funkbus / Instafunk (Berker, Gira, Jung) [203] Porsche Boxster/Cayman TPMS diff --git a/conf/rtl_433.example.conf b/conf/rtl_433.example.conf index b78b0a91b..a65e07eff 100644 --- a/conf/rtl_433.example.conf +++ b/conf/rtl_433.example.conf @@ -426,7 +426,7 @@ stop_after_successful_events false protocol 197 # Acurite Grill/Meat Thermometer 01185M # protocol 198 # EnOcean ERP1 protocol 199 # Linear Megacode Garage/Gate Remotes -# protocol 200 # Auriol 4-LD5661 temperature/rain sensor +# protocol 200 # Auriol 4-LD5661/4-LD5972/4-LD6313 temperature/rain sensor protocol 201 # Unbranded SolarTPMS for trucks protocol 202 # Funkbus / Instafunk (Berker, Gira, Jung) protocol 203 # Porsche Boxster/Cayman TPMS diff --git a/src/devices/auriol_4ld5661.c b/src/devices/auriol_4ld5661.c index 3c0c06117..eab67c832 100644 --- a/src/devices/auriol_4ld5661.c +++ b/src/devices/auriol_4ld5661.c @@ -1,5 +1,5 @@ /** @file - Auriol 4-LD5661 and 4-LD6313 sensors. + Auriol 4-LD5661/4-LD5972/4-LD6313 sensors. Copyright (C) 2021 Balazs H. Copyright (C) 2023 Peter Soos @@ -22,7 +22,7 @@ Data layout: II B TTT F RRRRRR -- I: id, 8 bit: factory hardcoded random ID +- I: id, 8 bit: factory (hard)coded random ID - B: battery, 4 bit: 0x8 if normal, 0x0 if low - T: temperature, 12 bit: 2's complement, scaled by 10 - F: 4 bit: seems to be 0xf constantly, a separator between temp and rain @@ -61,8 +61,9 @@ static int auriol_4ld5661_decode(r_device *decoder, bitbuffer_t *bitbuffer) rain collection surface diameter is 96mm, 7.5 ml /((9.6 cm/2)^2*pi) ~= 1 mm of rain. Therefore we decided to correct this multiplier. The rain bucket tips at 7.2 ml for 4-LS6313. The main unit counts 0.242 mm per sensor tips. - The physical parameters are same. The calculation - and the result is similar: 7.2 ml / ((96 mm / 2)^2 * pi) ~= 1 mm (more exactly 0.995 mm) + The physical parameters are same. The calculation and the result is similar: + 7.2 ml / ((96 mm / 2)^2 * pi) ~= 1 mm (more exactly 0.995 mm). + Similar calculation is valid for 4-LD5972 (See PR #2633). See also: https://github.com/merbanan/rtl_433/issues/1837 https://github.com/merbanan/rtl_433/pull/2633 @@ -97,7 +98,7 @@ static char const *const output_fields[] = { }; r_device const auriol_4ld5661 = { - .name = "Auriol 4-LD5661/4-LD6313 temperature/rain sensors", + .name = "Auriol 4-LD5661/4-LD5972/4-LD6313 temperature/rain sensors", .modulation = OOK_PULSE_PPM, .short_width = 1000, .long_width = 2000, From 1915d03842aef63e98a71bce739ae2aaa440d03f Mon Sep 17 00:00:00 2001 From: soosp Date: Sun, 24 Sep 2023 20:03:59 +0200 Subject: [PATCH 12/17] Added Auriol 4-LD5972 --- src/devices/auriol_4ld5661.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/devices/auriol_4ld5661.c b/src/devices/auriol_4ld5661.c index eab67c832..e7c8a5790 100644 --- a/src/devices/auriol_4ld5661.c +++ b/src/devices/auriol_4ld5661.c @@ -11,12 +11,9 @@ */ /** -Lidl Auriol 4-LD5661/4-LD6313 sensors. +Lidl Auriol 4-LD5661/4-LD5972/4-LD6313 sensors. -See also issue #1857 and PR #2633 - -There are reports about 4-LD5972 is working with this driver. -See issue #2631 +See also issue #1857, #2631 and PR #2633 Data layout: From 368983c570f182de4cbcbcc291d6651d01e5f94e Mon Sep 17 00:00:00 2001 From: soosp Date: Mon, 25 Sep 2023 08:04:28 +0200 Subject: [PATCH 13/17] Fixed some typos --- conf/rtl_433.example.conf | 2 +- src/devices/auriol_4ld5661.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/rtl_433.example.conf b/conf/rtl_433.example.conf index a65e07eff..a24db4009 100644 --- a/conf/rtl_433.example.conf +++ b/conf/rtl_433.example.conf @@ -426,7 +426,7 @@ stop_after_successful_events false protocol 197 # Acurite Grill/Meat Thermometer 01185M # protocol 198 # EnOcean ERP1 protocol 199 # Linear Megacode Garage/Gate Remotes -# protocol 200 # Auriol 4-LD5661/4-LD5972/4-LD6313 temperature/rain sensor +# protocol 200 # Auriol 4-LD5661/4-LD5972/4-LD6313 temperature/rain sensors protocol 201 # Unbranded SolarTPMS for trucks protocol 202 # Funkbus / Instafunk (Berker, Gira, Jung) protocol 203 # Porsche Boxster/Cayman TPMS diff --git a/src/devices/auriol_4ld5661.c b/src/devices/auriol_4ld5661.c index e7c8a5790..2c70cdadc 100644 --- a/src/devices/auriol_4ld5661.c +++ b/src/devices/auriol_4ld5661.c @@ -13,7 +13,7 @@ /** Lidl Auriol 4-LD5661/4-LD5972/4-LD6313 sensors. -See also issue #1857, #2631 and PR #2633 +See also issues #1857, #2631 and PR #2633 Data layout: From 5cba9e259992cfa004815b51495ee406862a2f44 Mon Sep 17 00:00:00 2001 From: soosp Date: Mon, 25 Sep 2023 11:29:08 +0200 Subject: [PATCH 14/17] Add missed output field --- src/devices/auriol_4ld5661.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/devices/auriol_4ld5661.c b/src/devices/auriol_4ld5661.c index 2c70cdadc..d452b3599 100644 --- a/src/devices/auriol_4ld5661.c +++ b/src/devices/auriol_4ld5661.c @@ -91,6 +91,7 @@ static char const *const output_fields[] = { "battery_ok", "temperature_C", "rain_mm", + "rain" NULL, }; From 43633b6d38c7a4e7ded612f538ebacbf98d948b1 Mon Sep 17 00:00:00 2001 From: soosp Date: Mon, 25 Sep 2023 11:31:44 +0200 Subject: [PATCH 15/17] Add missed dash --- src/devices/auriol_4ld5661.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/auriol_4ld5661.c b/src/devices/auriol_4ld5661.c index d452b3599..cdf47ea34 100644 --- a/src/devices/auriol_4ld5661.c +++ b/src/devices/auriol_4ld5661.c @@ -91,7 +91,7 @@ static char const *const output_fields[] = { "battery_ok", "temperature_C", "rain_mm", - "rain" + "rain", NULL, }; From 54fb55fd9eb9447fa17fb2bfeef9b3235bf395f1 Mon Sep 17 00:00:00 2001 From: soosp Date: Mon, 25 Sep 2023 11:31:44 +0200 Subject: [PATCH 16/17] Add missed comma --- src/devices/auriol_4ld5661.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/auriol_4ld5661.c b/src/devices/auriol_4ld5661.c index d452b3599..cdf47ea34 100644 --- a/src/devices/auriol_4ld5661.c +++ b/src/devices/auriol_4ld5661.c @@ -91,7 +91,7 @@ static char const *const output_fields[] = { "battery_ok", "temperature_C", "rain_mm", - "rain" + "rain", NULL, }; From 62a43c33894dd037f554abfb107eec7890a2224a Mon Sep 17 00:00:00 2001 From: soosp Date: Mon, 25 Sep 2023 11:51:33 +0200 Subject: [PATCH 17/17] Fix indentation --- src/devices/auriol_4ld5661.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/auriol_4ld5661.c b/src/devices/auriol_4ld5661.c index cdf47ea34..1a9aa3be8 100644 --- a/src/devices/auriol_4ld5661.c +++ b/src/devices/auriol_4ld5661.c @@ -91,7 +91,7 @@ static char const *const output_fields[] = { "battery_ok", "temperature_C", "rain_mm", - "rain", + "rain", NULL, };