How to connect RFLink over WiFi with ESPHome

Tl;dr: I tried to integrate my RF devices via RFLink and ESP Easy, but ESP Easy was utterly unreliable, at least for me. I managed to solve all my reliability issues with ESPHome, but I did not find any tutorial, how to do that, so it wasn’t easy, but I succeeded. So if you need some advice in the future what to do, you are welcome.

The long story: I own some RF devices at home, and I came to the idea that it would be nice to integrate them to Home Assistant. I found the Nodo Shop and ordered an RFLink Pro gateway. They recommended ESP Easy as the firmware of the ESP part of the device, but it was a real pain to configure and manage to connect it to HA. If it connected, it was absolutely not reliable, the connection dropped frequently for long time. I tried multiple firmware versions of ESP Easy, the latest was the worst unfortunately, even it broke the RFLink commands apart, so Home Assistant could not recognize them.

At this point maybe it is needed to tell that I’m not a programmer, not an expert at writing codes, diagnosing errors or stuff like that.

After this particularly long and painful process, I wanted to give a last try to ESPHome, maybe I find a tutorial or anything that helps. I did not, but but the ESPHome documentation is pretty detailed, so I tried to figure out. After many unsuccessful attempts, I found a ser2net external component for ESPHome, which was exactly what I needed to forward the RFLink commands to Home Assistant via the ESP controller. With that, after another many unsuccesful tries, I managed to make the connection work, so I thought it is worth to share with the community. Maybe it helps someone in the future.

The ESP configuration I used:

esphome:
  name: rflink
  friendly_name: rflink

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: esp-idf

# Enable Home Assistant API
api:
  encryption:
    key: ***

ota:
  - platform: esphome
    password: ***

wifi:
  ssid: !secret_wifi_ssid
  password: !secret_wifi_password
  manual_ip:
    static_ip: your.desired.ip #it is needet to give a fix IP address to be able to configure the RFLink integration
    gateway: your.gateway's.ip
    subnet: your.subnet.ip
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Rflink Fallback Hotspot"
    password: ***

external_components:
  - source: github://oxan/esphome-stream-server

logger:
  baud_rate: 57600

# requires uart to be set up:
uart:
  id: uart_bus
  tx_pin: GPIO21
  rx_pin: GPIO20
  baud_rate: 57600 

stream_server:
  uart_id: uart_bus
  port: 1234 #this is the port that the RFLink integration uses

binary_sensor:
  - platform: stream_server
    connected:
      name: ser2net connected

captive_portal:

light:
  - platform: status_led
    name: "LED state"
    pin: GPIO08

Feel free to comment and improve (I’m sure there is room for that), thank you for your attention.

1 Like