Duplication with rtl_433

I have and esp32 based gateway working with CC1101 receiver and the RTL_433 library. Works great but for one thing. It is not deduplicating messages. I am using it with a number of Acurite sensors and they each send 3 messages for each reading. Any ideas as to why deduplication is not working here?

Hi billy27607,

in what time frame are these 3 duplicates sent?

Could it be a similar issue as here?

But you might want a higher value for time_avoid_duplicate.

P.S.: Actually looking at it, this might not apply to ZgatewayRTL_433

Thank you for responding. This is an issue with RF to MQTT similarly. But if I am understanding the issue correctly, I that case dedup was working and filtering desired messages.

In my case, it does not appear to be working. The messages from each bridge all arrive within a second. The mqtt broker is receiving all three messages and I expected the duplicates to be removed. I have time_avoid_duplicate set to 3000 which should be enough. But I will try it with a higher value and see what happens.

Ok, if I understand you right, you have 3 OMG gateways (bridges?!) and they all obviously receive the broadcasts from your Acurite sensors, so your MQTT broker has duplicates from each of the gateways/bridges?

Or did I get that wrong?

Thank you for your response. I have a single gateway and I am trying to eliminate the duplicate messages from the sensors so that I do not flood the database with three entries from each sensor.

One gateway, three messages from the actual sensor. Dedup time set at 3000 ms.

Thanks again.

Also, sorry for the confusing post about bridges.

As stated in the P.S. of my previous post, looking at

#if defined(ZgatewayRF) || defined(ZgatewayIR) || defined(ZgatewaySRFB) || defined(ZgatewayWeatherStation)
// variable to avoid duplicates
#  ifndef time_avoid_duplicate
#    define time_avoid_duplicate 3000 // if you want to avoid duplicate mqtt message received set this to > 0, the value is the time in milliseconds during which we don't publish duplicates
#  endif
#endif

does not include ZgatewayRTL_433, so the time_avoid_duplicate setting is not applicable.

But other than creating some extra - flooding - your database all is working fine for you? What database are you using, is it with HA, openHAB or some other receiver of the MQTT messages … ? I’m asking because it might be best to implement some dedupe routine on the back end there, as many other sensors create regular duplicate messages (i.e. BLE sensors sending their status, even if it hasn’t changes constantly every minute through OMG) where deduping with time_avoid_duplicate is all but impossbile and also needs to be done on the receiving side, if it is required to only log unique status updates to a database. Just saying as I also had to just do the same with BLE messages from my weight scale :wink:

Other than that you could log an issue on github to suggest the inclusion of ZgatewayRTL_433 to be included in the isAduplicateSignal time_avoid_duplicate routine.

The messages are being picked up by and HAA and they are also being pushed into InfluxDB by Telegraf. I am using Grafana to blend these data with other data in a report.

And you are correct, even if I define time_avoid_duplicate in the build flags, the code to use it to dedup is not in ZgatewayRTL_433.ino is not there. I will put in the issue and maybe try to do it myself in the short run.

Thanks for all of your help.

AcuRite does send three messages.
These have a sequence number in them.
Meaning you should be able to use/filter on only one.

2023-03-09 07:55:41.942 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'rtl_1_DataReceived' changed from {"time" : "2023-03-09 07:55:41", "model" : "Acurite-5n1", "message_type" : 56, "id" : 1699, "channel" : "A", "sequence_num" : 0, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "temperature_C" : 24.111, "humidity" : 94, "mic" : "CHECKSUM"} to {"time" : "2023-03-09 07:55:41", "model" : "Acurite-5n1", "message_type" : 56, "id" : 1699, "channel" : "A", "sequence_num" : 1, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "temperature_C" : 24.111, "humidity" : 94, "mic" : "CHECKSUM"}
2023-03-09 07:55:41.944 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'rtl_1_DataReceived' changed from {"time" : "2023-03-09 07:55:41", "model" : "Acurite-5n1", "message_type" : 56, "id" : 1699, "channel" : "A", "sequence_num" : 1, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "temperature_C" : 24.111, "humidity" : 94, "mic" : "CHECKSUM"} to {"time" : "2023-03-09 07:55:41", "model" : "Acurite-5n1", "message_type" : 56, "id" : 1699, "channel" : "A", "sequence_num" : 2, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "temperature_C" : 24.111, "humidity" : 94, "mic" : "CHECKSUM"}
2023-03-09 07:55:45.195 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'rtl_1_DataReceived' changed from {"time" : "2023-03-09 07:55:41", "model" : "Acurite-5n1", "message_type" : 56, "id" : 1699, "channel" : "A", "sequence_num" : 2, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "temperature_C" : 24.111, "humidity" : 94, "mic" : "CHECKSUM"} to {"time" : "2023-03-09 07:55:43", "model" : "TFA-TwinPlus", "id" : 58, "channel" : 0, "battery_ok" : 0, "temperature_C" : -38.300, "humidity" : 8, "mic" : "CHECKSUM"}

@DigiH Dedup support was added to rtl_433 back with version 0.1.0

But with that said, maybe there is something with the dedup logic that isn’t working.

@NorthernMan54 - but || defined(ZgatewayRTL_433 was only added in October 2022, with version v1.0.0, well after I wrote that ZgatewayRTL_433 was not included in the Dedupe :wink: