Flash Tasmota on SONOFF Without Soldering
Stock SONOFF firmware routes every command through eWeLink's cloud — even on your own WiFi. Tasmota replaces it with a local HTTP API, MQTT, and zero cloud dependency. This guide uses the OTA method: no serial cable, no soldering iron, no opening the device.
The short version
- Put SONOFF into pairing mode → connect your laptop to its WiFi AP
- Download
tasmotizer.pyand run OTA flash - Configure WiFi credentials via Tasmota setup portal
- Set MQTT broker IP, enable HA auto-discovery
- Device appears in HA automatically — done
What you need
SONOFF device
Basic R2/R3, Mini R2, or S31 — check compatibility list
Laptop on same WiFi
macOS, Windows, or Linux
Python 3.8+
For running tasmotizer
MQTT broker
Mosquitto add-on in Home Assistant
Home Assistant
For final integration step
USB serial adapter
Only needed if OTA fails on your device
Step-by-step: OTA flash
Download and install Tasmotizer
Tasmotizer is a Python tool that handles the entire OTA process. Install it with pip:
pip install tasmotizer # or, if you prefer git clone: git clone https://github.com/tasmota/tasmotizer cd tasmotizer && pip install -r requirements.txt
Put SONOFF into pairing mode
Hold the SONOFF button for 5 seconds until the LED blinks rapidly. The device will broadcast a WiFi AP named ITEAD-XXXXXXXX. Connect your laptop to that network (no password).
Run the OTA flash
Download the latest Tasmota binary for ESP8266 devices and point tasmotizer at it:
# Download latest Tasmota (ESP8266) curl -LO https://github.com/arendst/Tasmota/releases/latest/download/tasmota.bin # Flash it OTA (device IP is usually 10.10.7.1) python tasmotizer.py -p 10.10.7.1 tasmota.bin
The flash takes ~90 seconds. The device will reboot automatically when complete.
Configure WiFi in Tasmota setup portal
After reboot, the device broadcasts a new AP: tasmota-XXXXXX. Connect to it, open 192.168.4.1in your browser, and enter your home WiFi credentials. The device will join your network and you'll see its IP in your router DHCP table.
Configure MQTT and Home Assistant auto-discovery
Open the Tasmota web UI at its IP address → Configuration → Configure MQTT. Enter your HA Mosquitto broker IP and credentials, then run this in the Tasmota console:
# Enable Home Assistant MQTT auto-discovery SetOption19 1 # Set a friendly name (shows up in HA) FriendlyName1 Living Room Light # Confirm MQTT is connected Status 6
Within seconds, the device will appear in Home Assistant under Settings → Devices — no manual entity config needed. The switch entity, button sensor, and WiFi signal sensor are all auto-created.
Manual HA YAML config (alternative to auto-discovery)
If you prefer explicit YAML instead of auto-discovery, add this to your configuration.yaml:
# configuration.yaml
mqtt:
switch:
- name: "Living Room Light"
unique_id: sonoff_basic_living_room
state_topic: "tele/tasmota_XXXXXX/RESULT"
command_topic: "cmnd/tasmota_XXXXXX/POWER"
payload_on: "ON"
payload_off: "OFF"
state_on: "ON"
state_off: "OFF"
value_template: "{{ value_json.POWER }}"
availability_topic: "tele/tasmota_XXXXXX/LWT"
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
retain: falseReplace XXXXXXwith your device's unique ID (visible on the Tasmota web UI → Information page).
Troubleshooting
OTA flash fails — "Error: device not in DIY mode"
Your device firmware may be too new. Try the serial flash method instead: connect a CH340 USB-TTL adapter to GND/TX/RX/3.3V pads and use esptool.py.
Device not appearing in HA after MQTT setup
Check that Mosquitto is running (Settings → Add-ons → Mosquitto broker → Logs). Verify the MQTT host IP in Tasmota matches your HA server IP — not 127.0.0.1. Run "Status 6" in Tasmota console to confirm MQTT connected.
Physical button no longer works after flashing
Tasmota maps GPIO0 to Button1 by default. Run "Template" in the console to see your current pin mapping. For SONOFF Basic, the correct template is Module 1 (SONOFF_BASIC). Set it via Configuration → Configure Module.
Device reboots every few minutes
This is usually a power issue. Ensure your PSU provides stable 5V/1A+. If using a USB charger, swap to a quality one. Also check that SLEEP 0 is set in console if using high-frequency MQTT polling.