[OBSOLETE] Sonoff, Sonoff TH, S20, Dual, 4CH, POW, & Touch Device Handler & SmartApp ($5 & $10 Smart Switches)

Thanks @JDRoberts, I always appreciate your remarks. I can’t comment on the design of the product, but it is always good to use caution with these types of devices. I haven’t heard any reports of issues with this device, but as JD mentioned, there is probably a reason that there aren’t safety certifications. Then again, a lot of certifications are there to protect idiots from themselves, but this is for sure a “hobbyist” type device. Use at your own risk.

1 Like

This is interesting, and I am wondering if I can use the firmware you mentioned and this device handler with the cheap EcoPlugs wifi controlled plugs that I bought from Home Depot I while back since it is based on the same ESP8266 chip. I disconnected them from my network because I found through a packet capture that they were regularly sending my wifi ssid/password in plain text to some remote IP address. This firmware sounds like it may be what I need to use them again.

When I get time I will attempt to load the firmware on one of them and report back the results. Below is an Amazon link to the plugs I am referring to but they are more expensive than I paid at Home Depot before they sold out of them.

Can you open one and take a picture of it’s pcb? Chances are that if it is esp8266 based and has a TX RX hook up, then it can.

There is a pretty good teardown here http://thegreatgeekery.blogspot.ca/2016/02/ecoplug-wifi-switch-hacking.html

Sonoff switch working great, took less than 5 minutes to setup. Response time is great, responds quicker than Alexa confirms voice command. My only regret is only ordering 4 :grin:



Well… that works for me… I ordered 7.

Ordered 4 more myself and 2 low voltage ones, anybody play with those yet? Would be good for led strip control

Sorry to bother you… can I still use the manual button to switch-on? I’d like to have a hybrid scenario where you can control using smartthing or “the legacy” way :slight_smile:

@erocm1231 can you show me a picture of the following? I’m still unclear on how to hook it up?

Now, with an FTDI adapter27 (SET AT 3.3V) connected to the switch (square pin = VCC, then TX, RX, GROUND - that order), plug the FTDI adapter into the USB port of your computer while holding down the button on the switch.

i connected the FTDI232? How do i Connect it to the switch and Is that the Sonoff Wi-Fi switch?

Thanks this is new territory for me.

The FTDI adapter should have labels on its pins for VCC, TX, RX, & GROUND. So, with the FTDI adapter unplugged, you will connect a jumper wires to those pins and then connect the other end of the jumper wire into the holes on the Sonoff switch. There are either 4 or 5 depending on which revision you got. The top hole should look different than the others, it should have a square solder pad. This is where you connect VCC from the FTDI adapter. Then, the next hole you will connect TX, then RX, and the 4th hole ground.

While holding down the button on the Sonoff, plug the FTDI adapter into your computer and it should boot the Sonoff into bootloader mode. Then you can release the button and follow the rest of the directions on flashing the firmware.

@lucalor Yes, after the device is fully configured through SmartThings, and you enter the SmartThings IP address into the Sonoff web gui, the physical button will work like normal.

1 Like

hi Eric,

Thanks for putting this together. I just attempted and having the some issue with two units so far. Both would flashed the firmware without issue but after I connect it to an AC cord to the input side and plugged it in, I get nothing. No SSID showing up. Am I really that unlucky that I got two bad units?

Make sure that when you put the cover of the switch back on that the cover isn’t pressing down the button that is on the switch. That happened to me once and it made it so the switch would keep going into bootloader mode and the SSID wouldn’t show up.

Flashed the first one I just received. It turns on or off quickly the first time, depending on initial setting of physical button, but then just sits at TURNINGOFF or TURNINGON when I tap in ST again. Log just shows the command debug on/off/refresh. Sometimes after a bit I get log’s of descMap, and it will cycle, but it seems random.

Here’s me turning it off which happened quickly, then on, and it’s been over a minute with it not turning on:

ad068c7f-c030-43d6-a825-8c46693cfbef  8:35:42 PM: debug on()
ad068c7f-c030-43d6-a825-8c46693cfbef  8:35:27 PM: debug descMap: [index:18, mac:5CCF7F81C1AC, ip:0A36196F, port:0050, requestId:5e7014bf-2f69-44a9-872d-e1007fdb51f9, headers:SFRUUC8xLjEgMjAwIE9LDQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiA4NA0KQ29ubmVjdGlvbjogY2xvc2UNCkFjY2Vzcy1Db250cm9sLUFsbG93LU9yaWdpbjogKg==, body:ewoibG9nIjogIkdQSU8gMTIgU2V0IHRvIDAiLAoicGx1Z2luIjogMSwKInBpbiI6IDEyLAoibW9kZSI6ICJvdXRwdXQiLAoic3RhdGUiOiAwCn0K]
ad068c7f-c030-43d6-a825-8c46693cfbef  8:35:27 PM: debug refresh()
ad068c7f-c030-43d6-a825-8c46693cfbef  8:35:27 PM: debug descMap: [index:05, mac:5CCF7F81C1AC, headers:R0VUIC9qc29uLmh0bT90eXBlPWNvbW1hbmQmcGFyYW09c3dpdGNobGlnaHQmaWR4PTImc3dpdGNoY21kPU9mZiBIVFRQLzEuMQ0KSG9zdDogMTAuNTQuMjUuMzcNCkNvbm5lY3Rpb246IGNsb3Nl, body:]
ad068c7f-c030-43d6-a825-8c46693cfbef  8:35:26 PM: debug descMap: [index:18, mac:5CCF7F81C1AC, ip:0A36196F, port:0050, requestId:e41b6651-302e-43fa-9d1c-9027b4655be0, headers:SFRUUC8xLjEgMjAwIE9LDQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiA4NA0KQ29ubmVjdGlvbjogY2xvc2UNCkFjY2Vzcy1Db250cm9sLUFsbG93LU9yaWdpbjogKg==, body:ewoibG9nIjogIkdQSU8gMTIgU2V0IHRvIDAiLAoicGx1Z2luIjogMSwKInBpbiI6IDEyLAoibW9kZSI6ICJvdXRwdXQiLAoic3RhdGUiOiAwCn0K]
ad068c7f-c030-43d6-a825-8c46693cfbef  8:35:22 PM: debug off()

Think this is the device handler or something with my network? I can run a continious ping during this without issue so it doesn’t seem to be network…

I thought so too but I tried it without the case on too :frowning: . I verified that I am getting 110V at the input terminals. Also, is the LED suppose to be OFF the entire time? I can’t manually turn it on via the switch either. Wonder if i had a bad flash

One of my four had a bad flash attempt, I don’t have a real solid pin setup for the ftdi adapter. I re-flashed it three times and kept slipping before getting it. As long as the cmd file finished without error after all the dots, it shouldn’t be a problem there. The light doesn’t come on when plugged in. But hitting the button should turn it on and you should hear the relay flip.

I got one to work so far. Other have successfully flashed but i don’t see the AP at all.

Did you get this figured out? You don’t happen to have a wireless bridge that you are going over do you? Or something other than a consumer level access point. From your description it seems like the SmartThings hub isn’t getting a response after sending the http request.

@cuboy29 I’ve flashed about half a dozen and have only seen the AP not appear when I had accidentally held the button down. Does it make a difference if you boot it up with the 3.3v on the FTDI adapter rather than the 120v from the wall?

They connect to a simple Netgear 6300 in AP mode that goes via ethernet to a Microtik 24 port switch where the ST hub hangs off of. Everything else runs this way, I’ll kill that AP and let it attach to the primary router but that also goes via the Microtik to the ST Hub. I don’t have anything crazy setup on anything really, multicast works great, but I assume this is simple unicast traffic? I’ll update in a bit when I get the chance to disable the AP.

Got one more to work. Not sure why 2 are not behaving. The flash went without issues. powering with the 3.3V yield the same result.

Two of mine took forever to get configured, went through their SSID and set my network and password, and it would just repeat. Finally figured out I could go to http://deviceip/config, set everything right off the bat, save a few times to be safe. Physically reboot the thing once, maybe twice, and it would eventually work.

I also saw another SSID show up randomly while messing with them, iteadxxxxxx, have you seen that at all?

Did you shut off your router’s wifi and try? Maybe some weird interference thing.