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 support for Aldi Sempre 4-AH0423-4 temperature/rain sensor #2716

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
18 changes: 12 additions & 6 deletions src/devices/auriol_4ld5661.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/** @file
Auriol 4-LD5661/4-LD5972/4-LD6313 sensors.
Auriol 4-LD5661/4-LD5972/4-LD6313, Sempre 4-AH0423-4 sensors.

Copyright (C) 2021 Balazs H.
Copyright (C) 2023 Peter Soos
Copyright (C) 2023 Gerald Reisinger


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 @@ -11,16 +13,20 @@
*/

/**
Lidl Auriol 4-LD5661/4-LD5972/4-LD6313 sensors.
Lidl Auriol 4-LD5661/4-LD5972/4-LD6313 and Aldi Sempre 4-AH0423-4 sensors.
sorny marked this conversation as resolved.
Show resolved Hide resolved

See also issues #1857, #2631 and PR #2633

Data layout:

II B TTT F RRRRRR
1a 80 88 f0 00 14 5
00011010 10000000 10001000 11110000 00000000 00010100 0101
IIIIIIII B?CCTTTT TTTTTTTT FFFFRRRR RRRRRRRR RRRRRRRR RRRR

- I: id, 8 bit: factory (hard)coded random ID
- B: battery, 4 bit: 0x8 if normal, 0x0 if low
- B: battery, 1 bit: 1=OK, 0=LOW
- ?: flag, 1 bit: seems to always 0
- C: channel, 2 bit: seems to be a hardcoded channel, 0 on auriol, 3 on sempre
- 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.3 mm (4-LD5661) or 0.242 mm (4-LD6313)
Expand All @@ -43,7 +49,7 @@ static int auriol_4ld5661_decode(r_device *decoder, bitbuffer_t *bitbuffer)
int id = b[0];
int batt_ok = b[1] >> 7;

if (b[3] != 0xf0 || (b[1] & 0x70) != 0) {
if (b[3] != 0xf0 || (b[1] & 0x40) != 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will ignore the two bits. But don't we want to check that it's 0 or 3? I.e. 1 or 2 are invalid.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends, no idea if there are other brands of this rain meter out there that would use either ch1 or ch2 :/

ret = DECODE_FAIL_MIC;
continue;
}
Expand Down Expand Up @@ -96,7 +102,7 @@ static char const *const output_fields[] = {
};

r_device const auriol_4ld5661 = {
.name = "Auriol 4-LD5661/4-LD5972/4-LD6313 temperature/rain sensors",
.name = "Auriol 4-LD5661/4-LD5972/4-LD6313, Sempre 4-AH0423-4 temperature/rain sensors",
.modulation = OOK_PULSE_PPM,
.short_width = 1000,
.long_width = 2000,
Expand Down
Loading