Home Home Automation Hacking Sonoff S26 WiFi Smart Plug

Hacking Sonoff S26 WiFi Smart Plug

Hacking Sonoff in under 30min!

ITEAD guys made it so easy for us mortals to open their products up and do custom things. I have been given 2 EU Sonoff WiFi Smart Plugs from a friend from my local hackspace so it’s time for hacking Sonoff WiFi Smart Plug and flashing it with Tasmota.

Hacking Sonoff WiFi Smart Plug

If you want to know why would I hack perfectly working Sonoff WiFi Smart Plug – I’d recommend you read this article.


The Sonoff WiFi Smart Plug is simple to open, 3 screws protect the socket inner PCB from my curious fingers. Inside, you will find a separate ESP8266 board attached to the main PCB where the relay and transformer are located.

What’s interesting, unlike Sonoff Basic which I hacked previously, this ESP8266 board has more GPIO exposed for further use. I’m sure, I will take advantage of this in the future. Apart from RT, TX and GPIO00 needed for the flashing process, the Sonoff WiFi Smart Plug has devs pads for GPIO04, GPIO05, GPIO02, GPIO12 and GPIO13. That’s a lot of sensors to connect, maybe even a display!

To flash the board, you don’t actually have to remove the ESP8266 from the main PCB, however, I have done so to inspect the board properly.  You can find the VCC and GND at the bottom of the board, and use the existing button of the device to pull the GPIO00 to ground. (hold the button down while powering up the ESP to enter the flash mode)


Make sure to make a backup of the firmware, that backup is device specific, so if you fail to do so, say goodbye to the eWelink app. Download the sonoff-tasmota firmware and put it into the esptool folder. You can read about setting up the esptool and correct procedure here. In short, just run these 3 commands, each time resetting the board into the flash mode

Once the new firmware is done, disconnect I disconnected the GPIO00 from the ground and rebooted the ESP to see if I can see the new AP. The device was advertising the WiFi so I knew everything went ok.

It was time to reverse all the steps and put the device back together. The entire procedure takes about 20-30 min depends on how good you are with the soldering iron.

Setting up Tasmota

Tasmota works with NodeRED and couple of other systems. I have entire procedure explained in the separate tutorial – read it here how to set up your Sonoff WiFi Smart Plug. Depending on how you want to control the Sonoff WiFi Smart Plug, you probably want to enable MQTT to integrate the devices with NodeRED

The device should be configured as Sonoff SX2 in the Tasmota firmware, it will also work as Sonoff Basic.

Works with NodeRED

And to get you started, I wrote a very simple controller with the web interface. I can toggle the lights using the Amazon Dash button or the web interface.

The Sonoff WiFi Smart Socket is linked to the so if you want to use the flow I made, make sure to update your IP configuration. I have included the MQTT examples, a showcase how to control the socket via HTTP and added the online status (IP turns red if the socket is offline). If you are interested in Alexa, check this write-up out.


Sonoff WiFi Smart Socket is yet another example of an open-source design that is not afraid of the community modding. This smart socket is fairly easy to hack and flash custom software. It takes very little time and the integration with NodeRED is just excellent. If you want to learn more how to control NodeRED with other devices, check out the connectivity guide in my NodeRED for beginners.

Project Download

Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.


Nothing says "Thank you" better than keeping my coffee jar topped up!


Support me on Patreon and get an early access to tutorial files and videos.


Bitcoin (BTC)

Use this QR to keep me caffeinated in style with crypto-currency

Smart Ideas with

Automate your space in with these ecosystems and integrate it with other automation services

Learn NodeRED

NodeRED for beginners: 1. Why do you need a NodeRED server?

To server or not to server? That's a very silly question!

Best Automation Projects

ESP8266 WIFI lights under $5

Your Sonoff device can't do this!

Free wireless doorbell (Amazon Dash button hack)

The most terrifying situation I can imagine* is missing a parcel

New Amazon Dash Buttons

You can teach new buttons old tricks!

ESP8266 ceiling light – demo

Testing the ESP8266 as a WIFI light controller

Try Tasker and Raspberry Pi for your home automation needs!

Raspberry Pi can help you with your Tasker profiles

Smart Home

Army of robots: SwitchBot Curtain

An army of SwitchBot Curtains - adorable CurtainBots to open and close practically any curtains!

Zemismart Roller Shade Driver

Frustrated with UK's roller measurements I reached out for Zemismart Roller Shade Driver

Most affordable smart lightbulbs: Sonoff B02 & B05

ITEAD just dropped a range of very affordable smart Sonoff lightbulbs

Creepy Alexa for Halloween

Turning Amazon Echo into a Creepy Alexa monster for Halloween

How to make Sonoff ZB Mini and ZigBee2MQTT work together

It's time to make Sonoff ZB Mini and ZigBee2MQTT work together!