HomeHome AutomationHacking 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 with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

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

Tuya SDK for beginners: Intro to Tuya Cloud API

Working with Tuya Cloud API. A guide to Cloud automation for beginners, get started with REST!

NEST your old thermostat under $5

Nest-ing up your older thermostat under $5

Nora – Google Assistant in NodeRED

Integrate Google Assistant with NodeRED thanks to Nora - NodeRED home automation

Sonoff Zigbee Bridge – review

Sonoff line up will soon include Sonoff Zigbee Bridge and more Zigbee sensors - here is the first look

DIY Smart Washing Machine – for about 15 bucks!

Learn how to add washing machine notifications to your Google Home on the cheap

Smart Home

Sonoff ZigBee Bridge U isn’t what you think!

I expected Sonoff ZB Bridge U to be a next gen ZigBee bridge with Matter support. Turns out, there is much more to talk about!

Aqara “Everything” M3 Hub

When I started my home automation adventure, the current problem was the number of ecosystems needed to outfit your smart home. Aqara M3 Hub has a long list of protocols to match that!

Sonoff ZB Micro did it! (and bonus ZigBee device)

A long time ago, I took an angle grinder to the humble Sonoff Micro, will I do this again? Meet Sonoff ZB Micro and Sonoff ZB Contact (SNZB-04P) - the latest devices from the ZigBee ecosystem.

This keyless entry is PRO: SwitchBot Lock Pro

SwitchBot Lock Pro offers comprehensive upgrades over the original, combining enhanced design, stronger performance, and a faster mechanism for keyless entry

I damaged the cheapest Smart Socket with power metering for you

Sonoff S60 has an exeptional price for a smart socket with a power meter - I decided to check it out and see how flashable it is