How do I use the "match" parameter in a flex decoder?

175 views
Skip to first unread message

David Powell

unread,
Nov 5, 2023, 8:26:01 PM11/5/23
to rtl_433

I have a need to use the match parameter in a flex decoder, but can't figure out how to use it on the id: tag. This is my decoder:

decoder {
    name=DrivewayAlert,
    modulation=OOK_PWM,
    short=670,
    long=1340,
    reset=2000,
    bits=9,
    get=@4:{1}:battery_ok:[0:1 1:0],
    get=@5:{4}:id,
    sync=3800
}

I can make it match the full 9-bit data field with match={9}720, but that value changes with the status of the battery.  The id field begins in bit 5 of the data field, so it doesn't change, but I can't figure out how to tell the match parameter to just look at bits 5-8 of the data field. 

Can someone please explain how that works?

Thanks, David


-- 
Inflation is an economic device by which each man can make more than the next.

Christian Z.

unread,
Nov 6, 2023, 6:44:18 AM11/6/23
to rtl_433
The "match"-option just matches the given bits anywhere in the data. If your ID is "9" then use match=9 or match={4}9
Not a very good filter with only 4 bits and we currently don't support matching at a fixed position, sorry.

David Powell

unread,
Nov 8, 2023, 12:29:23 AM11/8/23
to rtl...@googlegroups.com

Hmmm... in that case, can I use more than one "match" option on the decoder?  I could match the entire 9-bit data field twice, once with the battery bit set to 1 and once with it set to 0.  Then it would trigger either way.

dp


On 11/6/23 5:44 AM, Christian Z. wrote:
The "match"-option just matches the given bits anywhere in the data. If your ID is "9" then use match=9 or match={4}9
Not a very good filter with only 4 bits and we currently don't support matching at a fixed position, sorry.

--
You received this message because you are subscribed to the Google Groups "rtl_433" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtl_433+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rtl_433/df0e25d0-a684-47b5-99ba-f5bdd0537670n%40googlegroups.com.
-- 
If you think nobody cares about you, try missing a couple of payments.

Christian Z.

unread,
Nov 8, 2023, 5:26:03 AM11/8/23
to rtl_433
You can't use two matches, but you can use two decoders, they are pretty light-weight. It's not good practice to reuse the decoder name, but it is possible.
Reply all
Reply to author
Forward
0 new messages