Rfbridge_demux Received unknown RF command

I’m using the Sonoff RFbridge with Tasmota and the rfbridge demux Python script. I have several Sonoff RM433 remotes with 8 buttons each that I’ve been using for serval months now and I haven’t edited the script for months either. I believe the problem started after I updated to Home Assistant Core 0.118.4. On my remote called Remote 2, all of the buttons fail to work except for Remote 2 Button 2. That button works just fine. The light on the remote comes on when every button is pressed. I see entries for each button press in the console in Tasmota on the RFbridge. And button 2 actually works.

When I checked Configuration > Logs, I see this:

Logger: homeassistant.components.python_script.rfbridge_demux.py
Source: rfbridge_demux.py:53
Integration: Python Scripts (documentation, issues)
First occurred: December 1, 2020, 7:29:32 PM (148 occurrences)
Last logged: 5:34:31 AM

<rfbridge_demux> Received unknown RF command: 718992
<rfbridge_demux> Received unknown RF command: 718994
<rfbridge_demux> Received unknown RF command: 718999
<rfbridge_demux> Received unknown RF command: 718995
<rfbridge_demux> Received unknown RF command: 718993

If I compare those unknown codes to the script, /config/python_scripts/rfbridge_demux.py, the codes are all defined there. And all of these codes work, except for 7 or the 8 buttons on remote 2.

d = { 'F3C748':['remote1_button1','ON','false'],
      'F3C74C':['remote1_button2','ON','false'],
      'F3C744':['remote1_button3','ON','false'],
      'F3C749':['remote1_button4','ON','false'],
      'F3C742':['remote1_button5','ON','false'],
      'F3C745':['remote1_button6','ON','false'],
      'F3C741':['remote1_button7','ON','false'],
      'F3C743':['remote1_button8','ON','false'],
      '718998':['remote2_button1','ON','false'],
      '71899C':['remote2_button2','ON','false'],
      '718994':['remote2_button3','ON','false'],
      '718999':['remote2_button4','ON','false'],
      '718992':['remote2_button5','ON','false'],
      '718995':['remote2_button6','ON','false'],
      '718991':['remote2_button7','ON','false'],
      '718993':['remote2_button8','ON','false'],
      '398EE8':['remote3_button1','ON','false'],
      '398EEC':['remote3_button2','ON','false'],
      '398EE4':['remote3_button3','ON','false'],
      '398EE9':['remote3_button4','ON','false'],
      '398EE2':['remote3_button5','ON','false'],
      '398EE5':['remote3_button6','ON','false'],
      '398EE1':['remote3_button7','ON','false'],
      '398EE3':['remote3_button8','ON','false'],
      'A650D8':['remote4_button1','ON','false'],
      'A650DC':['remote4_button2','ON','false'],
      'A650D4':['remote4_button3','ON','false'],
      'A650D9':['remote4_button4','ON','false'],
      'A650D2':['remote4_button5','ON','false'],
      'A650D5':['remote4_button6','ON','false'],
      'A650D1':['remote4_button7','ON','false'],
      'A650D3':['remote4_button8','ON','false'],
      '0BB2D8':['remote5_button1','ON','false'],
      '0BB2DC':['remote5_button2','ON','false'],
      '0BB2D4':['remote5_button3','ON','false'],
      '0BB2D9':['remote5_button4','ON','false'],
      '0BB2D2':['remote5_button5','ON','false'],
      '0BB2D5':['remote5_button6','ON','false'],
      '0BB2D1':['remote5_button7','ON','false'],
      '0BB2D3':['remote5_button8','ON','false'],
      'D6BC06':['living_room_motion','ON','false'],
      '105A16':['dining_room_motion','ON','false'],
      '1F2006':['hallway_motion','ON','false']
    }

p = data.get('payload')

if p is not None:
  if p in d.keys():
    service_data = {'topic':'home/{}'.format(d[p][0]), 'payload':'{}'.format(d[p][1]), 'qos':0, 'retain':'{}'.format(d[p][2])}
  else:
    service_data = {'topic':'home/unknown', 'payload':'{}'.format(p), 'qos':0, 'retain':'false'}
    logger.warning('<rfbridge_demux> Received unknown RF command: {}'.format(p))
  hass.services.call('mqtt', 'publish', service_data, False)

One thing that I noticed that could just be a red herring. Is that the 7 codes that do not work are the only codes in the list that are exclusively numbers with no letters. Remote 2 button 2 has a letter in it and that one works. I don’t know Python, I’m afraid, but it made me wonder if there was a string to integer conversion happening somewhere by accident. I assume the codes being in quotes would make them strings though.

Any ideas on where else I could be looking for the problem?

Discussed here:
Strategies
Look at the latest posts.
BTW what is Your HA version?
Best, JR

1 Like

Modify your python demux script.

Change

p = data.get('payload')

To

p = str(data.get('payload'))
1 Like

Do what francisp said or remove the single-quotes from the seven numeric keys in the dictionary.

      'F3C743':['remote1_button8','ON','false'],
      718998:['remote2_button1','ON','false'],
      '71899C':['remote2_button2','ON','false'],
      718994:['remote2_button3','ON','false'],
      718999:['remote2_button4','ON','false'],
      718992:['remote2_button5','ON','false'],
      718995:['remote2_button6','ON','false'],
      718991:['remote2_button7','ON','false'],
      718993:['remote2_button8','ON','false'],
      '398EE8':['remote3_button1','ON','false'],
      '398EEC':['remote3_button2','ON','false'],
1 Like

Thanks that fixed it.