RFLink hacked Sonoff RF Bridge

Hello to all,

Recently, I acquired a second Sonoff RF Bridge expecting to run tasmota/ portisch. To my dismay, Sonoff changed the hardware, which breaks that option. I then discovered RFLink32 (https://github.com/schmurtzm/RFLink32-For-Sonoff-RF-Bridge). I have successfully moded the bridge, flashed it, I’m able to correctly receive RF data, I see entities auto recognised in HA, but for the life of me, I cannot figure how to affect an RF transmit.

Ironically, after a few pushes of the physical on/off remote switches, the HA UI starts to correctly show on/off states.

Can someone please assist me? Thank you in advance.

configuration.yaml and Logs follow …
To eliminate the RF switch plugs, I tried an alternative receiving a different protocol, but still unable to be controlled by my HA set-up.

############################
##     RFLink Bridge 2   ###
############################ 

rflink:
  host: 192.168.1.55
  port: 5258
  tcp_keepalive_idle_timer: 600
  
logger:
  default: error
  logs:
    rflink: debug
    homeassistant.components.rflink: debug
    
light:
# add the following to the existing light section
  - platform: rflink
    automatic_add: true
sensor:
# add the following to the existing sensor section
  - platform: rflink
    automatic_add: true

############################
# Switches                 #
############################
switch:
    - platform: rflink
      device_defaults:
         fire_event: true
         signal_repetitions: 2
    devices:
         kaku_000045_02:
         name: roku_p


#################################################################################
LOGS
Using actual Remote Control (Bridge Receiving RF)
2022-02-04 23:32:43 DEBUG (MainThread) [rflink.protocol] received data: 20;2F;Kaku;ID=45;SWITCH=02;CMD=OFF;
2022-02-04 23:32:43 DEBUG (MainThread) [rflink.protocol] got packet: 20;2F;Kaku;ID=45;SWITCH=02;CMD=OFF;
2022-02-04 23:32:43 DEBUG (MainThread) [rflink.protocol] decoded packet: {'node': 'gateway', 'protocol': 'kaku', 'id': '000045', 'switch': '02', 'command': 'off'}
2022-02-04 23:32:43 DEBUG (MainThread) [rflink.protocol] got event: {'id': 'kaku_000045_02', 'command': 'off'}
2022-02-04 23:32:43 DEBUG (MainThread) [homeassistant.components.rflink] event of type command: {'id': 'kaku_000045_02', 'command': 'off'}
2022-02-04 23:32:43 DEBUG (MainThread) [homeassistant.components.rflink] entity_ids: ['switch.roku_p']
2022-02-04 23:32:43 DEBUG (MainThread) [homeassistant.components.rflink] passing event to switch.roku_p
2022-02-04 23:32:43 DEBUG (MainThread) [homeassistant.components.rflink] Fired bus event for switch.roku_p: off

Using Home Assistant UI switch (Bridge attempting to Transmit RF)
2022-02-04 23:36:16 DEBUG (MainThread) [homeassistant.components.rflink] Sending command: off to Rflink device: kaku_000045_02
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] sending command: {'protocol': 'kaku', 'id': '000045', 'switch': '02', 'command': 'off'}
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] writing data: '10;kaku;000045;02;off;\r\n'
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] waiting for acknowledgement
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] received data: e[2K
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] received data: Message arrived [Ser2Net]:
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] received data: 10;kaku;000045;02;off;
2022-02-04 23:36:16 WARNING (MainThread) [rflink.protocol] dropping invalid data: e[2K Message arrived [Ser2Net]:10;kaku;000045;02;off;
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] received data: 20;35;CMD UNKNOWN;
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] got packet: 20;35;CMD UNKNOWN;
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] decoded packet: {'node': 'gateway', 'protocol': 'unknown', 'response': 'command_unknown', 'ok': False}
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] command response: {'node': 'gateway', 'protocol': 'unknown', 'response': 'command_unknown', 'ok': False}
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] packet acknowledged
2022-02-04 23:36:16 DEBUG (MainThread) [homeassistant.components.rflink] Sending command: off to Rflink device: kaku_000045_02
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] sending command: {'protocol': 'kaku', 'id': '000045', 'switch': '02', 'command': 'off'}
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] writing data: '10;kaku;000045;02;off;\r\n'
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] waiting for acknowledgement
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] received data: e[2K Message arrived [Ser2Net]:10;kaku;000045;02;off;
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] received data: 20;36;CMD UNKNOWN;
2022-02-04 23:36:16 WARNING (MainThread) [rflink.protocol] dropping invalid data: e[2K Message arrived [Ser2Net]:10;kaku;000045;02;off;
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] got packet: 20;36;CMD UNKNOWN;
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] decoded packet: {'node': 'gateway', 'protocol': 'unknown', 'response': 'command_unknown', 'ok': False}
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] command response: {'node': 'gateway', 'protocol': 'unknown', 'response': 'command_unknown', 'ok': False}
2022-02-04 23:36:16 DEBUG (MainThread) [rflink.protocol] packet acknowledged

Did you try something like this:

service: rflink.send_command
data:
  command: 'on'
  device_id: kaku_000045_02

Thank you for your suggestion. I set that up as a script, run it independently and still see the same error in the logs (shown below). To eliminate a possible Bridge hardware issue, I earlier flashed ESPHome and see a correct operation, just that RFlink in theory should cover more of my devices and is a good learning stretch for me. All further ideas welcome and appreciated :slight_smile:

2022-02-05 11:12:17 DEBUG (MainThread) [homeassistant.components.rflink] Rflink command for {'command': 'on', 'device_id': 'kaku_000045_02'}

2022-02-05 11:12:17 DEBUG (MainThread) [rflink.protocol] sending command: {'protocol': 'kaku', 'id': '000045', 'switch': '02', 'command': 'on'}

2022-02-05 11:12:17 DEBUG (MainThread) [rflink.protocol] writing data: '10;kaku;000045;02;on;\r\n'

2022-02-05 11:12:17 DEBUG (MainThread) [rflink.protocol] waiting for acknowledgement

2022-02-05 11:12:17 DEBUG (MainThread) [rflink.protocol] received data: e[2K

2022-02-05 11:12:17 DEBUG (MainThread) [rflink.protocol] received data: Message arrived [Ser2Net]:10;kaku;000045;02;on;

20;09;CMD UNKNOWN;

2022-02-05 11:12:17 WARNING (MainThread) [rflink.protocol] dropping invalid data: e[2K Message arrived [Ser2Net]:10;kaku;000045;02;on;

2022-02-05 11:12:17 DEBUG (MainThread) [rflink.protocol] got packet: 20;09;CMD UNKNOWN;

2022-02-05 11:12:17 DEBUG (MainThread) [rflink.protocol] decoded packet: {'node': 'gateway', 'protocol': 'unknown', 'response': 'command_unknown', 'ok': False}

2022-02-05 11:12:17 DEBUG (MainThread) [rflink.protocol] command response: {'node': 'gateway', 'protocol': 'unknown', 'response': 'command_unknown', 'ok': False}

2022-02-05 11:12:17 DEBUG (MainThread) [rflink.protocol] packet acknowledged

2022-02-05 11:12:17 ERROR (MainThread) [homeassistant.components.rflink] Failed Rflink command for {'command': 'on', 'device_id': 'kaku_000045_02'}

Looking at my logs again, I am wondering whether RFLink 32 is just not parsing transmit commands. I wonder if it has been set-up for receive only. I am using the default firmware in the link in my original post. If anyone else has tried it, or willing to try it, please could they let me know.

Only certain plugins have been enabled for transmit as per line 95 onwards:
https://github.com/schmurtzm/RFLink32-For-Sonoff-RF-Bridge/blob/22402bd54b364dbd6a008364a1d652f3f1fa9854/RFLink/Plugins/_Plugin_Config_01.h

Trying sending this for one that is enabled:

10;NewKaku;00c142;1;ON;

Have you been able to solve this issue?
Thanks in advance.

Hi Guys,
i faced into the same issue.
receiving is possible, but transmitting not.
Does anyone has an idea how to solve this?
Or, which firmware will make working the Sonoff brigde with the direct hack

1 Like