SonoffS22 Switch

Ah yes. Thanks for that. I think I’ll configure it for the normal wlan as #1 and my current guest network as #2. Then if the main one won’t connect, presumably it falls over to guest or if all else fails I can reflash it. I ordered the bits from a local supplier so I think I’ll have them either friday or next week and I can give it a try.

Your guest network will probably have internet access but not access to your home computers.

That’s right which is a nuisance if I want to integrate it in Home Assistant (which I do). It works fine with IFTTT and the input boolean

My S20 switches arrived today, the design is a bit different to the US version. The PCB is full length and soldered to the mains socket so it will be difficult to remove it without melting the plastic around the pins. Still relatively easy to flash by soldering a 4 pin header to the top of the board. Both mine are flashed and worki:g.

Didn’t realise you had just ordered some. $9.95 each hard to refuse eh?

Are you saying it’s not as easy to flash these suckers as has been portrayed in this thread? Am I going to be able to ‘hold’ the pins into the header to flash like Kanga suggested? Am I able to just unscrew them to get access to the board as stated above?

FWIW, it’s a doddle to use the ewelink app and IFTTT to control these suckers in HA with a Boolean switch which is what I have done while waiting for the gear to flash with Tasmota.

It seems like what @bukurat has stated is that the PCB has the socket plug soldered directly to it rather than being connected by wires as shown in some pictures.

I would imagine if he was able to solder a header to the board, you would easily be able to hold said header in place. Flashing the board only takes 20-30 secs, so its a quick process.

That’s exactly what I meant.
I found this pic on the intertubes with power and ground already marked. I’ve added the RX and TX pins from the schematic I found on the manufacturer’s web site. If you wire RX to TX on the USB to serial converter and vice versa it all works.

I don’t know the answer to the question about the other pins as they aren’t shown on the schematic.
The OP of the image used blu-tack to hold the pins into place. I soldered mine by pulling the pins through the insulator to give clearance for the soldering tool, soldering to the top of the board with a small tipped soldering tool and then pushing the plastic insulator down onto the PCB. A couple of minutes work.

1 Like

Flashing the Sonoff range is still a lot easier than some of the tiny RGB controllers I have flashed. Sonoff at least has a set of holes for a header.
There is one screw to remove and some clips around the side to open in order to get at the insides. I used a small screwdriver to work around the side after removing the screw. You can see the screw hole at the bottom of the board in the pic and the clip locations around the side.

I would rather not use cloud based control like IFTTT and ewelink. I keep as much as possible under local control.

1 Like

+1 to that.

The whole point of HA is local control that doesn’t rely on an external internet connection. I recently had an internet outage for close to 24 hrs, yet every one of my automations all still worked as all my items use local control and don’t rely on web services like IFTTT to operate.

This is the other version (s22) image that i’ve found on Github under a TASMOTA thread.

The first image shows in the middle of the board that the V pin is closest to the power wires, so the order of the header pins in the 2nd image from top to bottom should be V, RX, TX, Gnd.

Fair enough… However I use Google Home for voice control. Pretty much none of my stuff works without Internet. Xiaomi, Milight, Yeelights and Sonoff…

Maybe I can set all those up with MQTT but I’ve not touched that yet. The Sonoff with Tasmota will be my intro to that black art lol!

I use Google Home and Amazon Alexa for voice control. They do require an internet connection to function, there is no way around that that I’m aware off, so no internet means no voice control, however, all automations that I have in place still function without internet, including Yeelights, Sonoffs, WeMo switches, Xiaomi switches, Osram Lightify, 433toMQTT WiFi bridge etc.

If I am on my local network, I still have full control over all items through the HA web interface as everything is locally controlled and all automations still fire turning lights/switches on/off.

I’d like to know which version the S22 board is. I suspect it may not be the AU one.

1 Like

Well got the usb adapter and header pins.

The USB adapter header looks like this:

Pins are labeled from top:

So the TX and RX are jumpered.
It also came with only 3 wires for patching… I am sure I can find another one here… I’m assuming I need to use 4 wires and I need to remove the jumper from TX-RX and use the 3.3 and gnd pins as well.

Is this correct?

make sour you only GIVE it 3.3 vvc ground the gpio 0 first plug into computer should go beep and them you should here an other beep telling you it in program mode

Yes, remove the jumper, connect 3.3 and gnd to the respective pins on the S22. RX goes to TX and TX to RX. Hold the switch on the S22 down when you connect the 3.3V in order to put the micro controller into program mode.
What are you using to send the program? I use platform io running in VS code.

I was going to use Windows 10 - the instructions seem to have step by steps for that.

Windows 10 is an operating system. You need to run a program on it in order to compile the code and flash the esp8266 micro controller.
The Tasmota source is set up to compile on the platform io IDE. It will compile on the Arduino IDE, however you have to run a non standard one.

I’m wondering if you have previously done any programming?

Very little programming. I used to code in GWBASIC and Quick Basic LOL. I’ve installed packaged from source in Linux etc.
I was just planning on following the instructions in the tutorial. That seems to include the programming software. Arduino I think. I’m going to take a look at it tomorrow.

The Arduino IDE is pretty basic and not the easiest to navigate a reasonably large project. As the Tasmota suite is already set up for platform io, I suggest you download Visual Studio Code from the windows store - its free - and install the platform io plugin. I’ll be around tomorrow and can talk you through the process if you like.

Windows 10 has Skype, we can converse there or by phone. message me a number and I’ll call you.


1 Like