Sonoff Bridge, same switch returns different data codes (Tasmota)

Hi,

Been looking to upgrade my switches in HA and decided to give the Sonoff Bridge a try.

I fully installed Sonoff-Tasmota 6.5.0 on the brigde, setup the MQTT broker and all seems to be working ok. Only problem is my switches don’t seem to send unique codes. I was wondering if this is expected behavior and if there is a way to fix it?

The swich I have is a KTNNKG 3 Channel 433MHz. It has 3 buttons returning the following MQTT messages.

Button 1: 
tele/sonoff/RESULT = {"RfReceived":{"Sync":11800,"Low":400,"High":1160,"Data":"2A9198","RfKey":"None"}}
tele/sonoff/RESULT = {"RfReceived":{"Sync":11790,"Low":410,"High":1150,"Data":"2A9190","RfKey":"None"}}

Button 2: 
tele/sonoff/RESULT = {"RfReceived":{"Sync":11810,"Low":390,"High":1170,"Data":"2A9190","RfKey":"None"}}
tele/sonoff/RESULT = {"RfReceived":{"Sync":11780,"Low":410,"High":1150,"Data":"2A9194","RfKey":"None"}}

Button 3:
tele/sonoff/RESULT = {"RfReceived":{"Sync":11790,"Low":410,"High":1150,"Data":"2A9192","RfKey":"None"}}
tele/sonoff/RESULT = {"RfReceived":{"Sync":11790,"Low":410,"High":1150,"Data":"2A9190","RfKey":"None"}}

As you can see code 2A9198, 2A9194, 2A9192 are unique for each button, but for some presses the code 2A9190 is used. Is there a way to fix this? Without a unique key these switches seems to be pretty useless.

Why not just use the codes that are unique and ignore the other?
Do they always come in the same order? May it be possible to use the sequence as an identifier?
I have set up my switches (other brands) with nodered as an add-on to home assistant and can easily use just one of the codes. Maybe i am missing something.

The problem is that the non-unique codes are used on a single press. Which mean in those cases you couldn’t trigger an automation. Sometimes even multiple presses keep generating the non-unique codes.

I’ve ordered an other brand switch to see if I have the same problem with those.

I confirm that I reproduced this issue with the SonoffRF Bridge with a remote for wall plugs.

I don’t know if ESPurna behave the same but it may be related to Sonoff RF Bridge internal RF decoder.

What you could do:

  • test if you have the same behaviour with ESPurna
  • if you have the same behaviour, use the direct hack of Sonoff RF Bridge and use RCswitch library (ESPurna or OpenMQTTGateway)
    I’m sure that with RCswitch library you will get the proper codes (I tested them below)

@1technophile very interesting. I also have a version of the KTNNKG 433mhz switches.

I will try the ESPurna firmware and if that doesn’t work go for the hack like you suggested.

Thanks for the input.

@Timbo925 hi, could you please share some information with us? Did you try using other firmwares for the bridge? if so, did it help?

@gorenuru I wasn’t able to test the new firmware solution because I broke my bridge by accident. (cat knocked if off the table and ran over it with my desk chair…).

The solution seemed promising tho because it described my problem exactly.