Table of Contents

  1. Sonoff Device Overview
  2. Integration Methods
  3. SonoffLAN (Local, No Flash)
  4. Flashing with Tasmota
  5. Flashing with ESPHome
  6. eWeLink Cloud Integration
  7. Which Method Should You Use?

Sonoff makes some of the most affordable smart home hardware available. Their WiFi relays, smart plugs, switches, and sensors are based on ESP8266 or ESP32 chips — which means they're highly hackable and work great with Home Assistant. The question is how to integrate them.

You have four main options, ranging from the simplest (eWeLink cloud) to the most powerful (custom firmware). This guide covers all of them so you can pick the right approach for your needs.

Sonoff Device Overview

Popular Sonoff devices include:

Integration Methods

MethodLocal?Firmware Change?Difficulty
SonoffLAN (HACS)YesNoEasy
TasmotaYesYesMedium
ESPHomeYesYesMedium
eWeLink CloudNoNoEasiest

SonoffLAN (Local, No Flash)

SonoffLAN is a HACS integration that communicates with Sonoff devices locally — without changing their firmware. It works by intercepting the local LAN protocol that Sonoff devices use.

Requirements

Setup

Install SonoffLAN via HACS. Restart HA. Go to Settings → Integrations → Add Integration → SonoffLAN. Enter your eWeLink username and password. Your devices will appear automatically.

Important: SonoffLAN requires your eWeLink credentials to initially fetch device keys, but after that, it communicates locally. Some newer Sonoff devices use a protocol version (3.x) that may require you to keep the eWeLink app connected for initial setup.

Flashing with Tasmota

Tasmota is open-source firmware for ESP-based devices. Installing it on a Sonoff device gives you full local control via MQTT, a web interface, and excellent HA integration through MQTT discovery.

Flashing Methods

After Flashing

Connect to the Tasmota WiFi hotspot, configure your home WiFi, then access the Tasmota web interface. Set up MQTT with your broker's details. Home Assistant will auto-discover the device via MQTT autodiscovery.

Flashing with ESPHome

ESPHome gives you the most flexibility. You write a YAML config that defines every aspect of the device's behaviour, and ESPHome compiles and flashes custom firmware.

For a Sonoff Basic, a minimal ESPHome config might be:

esphome:
  name: kitchen-relay

esp8266:
  board: esp01_1m

wifi:
  ssid: "YourSSID"
  password: "YourPassword"

api:

switch:
  - platform: gpio
    pin: GPIO12
    name: "Kitchen Relay"

Flash this via serial (same method as Tasmota), and the device appears in HA via the native ESPHome integration with full local API communication.

If you want the simplest setup and don't mind cloud dependency, the official eWeLink integration is available. Install it via HACS or the built-in integrations. Enter your eWeLink credentials and your devices appear as entities.

The downsides: cloud dependency means a delay of 1-3 seconds for commands, and if eWeLink's servers are down, your devices won't respond through HA.

Which Method Should You Use?

For Sonoff's Zigbee devices (SNZB series), pair them directly via Zigbee2MQTT or ZHA — no eWeLink account needed, and full local control from day one.

Bottom Line

Sonoff devices punch well above their price point for Home Assistant users. SonoffLAN provides the best balance of simplicity and local control for WiFi devices, while Zigbee2MQTT handles the SNZB sensor range flawlessly. If you're comfortable with firmware flashing, ESPHome turns Sonoff hardware into perfectly customised HA nodes.

SmartWired participates in the Amazon Associates Programme. We may earn a commission from qualifying purchases at no extra cost to you.