-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 Schou 72543 Rain sensor #2686
Conversation
Also, should this be a "draft" Pull request? I'm still new to both git and github |
src/devices/schou_72543_rain.c
Outdated
//Assuming option #1 | ||
|
||
// Full data is 3 rows, two are required for data validation | ||
if(bitbuffer->num_rows < 2){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add space after keywords (if) and before braces.
src/devices/schou_72543_rain.c
Outdated
uint8_t micSum = b[7]; // Checksum as read | ||
uint8_t calSum = 0; // Checksum as calculated | ||
|
||
for(i = 0; i<7; i++){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use int cal_sum = add_bytes(b, 7);
|
2) schou_72543_rain added to include/rtl_433_devices.h
Conflicts: include/rtl_433_devices.h Solution: rearrange schou_72543_rain after tmps_nissan
src/devices/schou_72543_rain.c
Outdated
@@ -70,7 +69,7 @@ static int schou_72543_rain_decode(r_device *decoder, bitbuffer_t *bitbuffer) | |||
//Assuming option #1 | |||
|
|||
// Full data is 3 rows, two are required for data validation | |||
if(bitbuffer->num_rows < 2){ | |||
if (bitbuffer->num_rows < 2){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and a space near the end :)
src/devices/schou_72543_rain.c
Outdated
rain_mm = ((b[4] << 8 ) & b[3]) / 10.0f; | ||
temp_F = (((b[6] << 8 ) & b[5]) / 10.0f) - 90; | ||
temp_F = (((b[6] << 8 ) & b[5]) / 10.0f) - 90; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would be better written as (((b[6] << 8 ) | b[5]) - 900) * 0.1f;
also above, and note to use |
not &
src/devices/schou_72543_rain.c
Outdated
rain_mm = ((b[4] << 8 ) & b[3]) / 10.0f; | ||
temp_F = (((b[6] << 8 ) & b[5]) / 10.0f) - 90; | ||
temp_F = (((b[6] << 8 ) & b[5]) / 10.0f) - 90; | ||
|
||
/* clang-format off */ | ||
data = data_make( | ||
"model", "", DATA_STRING, "Schou 72543 rain sensor", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
model needs to be just "Schou-72543"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @zuckschwerdt for the comments. I seriously appreciate the support!
And I am sorry for the amount of commits. I still did not get the "squish" i think it is called of multiple- to one commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to help. No need to squash. We'll do it on merge anyway.
…ully tested with the rtl_433_tests/tests/Schou/g*.cu8 files
* model name under r_device section and data_make section aligend to schou_72543
…r schou_72543_rain Updates - schou_72543 is now schou_72543_rain everywhere - temp_F has become temperature_F to simplify integration with Home Assistant - schou_72543_rain has device number 250 after merging changes from the merbanan/rtl_433 master branch
Hi @zuckschwerdt, |
Hi Jesper & co, This decoder looks similar to MTX rain gauge sold in Finland by Motonet (Product code: 86-01352) and MarQuant Wireless Rain Gauge (Product code: 014369) sold by JULA AB, Sweden. Rain gauge range 0 .. 9999mm. (Display range) When running MTX device: rtl_433.exe -X n=MTX_RAIN,m=OOK_PWM,s=992,l=2696,r=2684,g=0,t=0,y=7088,bits=65,rows=3,repeats=2 Modulation: OOK_PWM Sample Data: time : 2023-11-25 15:16:22 Rain count is starting at power up as described from fff6, it is rotated to 0000 after ffff
Thanks |
You can change that in the code and recompile. https://github.com/merbanan/rtl_433/blob/master/src/devices/schou_72543_rain.c#L80
Use |
Hi,
I have tried to my best ability to write up a decoder for my Schou rain sensor (model: 72543).
The code is not 100% done, but it is at a stage where I would like to request some help.
I have added a pull request with test samples and a longer device description to the rtl_433_tests project,
which has not yet been merged in, so please find it here until then: https://github.com/36jemini/rtl_433_tests/tree/master/tests/Schou
I would like some guidance on,
Comments, feedback and guidance will be highly appreciated.