From 2cbf3e575aa0f346fa8df98cf2e5ab1c58b03c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?So=C3=B3s=20P=C3=A9ter?= Date: Mon, 25 Sep 2023 12:01:07 +0200 Subject: [PATCH] Add Lidl Auriol 4-LD6313 and 4-LD5972 temperature/rain sensor (#2633) Co-authored-by: soosp --- README.md | 2 +- conf/rtl_433.example.conf | 2 +- src/devices/auriol_4ld5661.c | 25 +++++++++++++++++-------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 672c59136..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 temperature/rain sensor + [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..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 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 3722e144e..1a9aa3be8 100644 --- a/src/devices/auriol_4ld5661.c +++ b/src/devices/auriol_4ld5661.c @@ -1,7 +1,8 @@ /** @file - Auriol 4-LD5661 sensor. + Auriol 4-LD5661/4-LD5972/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,19 +11,19 @@ */ /** -Lidl Auriol 4-LD5661 sensor. +Lidl Auriol 4-LD5661/4-LD5972/4-LD6313 sensors. -See also issue #1857. +See also issues #1857, #2631 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: 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 -- 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.3 mm (4-LD5661) or 0.242 mm (4-LD6313) */ @@ -52,11 +53,17 @@ static int auriol_4ld5661_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. - See also: https://github.com/merbanan/rtl_433/issues/1837 + 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). + 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 */ float rain = rain_raw * 1.0F; @@ -67,6 +74,7 @@ static int auriol_4ld5661_decode(r_device *decoder, bitbuffer_t *bitbuffer) "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 */ @@ -83,11 +91,12 @@ static char const *const output_fields[] = { "battery_ok", "temperature_C", "rain_mm", + "rain", NULL, }; r_device const auriol_4ld5661 = { - .name = "Auriol 4-LD5661 temperature/rain sensor", + .name = "Auriol 4-LD5661/4-LD5972/4-LD6313 temperature/rain sensors", .modulation = OOK_PULSE_PPM, .short_width = 1000, .long_width = 2000,