Why the Sonoff RF (not RF Bridge) is not able to transmit RAW 433MHz data

Hi there,

▸ tl;dr
It’s not possible to extract 433MHz RAW data from Sonoff RF without any major modifications to the hardware. I figured this could be helpful for anybody wondering and trying to achieve the same. So you’d have to waste less time now.


Sonoff RF, PCB version unknown

▸ Idea
Since quiet some time I had a specific idea for the three Sonoff RF (not RF Bridge) I own.
I wanted to use them as an universial receiver for 433MHz remote control signals and place them in different corners around the flat. Primarily I intended to use them with those long-lasting, cheap-ass 3, 4 or 8 button remotes as input devices.

Abstract approach:
433MHz generic remote button press → Sonoff RF → ESPHome remote_receiver → ESPHome internal OR Home Assistant internal logic → trigger action in Home Assistant

▸ Analysis
It was rather hard to find any information as how to proceed at all, which is rather unusual as the hacking-all-ESP-enabled-devices-community normally is quiet active. Posts about hacking the Sonoff RF Bridge are found lot more frequently. So I did some digging.

Facts

  1. The Sonoff RF is a Sonoff basic with an additional 433MHz module soldered to it. It was sold this way by Itead.
  2. Tasmota is able to freely program *one* remote control to (de-)activate the relay.
  3. ESPHome doesn’t list any specific pins for the 433MHz module. esphome-devices.com doesn’t list the device at all.

Being at the point I’m now, I consider [2] & [3] already as strong indicators it wouldn’t work (at all (“out of the box”)).
I did some further googling and had a look at the datasheet of the chip SYN470R used on the 433MHz module PCB soldered to the Sonoff RF main board.

  1. The 433MHz chip datasheet states in the very first two sentences:

The SYN470R is a single chip ASK/OOK (ON-OFF Keyed) RF receiver IC. This device is a true “antenna-in to data-out” monolithic device.

(Where ASK refers to the utilized modulation and stands for “Amplitude-shift keying”.)

For me, this directly translates into “the ESP onboard the Sonoff RF never sees any RAW data as the chip directly translates it to an ON-OFF-signal and passes it on to the ESP”. Sad.

  1. Furthermore this is backed by a forum post I found on electronics.stackexchange.com:

[…] the 433MHz card behaves in the same way [after flashing Tasmota] as it did with the original OEM Itead firmware.

This fits together with the statement in [2], remarking that

Pairing the iTead RF remote controller is the same as with the original iTead software.

So the progamming of the remote transmitter to react to happens independently of the ESP firmware. Sad.

  1. Finally, as Itead has some quiet transparent documentation available on their homepage, I was able to review the schematic of the Sonoff RF which reveils that between the 433MHz board and the ESP just one connection exists, called “E-FW”. Sad.

▸ Synopsis
It’s not possible to extract 433MHz RAW data from Sonoff RF without any major modifications to the hardware. As the post in [5] implies, there might be some chance in modifying the 433MHz board, but this is definitely out of my league.
Sad, that I’m not able to achieve what I’ve though of for quiet some long time already - due to hardware limitations. Still, happy that I finally figured it out with some proper evidence and can move on with some other little home automation projects.

Really hope this was an interesting read and helps somebody.
Cheers!

1 Like

▸ ESPHome integration
As the Sonoff RF is “just” a Sonoff basic with an additional 433 MHz board connected to GPIO 0 aka the push button, I used the yaml below to configure it in ESPHome.

substitutions:
  platformname: esp8266
  boardname: esp8285
  devicename: sonoff-433-01
  friendlyname: Sonoff 433 01
  
esphome:
  name: ${devicename}
${platformname}:
  board: ${boardname}

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_pwd
  fast_connect: true
  ap:
    ssid: ${friendlyname}
    password: !secret wifi_pwd
    ap_timeout: 1min

captive_portal:

logger:

web_server:
  port: 80

api:
  password: !secret api_pwd

ota:
  password: !secret ota_pwd

time:
  - platform: homeassistant
    id: homeassistant_time

text_sensor:
  - platform: version
    name: ${friendlyname} version
  - platform: wifi_info
    ip_address:
      name: ${friendlyname} ip
    ssid:
      name: ${friendlyname} ssid
    bssid:
      name: ${friendlyname} bssid

###########################################################################################################
###
### Kown issues
### It seems there are know issues in ESPHome with the connectivity of Sonoff basic (and thus Sonoff RF)  
### boards, particulary with UniFi systems. Thus the status_led component was DISabled.
### https://github.com/esphome/issues/issues/2964
### 
### Programming of RF remotes:
### - two short button presses will blink a red led shortly and start RF signal recognition. Three longer blinks signal RF reception.
### - three short button presses will keep the red led on for some seconds and erase the known RF code.
### via https://templates.blakadder.com/sonoff_RF.html
###
###########################################################################################################

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      mode:
        input: true
        pullup: true
      inverted: true
    name: ${friendlyname} button
    internal: true
    on_press:
      - switch.toggle: relay
      - switch.toggle: led
  - platform: status
    name: ${friendlyname} status

switch:
  - platform: gpio
    pin: GPIO12
    name: ${friendlyname}
    id: relay
  # Switch to restart the plug
  - platform: restart
    name: ${friendlyname} restart
    
  - platform: gpio
    id: led
    pin:
      number: GPIO13
      inverted: True

# https://github.com/esphome/issues/issues/2964#issuecomment-1053544817
# status_led:
    # pin:
      # number: GPIO13
      # inverted: true
2 Likes

I recommend this project instead https://docs.openmqttgateway.com/

It has steps to flash to a sonoff rf although I’ve not tried that myself, I use esp32 boards

Title actually says “not RF Bridge:man_facepalming:

Beside @mcg in details describes why the esp (no matter what firmware is flashed on it) will never be able to see any rf codes:

Btw. this Qiachip device looks quite similar but actually the rf module itself toggles the relay here and the communication between the esp and the rf module works via uart :point_down:

https://docs.openmqttgateway.com/prerequisites/boards/sonoff-basic.html

@TheHolyRoger the sonoff basic (beside it doesn’t feature RF) also isn’t topic of this thread :man_facepalming:

1 Like

If you spent 0.1% effort rather than trying to make me look bad in each of your posts (not sure why…)

You’d see that the openmqtt docs simply use the wrong name, in fact sonoff’s own website sticks the “sonoff RF” with the “sonoff basic” line of devices, since the only difference is that it adds an RF receiver.

Openmqttgateway doesn’t support the non RF version of the sonoff basic since it doesn’t have a RF receiver and would therefore be a paperweight.

As stated in the above pages it supports the “sonoff rf”, RFR2 and RFR3

1 Like

Hey @TheHolyRoger,
thanks for the tip!
Looks interesting, especially because they mention the Sonoff RFR3 and the little hardware hack connecting the data out pin D0 of the 433MHz chip directly to the esp. I’m curios
a. if this also would work with my older Sonoff RF (high level I don’t see any thing speaking against it, as it’s the same chip) and
b. if the esp remote_receiver platform is able to decode (if that’s the right term here) what it receives from that chip.

I think I’ll give it a try when I find some time the next weekends…

1 Like

A bit off topic but I’ve been really happy with my DIY RF transceivers.

You could scatter a few around, and I always manage to find other useful sensors to attach to them too (temp, humidity, motion etc etc).

Might be a decent option if your current investigations don’t pan out…

That’s what I’m doing as well in some 3d printed cases :slight_smile: although looks like you’re using esphome instead of openmqttgateway but if it works it works!

What I like about openmqttgateway is you can add other stuff to your board very easily like IR and bluetooth without esphome templates

2 Likes