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.

Hardware

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)

Flashing

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 192.168.1.163 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.

Conclusion

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.

PayPal

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

Patreon

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

image/svg+xml

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

client-image
client-image
client-image
client-image
client-image
client-image
client-image
client-image
client-image

Learn NodeRED

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

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

Best Automation Projects

Tuya SDK for beginners: Intro to Tuya Cloud API

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

NEST your old thermostat under $5

0
Nest-ing up your older thermostat under $5

Nora – Google Assistant in NodeRED

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

DIY Smart Washing Machine – for about 15 bucks!

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

Sonoff Zigbee Bridge – review

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

Smart Home

Remotes aren’t done with us yet: SwitchBot Remote

0
If you hate having 20 remotes hidden in your sofa, or your parents despise talking to Alexa to turn the lights on - SwitchBot Universal Remote is here to deal with all this!

We’ve seen this before: SwitchBot K10+ PRO

0
This is an odd one. Building on the success of SwitchBot K10+ they released SwitchBot K10+ PRO - but is the experience actually better?

Is this the smart panel we have waited for?

0
ITEAD has released a new smart panel: Sonoff NSPanel Pro 120 - have they learned the lesson from the terrible launch of the original Pro? Let's see what's new.

Aqara FP1E detects motionless humans

0
This isn't exactly a new device, it's an interaction of the original Aqara presence sensor. Aqara FP1E brings Matter, ZigBee and new triggers to your smart home

SwitchBot S10: cleaning re-imagined!

0
SwitchBot S10 promises unattended vacuuming and mopping so you can focus on things you love and care for. Does it deliver?