Installing ESPHome on Sonoff Bridge R2

Hey All…I’m new to ESPHome, and I’m struggling with my first programming task. I’m trying to get my Sonoff Bridge R2 set up with ESPHome, in order to control my awning via 433MHz. I have Home Assistant & ESPHome running in Docker on a ‘server’. S

I’ve had a couple of interations of my rf-bridge-1.yaml config file, but here’s the latest:

esphome:
  name: rf-bridge-1
  friendly_name: rf-bridge-1

esp8266:
  board: esp01_1m

# Enable logging
logger:
  baud_rate: 0

# Enable Home Assistant API
api:
  encryption:
    key: !secret esphome_api_key

ota:
- platform: esphome
  password: !secret ota_password

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Rf-Bridge Fallback Hotspot"
    password: !secret rf_bridge_fallback_hotspot

I’m programming using my Macbook Air. I have a FT232 USB UART Board (Type C) module connected to my Sonoff Briidge R2 via the following pinout:
UART VCCIO (set to 3.3v) → RF Bridge 3V3
UART GND → RF Bridge GND
UART RX → RF Bridge TX
UART TX → RF Bridge RX

I’ve tried using ESPFlasher, but lately I’ve been using ESPHome installer via Home Assistant. Here’s my latest process:

After validating my config, I run ‘install’ and choose ‘Plug Into this computer’. I then download the BIN file and click ‘Open ESPHome Web’. I then click Connect, and while holding the power button on the RFBridge and connect the UART to my laptop. From there I’ve tried both the ‘Prepare for first use’ and ‘Install’ (providing the bin file) options, both to no avail.

Any insights?

I used this guide to flash mine: https://www.irrgang.dev/how-to-flash-the-sonoff-rf-bridger2-with-esphome/

Thanks @desean - I referenced the same guide when I first started, but was still having issue. I just can’t see what I was doing wrong.

Looking at your YAML above, it doesn’t seem like you have followed the guide though, as it looks incomplete.

Here is my full YAML, which you might want to compare.

#Sonoff RF BridgeR2 https://www.irrgang.dev/how-to-flash-the-sonoff-rf-bridger2-with-esphome/
substitutions:
  name: sonoff-rf-bridge
  friendly_name: Sonoff RF Bridge

esphome:
  name: ${name}
  friendly_name: ${friendly_name}
  comment: Sonoff RF BridgeR2 with ESPHome

esp8266:
  board: esp01_1m

# Enable logging
logger:
  baud_rate: 0

# Enable Home Assistant API
api:
  encryption:
    key: !secret sonoff_rf_bridge_encryption_key
  services:
    - service: send_rf_code
      variables:
        sync: int
        low: int
        high: int
        code: int
      then:
        - rf_bridge.send_code:
            sync: !lambda 'return sync;'
            low: !lambda 'return low;'
            high: !lambda 'return high;'
            code: !lambda 'return code;'
    - service: learn
      then:
        - rf_bridge.learn
rf_bridge:
  on_code_received:
    then:
      - homeassistant.event:
          event: esphome.rf_code_received
          data:
            sync: !lambda 'return format_hex(data.sync);'
            low: !lambda 'return format_hex(data.low);'
            high: !lambda 'return format_hex(data.high);'
            code: !lambda 'return format_hex(data.code);'

ota:
  - platform: esphome
    password: !secret sonoff_rf_bridge_ota_pwd

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${friendly_name} ESP"
    password: !secret sonoff_rf_bridge_ap_pwd

button:
  # Restart the ESP
  - platform: restart
    name: "Restart"

uart:
  tx_pin: 1
  rx_pin: 3
  baud_rate: 19200

captive_portal:

# Sensors for ESP version and WIFI information
text_sensor:
  # ESPHome version
  - platform: version
    hide_timestamp: true
    name: "ESPHome Version"
  # IP address and connected SSID
  - platform: wifi_info
    ip_address:
      name: "IP Address"
      icon: mdi:wifi
    ssid:
      name: "Connected SSID"
      icon: mdi:wifi-strength-2

sensor:
  # WiFi signal
  - platform: wifi_signal
    name: "WiFi Signal"
    update_interval: 120s
  - platform: uptime
    name: "${friendly_name} Uptime"

binary_sensor:
  - platform: status
    name: "${friendly_name} Status"

light:
  - platform: status_led
    name: "Switch state"
    pin: GPIO13