Sonoff + Home Assistant: The Complete Integration Guide

Sonoff makes some of the most affordable smart home hardware on the planet. Wi-Fi switches for under $10, Zigbee sensors for $8, and a Zigbee coordinator that costs less than a pizza. The catch? Out of the box, most Sonoff gear relies on the eWeLink cloud. Pair them with Home Assistant and you can cut that cord entirely. This guide covers every way to connect Sonoff devices, the best products to buy, and automations that make the most of them.

Check Your Devices Zigbee Guide

Why Sonoff Is the Budget King of Smart Home

ITEAD, the company behind Sonoff, has been making smart home devices since 2016. They started with a single Wi-Fi relay that could be flashed with custom firmware, and the maker community went wild. Today Sonoff sells everything from $5 Wi-Fi switches to Zigbee sensor kits, NSPanel touchscreens, and the ZBDongle coordinators that power thousands of Home Assistant setups.

What makes Sonoff special is the combination of rock-bottom prices and open hardware. Many devices use ESP8266 or ESP32 chips, meaning you can flash Tasmota or ESPHome and get full local control. Their Zigbee line (the SNZB series) works out of the box with any standard Zigbee coordinator. And their newer products like the NSPanel Pro run Android, opening up even more possibilities.

๐Ÿ’ฐ

Unbeatable Prices

Wi-Fi switches from $5, Zigbee sensors from $8, coordinators from $15. Nobody else comes close at these price points.

๐Ÿ”ง

Flashable Firmware

Most Wi-Fi devices use ESP chips. Flash Tasmota or ESPHome for complete local control. No cloud, no subscription, no limits.

๐Ÿ“ก

Zigbee + Wi-Fi + Matter

Choose your protocol. Zigbee sensors for battery life, Wi-Fi switches for simplicity, and Matter support rolling out on newer devices.

Four Ways to Connect Sonoff to Home Assistant

Sonoff gives you more integration paths than almost any other brand. The right choice depends on which devices you have and how much tinkering you want to do.

RECOMMENDED

Zigbee (SNZB Series + ZBDongle)

The cleanest path. Sonoff's SNZB Zigbee sensors and the ZBMINI switches pair directly with a Zigbee coordinator (like Sonoff's own ZBDongle-E) through ZHA or Zigbee2MQTT. No cloud account needed. No firmware flashing. Just pair and go.

Best for: New setups, anyone buying Sonoff sensors and switches today.

Devices: SNZB-01P (button), SNZB-02D (temp/humidity), SNZB-03P (motion), SNZB-04P (door/window), SNZB-06P (presence), ZBMINI-L2 (switch), ZBMINIL2 (no neutral).

Tasmota / ESPHome (Wi-Fi Devices)

The classic Sonoff hack. Flash Tasmota or ESPHome onto Wi-Fi devices like the Basic, Mini, POW, TH, or S26 plug. You get full local control over MQTT or native ESPHome API. Many newer Sonoff devices support OTA flashing through the DIY mode, so you do not even need to open the case or solder headers.

Best for: Existing Wi-Fi Sonoff devices, power users who want maximum control.

Devices: BASICR4, MINIR4, POW Elite, TH Elite, S26R2, SwitchMan M5, TX Ultimate.

SonoffLAN (HACS Integration)

Do not want to flash anything? The SonoffLAN custom integration (install it through HACS) discovers Sonoff devices on your network and controls them locally. It works with most eWeLink devices. The downside: you still need an eWeLink cloud account for initial device setup, and some features require cloud connectivity.

Best for: People who want plug-and-play with existing eWeLink devices, no flashing.

eWeLink Official Integration

Home Assistant has an official eWeLink integration that connects through the cloud. It is the simplest setup (just log in with your eWeLink account), but it depends on ITEAD's servers. If their cloud goes down, your devices stop responding. Fine as a starting point, but most people move to one of the local options over time.

Best for: Quick testing, users who do not mind cloud dependency.

Connection Methods Compared

MethodLocal ControlCloud FreeFlashingDifficulty
Zigbee (ZHA/Z2M)โœ… Fullโœ… YesNot neededEasy
Tasmota / ESPHomeโœ… Fullโœ… YesRequiredMedium
SonoffLAN (HACS)โœ… Mostlyโš ๏ธ PartialNot neededEasy
eWeLink OfficialโŒ CloudโŒ NoNot neededEasy

12 Best Sonoff Devices for Home Assistant

Sonoff's catalog is huge. These are the devices the Home Assistant community actually recommends and uses daily.

Coordinators and Dongles

ZBDongle-E (EFR32MG21)

The go-to Zigbee coordinator for Home Assistant. Supports Zigbee 3.0, Thread, and has excellent range with the external antenna. Works with ZHA and Zigbee2MQTT. About $20.

TOP PICK

ZBDongle-P (CC2652P)

The older but battle-tested coordinator. Zigbee 3.0 support, great community firmware options, and a huge user base. Still a solid choice if you find it on sale. About $15.

Zigbee Sensors

SNZB-02D (Temp + Humidity)

Built-in LCD display, CR2450 battery lasting 2+ years, accurate readings. One of the best budget temp sensors available. About $12.

SNZB-06P (Presence Sensor)

Zigbee mmWave radar that detects presence even when you are sitting still. Works with ZHA and Z2M. A fraction of the cost of the Aqara FP2 (though less precise zone detection). About $18.

SNZB-03P (Motion Sensor)

Classic PIR motion sensor. Fast detection, adjustable sensitivity in Z2M, 3-year battery life. Perfect for lighting automations and security alerts. About $10.

SNZB-04P (Door/Window Sensor)

Tiny magnetic contact sensor for doors, windows, and cabinets. CR2032 battery, reports open/close state instantly. About $8. Buy a 5-pack and put them everywhere.

Switches and Relays

ZBMINI-L2 (No Neutral Switch)

Zigbee in-wall relay that fits behind your existing light switch. No neutral wire required, which is a lifesaver in older homes. Just wire it in, pair it, and your dumb switch becomes smart. About $12.

TOP PICK

MINIR4 (Wi-Fi Mini Relay)

Tiny Wi-Fi relay with ESP32 chip. Supports DIY mode for OTA Tasmota/ESPHome flashing. Fits in most switch boxes. Matter support via firmware update. About $8.

BASICR4 (Wi-Fi Relay)

The classic Sonoff relay, now in its 4th generation. ESP32 based, supports Tasmota/ESPHome, Matter-capable. Great for controlling things like water heaters, pumps, or garage lights. About $6.

Plugs and Power Monitoring

S26R2 (Smart Plug)

Compact Wi-Fi smart plug. Flash with Tasmota for local control, or use SonoffLAN. Available in EU, US, UK, and AU socket types. About $9.

POW Elite (Power Monitor)

Wi-Fi power monitoring relay that tracks voltage, current, wattage, and cumulative energy. LCD screen on the device itself. Supports up to 20A. Great paired with Home Assistant's energy dashboard. About $18.

TH Elite (Temp Relay)

Wi-Fi relay with a temperature and humidity probe. Use it to control heaters, fans, or humidifiers based on actual readings. Built-in LCD. Supports Tasmota. About $15.

Getting Started: Three Paths

Pick the path that matches your situation.

Path 1: Zigbee Sensors (Easiest)

  1. Get a coordinator. Plug a Sonoff ZBDongle-E into your Home Assistant server's USB port.
  2. Set up ZHA or Zigbee2MQTT. Go to Settings, Devices and Services, Add Integration. Pick ZHA for simplicity or install Zigbee2MQTT via HACS for more control.
  3. Pair your sensors. Put the SNZB sensor in pairing mode (hold the button for 5 seconds until the LED blinks). Home Assistant discovers it automatically.
  4. Name and place. Give each device a clear name and assign it to a room. Build automations using the new entities.

Time needed: About 30 minutes for your first sensor. 5 minutes per additional device.

Path 2: Flash Tasmota or ESPHome (Wi-Fi Devices)

  1. Check DIY mode support. Newer Sonoff devices (BASICR4, MINIR4, etc.) support OTA flashing. Open the eWeLink app, enable DIY mode, then use Tasmota Web Installer or the ESPHome dashboard.
  2. Older devices: serial flash. For older models (Basic R2, TH10/16, POW R2), you need a USB-to-serial adapter (FTDI or CH340). Open the case, connect TX/RX/GND/3.3V, and flash via web installer. Takes 10 minutes once you have done it before.
  3. Configure. Tasmota: set your Wi-Fi credentials, choose the right template for your device, and configure MQTT. ESPHome: create a YAML config in the ESPHome dashboard, compile and upload.
  4. Add to Home Assistant. Tasmota devices appear via the MQTT integration or the native Tasmota integration. ESPHome devices are discovered automatically.

Time needed: 15 to 30 minutes for OTA flashing. 30 to 60 minutes for serial flashing (first time).

Path 3: SonoffLAN Integration (No Flashing)

  1. Set up devices in eWeLink first. Install the eWeLink app, create an account, and add your Sonoff devices normally.
  2. Install SonoffLAN via HACS. In Home Assistant, go to HACS, search for "SonoffLAN" (by AlexxIT), and install it.
  3. Add the integration. Go to Settings, Devices and Services, Add Integration, search "Sonoff". Enter your eWeLink credentials.
  4. Enable LAN mode. The integration automatically tries local control first. If a device supports LAN mode, commands go directly over your network without hitting the cloud.

Time needed: About 15 minutes total.

5 Sonoff Automations That Actually Save You Money

These are not gimmicks. Each one either saves energy, improves comfort, or makes your home more secure.

1. Motion-Activated Hallway Lights

Use an SNZB-03P motion sensor and a ZBMINI-L2 behind your hallway switch. Lights turn on when you walk through, off after 2 minutes of no motion. No more flipping switches with full hands.

automation:
  - alias: "Hallway motion lights"
    trigger:
      - platform: state
        entity_id: binary_sensor.snzb_03p_hallway
        to: "on"
    action:
      - service: switch.turn_on
        target:
          entity_id: switch.zbmini_hallway
      - wait_for_trigger:
          - platform: state
            entity_id: binary_sensor.snzb_03p_hallway
            to: "off"
            for: "00:02:00"
      - service: switch.turn_off
        target:
          entity_id: switch.zbmini_hallway

2. Presence-Based Office Climate

Use an SNZB-06P mmWave sensor and a TH Elite controlling a space heater. The heater runs only when someone is actually in the room. No more heating empty rooms.

automation:
  - alias: "Office heater on presence"
    trigger:
      - platform: state
        entity_id: binary_sensor.snzb_06p_office
        to: "on"
    condition:
      - condition: numeric_state
        entity_id: sensor.th_elite_office_temperature
        below: 20
    action:
      - service: switch.turn_on
        target:
          entity_id: switch.th_elite_office
  - alias: "Office heater off no presence"
    trigger:
      - platform: state
        entity_id: binary_sensor.snzb_06p_office
        to: "off"
        for: "00:05:00"
    action:
      - service: switch.turn_off
        target:
          entity_id: switch.th_elite_office

3. Door Open Alert When You Leave

SNZB-04P sensors on every exterior door and window. Get a phone notification if anything is left open when everyone leaves the house.

automation:
  - alias: "Alert doors open when leaving"
    trigger:
      - platform: state
        entity_id: person.you
        from: "home"
        to: "not_home"
    condition:
      - condition: or
        conditions:
          - condition: state
            entity_id: binary_sensor.snzb_04p_front_door
            state: "on"
          - condition: state
            entity_id: binary_sensor.snzb_04p_back_door
            state: "on"
    action:
      - service: notify.mobile_app
        data:
          title: "Door left open!"
          message: "You left home but a door is still open. Check the app."

4. Energy Hog Detection

Use a POW Elite to monitor a high-draw appliance (dryer, space heater, server). Get alerted if it runs longer than expected or exceeds a power threshold.

automation:
  - alias: "Dryer running too long"
    trigger:
      - platform: numeric_state
        entity_id: sensor.pow_elite_dryer_power
        above: 100
        for: "02:00:00"
    action:
      - service: notify.mobile_app
        data:
          title: "Dryer still running"
          message: "Your dryer has been running for over 2 hours. Power: {{ states('sensor.pow_elite_dryer_power') }}W"

5. Humidity-Controlled Bathroom Fan

An SNZB-02D tracks bathroom humidity. When it spikes above 70% (someone is showering), a BASICR4 relay kicks on the exhaust fan. Turns off when humidity drops back to normal.

automation:
  - alias: "Bathroom fan on humidity"
    trigger:
      - platform: numeric_state
        entity_id: sensor.snzb_02d_bathroom_humidity
        above: 70
    action:
      - service: switch.turn_on
        target:
          entity_id: switch.basic_r4_bathroom_fan
  - alias: "Bathroom fan off humidity"
    trigger:
      - platform: numeric_state
        entity_id: sensor.snzb_02d_bathroom_humidity
        below: 60
        for: "00:05:00"
    action:
      - service: switch.turn_off
        target:
          entity_id: switch.basic_r4_bathroom_fan

Sonoff vs Other Brands

Where does Sonoff fit compared to Shelly, Aqara, and IKEA?

FeatureSonoffShellyAqaraIKEA
Price๐Ÿ’ฐ Cheapest๐Ÿ’ฐ๐Ÿ’ฐ๐Ÿ’ฐ๐Ÿ’ฐ๐Ÿ’ฐ๐Ÿ’ฐ
HA IntegrationMultiple pathsNativeZigbee/MatterZigbee/Matter
Local ControlYes (with effort)Yes (built in)Yes (Zigbee)Yes (Zigbee)
Product RangeHugeLargeLargeMedium
Tinkering RequiredSome (Wi-Fi)MinimalMinimalMinimal

Bottom line: Sonoff wins on price and flexibility. If you enjoy tinkering and want the cheapest path to a smart home, Sonoff is hard to beat. If you want something that works perfectly out of the box, Shelly is the safer pick for Wi-Fi devices, and Aqara for Zigbee sensors.

Pro Tips from the Community

Update ZBDongle Firmware

The stock firmware on ZBDongle-E and ZBDongle-P works, but community firmware (like the Koenkk coordinator firmware) improves stability and range. Flash it once and forget about it.

USB Extension Cable

Always use a USB extension cable (at least 1 meter) between your ZBDongle and your server. USB 3.0 ports create interference on the 2.4GHz band that Zigbee uses. A short extension cable fixes this completely.

Build a Mesh

Mains-powered Zigbee devices (like the ZBMINI-L2) act as mesh routers, extending your network's range. Place a few switches around the house and your sensors will have a strong mesh to talk through.

Disable Cloud After Flashing

After flashing Tasmota or ESPHome, your device no longer phones home. But if you used SonoffLAN or eWeLink integration, consider blocking Sonoff's cloud IPs at your router for extra privacy.

Buy the "P" Versions

Sonoff's Zigbee sensors come in original and "P" versions (like SNZB-03 vs SNZB-03P). The P versions have improved battery life, better housing, and use newer Zigbee chips. Always go for the P variant.

AliExpress vs Amazon

Sonoff's official AliExpress store (ITEAD) typically sells for 30 to 50% less than Amazon. Shipping takes 2 to 3 weeks to most countries. Worth the wait if you are building out a whole house.

Sonoff Starter Kit: Three Budget Tiers

Building a smart home with Sonoff does not have to happen all at once. Pick a tier and expand from there.

Starter
~$50
  • ZBDongle-E coordinator ($20)
  • 2x SNZB-02D temp sensors ($24)
  • 1x SNZB-04P door sensor ($8)

Enough to get started with climate monitoring and one door sensor. You will want more within a week.

Best Value
~$120
  • ZBDongle-E coordinator ($20)
  • 3x SNZB-02D temp sensors ($36)
  • 3x SNZB-04P door sensors ($24)
  • 2x SNZB-03P motion sensors ($20)
  • 1x ZBMINI-L2 switch ($12)
  • 1x SNZB-06P presence ($18)

Covers the main rooms with climate, motion, door monitoring, and one smart switch. Strong Zigbee mesh too.

Full House
~$250
  • Everything in Best Value
  • 3x more ZBMINI-L2 switches ($36)
  • 2x more SNZB-04P sensors ($16)
  • 1x POW Elite power monitor ($18)
  • 1x TH Elite + probe ($15)
  • 2x S26R2 smart plugs ($18)

A seriously automated home for under $250. That is less than a single Ring Alarm Pro kit.

Not Sure Which Sonoff Devices You Need?

Tell us what smart home gear you already have. Our free scan checks compatibility with Home Assistant and recommends the best next steps, including which Sonoff devices would fill the gaps.

Start Your Free Scan

Frequently Asked Questions

Can I use Sonoff devices with Home Assistant without the cloud?

Yes. Zigbee devices (SNZB series) work locally through a coordinator. Wi-Fi devices can be flashed with Tasmota or ESPHome for full local control. The SonoffLAN integration also provides mostly local control without flashing.

What is the best Sonoff Zigbee coordinator for Home Assistant?

The ZBDongle-E is the current top pick. It uses a newer chip (EFR32MG21), supports both Zigbee 3.0 and Thread, and works with ZHA and Zigbee2MQTT. The older ZBDongle-P is also reliable and sometimes cheaper.

Should I flash Tasmota or ESPHome on my Sonoff devices?

Both are excellent. Tasmota gives you a standalone web UI on each device and works great over MQTT. ESPHome integrates more tightly with Home Assistant using YAML configs. For beginners, ESPHome is usually easier to manage long term.

Does the NSPanel Pro work with Home Assistant?

The NSPanel Pro runs Android and can run the Home Assistant companion app or a browser pointed at your HA dashboard. Some people also flash custom firmware for deeper integration. It makes a great wall-mounted dashboard display.

Are Sonoff Zigbee sensors reliable?

Very. The SNZB P-series sensors are well-built for the price, with battery life measured in years. They report consistently and rarely drop off the network. Just make sure you have a decent Zigbee mesh with a few mains-powered devices acting as routers.