Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Lidl Auriol 4-LD6313 and 4-LD5972 temperature/rain sensor #2633

Merged
merged 18 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion conf/rtl_433.example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 17 additions & 8 deletions src/devices/auriol_4ld5661.c
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)

*/

Expand Down Expand Up @@ -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;

Expand All @@ -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 */

Expand All @@ -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,
Expand Down
Loading