How to correctly parse the Bits in a git line

80 views
Skip to first unread message

Kevin Saye

unread,
Mar 17, 2022, 3:32:02 PM3/17/22
to rtl_433
I have been able to parse the output of: https://www.banggood.com/DY-SQ100B-Water-Leakage-Detector-Rustproof-Sensor-Alarm-433MHz-for-Security-Home-Alarm-System-p-1266537.html as seen here:
I have written a decoder as such:
decoder {
    name=LeakDetector,
    modulation=OOK_PWM,
    short=316,
    long=968,
    reset=916,
    gap=0,
    tolerance=261,
    bits=33,
    get=Location:@0:{16}:[42460: HotWaterHeater 5853:KevinSink 7133:KitchenSink]
}

My challenge is really understanding the get= line and how to parse the data: 1BDDFAE2

It appears that 1BDD is the 'serial number' and FAE28 is data. Am I parsing IBDD correctly in my decoder? Any thought would be appreciated.

Christian Z.

unread,
Mar 17, 2022, 4:20:09 PM3/17/22
to rtl_433
Yes, looks good.
A leakage detector would be like a motion detector and only signal "alarm". If FAE2 is the only data you see then just add
  match=FAE2
to remove false alarms. Ignore the trailing "8" that's just one bit and likely sync.

Kevin Saye

unread,
Mar 17, 2022, 5:46:58 PM3/17/22
to rtl_433
Thanks for the confirmation.

For others using that device, here is my final "LeakDetector.conf":

#
# Operates on 433.920MHz.
# All models emit identical id's.

decoder {
    name=LeakDetector,
    modulation=OOK_PWM,
    short=316,
    long=968,
    reset=916,
    gap=0,
    tolerance=261,
    bits=33,
    get=Location:@0:{16}:[42460:HotWaterHeater 5853:KevinSink 7133:KitchenSink],
    get=Message:@16:{8}:[250:Alarm],
    get=Battery:@24:{4}:[14:Ok 12:Low]
}

And here is how I run RTL_433:

rtl_433 -F json -F http -c /usr/local/etc/rtl_433/LeakDetector.conf

Which outputs the following message:

 {"model": "LeakDetector", "count": 1, "num_rows": 1, "rows": [{"len": 33, "data": "1bddfae28", "Location": "KitchenSink", "Message": "Alarm", "Battery": "Ok"}], "codes": ["{33}1bddfae28"]}

Christian Z.

unread,
Mar 18, 2022, 3:37:01 AM3/18/22
to rtl_433
Thanks! We'll add this as an example.

If you also add

    unique,

then you get e.g.

    {"model" : "LeakDetector", "count" : 1, "num_rows" : 1, "len" : 33, "data" : "16ddfae28", "Location" : "KevinSink", "Message" : "Alarm", "Battery" : "Ok"}

which might be easier to parse.

Kevin Saye

unread,
Mar 18, 2022, 3:02:43 PM3/18/22
to rtl_433
thanks!
Reply all
Reply to author
Forward
0 new messages