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

Sonoff Zigbee Bridge – review

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

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

Smart Home

I damaged the cheapest Smart Socket with power metering for you

0
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

The end of Tasmota? Sonoff SwitchMan M5 Matter

0
These are one of the least expensive Matter devices to automate your lights. Will Sonoff SwitchMan M5 Matter put an end to Tasmota?

Meros TRV to the rescue?

0
I got my hands on another TRV - this time from Meross. I heard good things about the brand so I wanted to see if Meross TRV would be good to manage smart heating.

Aqara brings Thread sensors but…

0
Aqara brings new Thread sensors to their ecosystem. First sensors to support Matter this way are Aqara Motion and Light Sensor P2 and Aqara Contact Sensor P2

Multi-lights for your ceiling from Aqara

0
This is the biggest light I held in my hands so far. It's ZigBee and it comes from Aqara - meet Aqara Ceiling Light T1M