This is a log of what I did to get a Smart Wifi Wall Light Switch operating with Tasmota.
This switch requires a Neutral Wire.
I have been playing around with Sonoff Smart Plugs S20 and S26. The S26 is very tricky to program,as there is only spots to connect to. I burned one by using a soldering iron too hot. Feck!
I got this a few months ago but couldn't find any references to it anywhere. I suspected that it had a ESP8266 at the heart of it, as the modules are so cheap.
I cracked open the switch and got the WiFi chip number. It was not an ESP8266 but a variant of it.
Here is the guy. TYWE3S.
Here are the pinouts.
The pins of interest are TXD0, RXD0, IO0, GND and VCC.
I soldered it as shown below.
I looked up the chip and got the pin outs. It is a surface mounted chip, so soldering would be fairly difficult. As it turned out, it was not too challenging. The pins are raised up a bit and they are not too close.
I connected it up to breadboard and connected it to a FTDI32 board.
It needs to be set to 3.3v, via the jumper, otherwise you will fry the board.
The wire on IO0 needs to be connected to GND when it is powered up.
OBVIOUSLY IT CANNOT BE CONNECT TO THE MAINS IN ANY WAY, AS IT WILL FRY THINGS, INCLUDING YOURSELF = DEAD.
Connect them together, as required.
I used an Arch Linux laptop to do the flashing. It will be very similar on other distros.
Commands to Flash with Tasmota
You need to get a copy of esptool for your distribution
Backup the image on the device
esptool.py --port /dev/ttyUSB0 read_flash 0x00000 0x100000 image1M.bin
Erase the flash memory
esptool.py --port /dev/ttyUSB0 erase_flash
Write with Tasmota
esptool.py --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 tasmota.bin
The next part involves configuring Tasmota on the device.
Set the Name of the Device
Friendly Name 1
Set-up IP4 on the Device
Configure the functionality for the device
I configured the device to use MQTT and in Domoticz.
MQTT is brilliant. I use it extensively with my Boiler Radiator controller system
Then using HABridge, I was able to expose it to Amazon Alexa and use via Voice
This is the end product
A switch connected to a double socket controlled over WiFi.
I am going to use it to control my Soldering Iron
and Fume Extracting Fan