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

It’s not too tough to make momentary button. I don’t want to insult your intelligence, but in case you don’t know how:

Log into the IDE
Click “My Devices” at the top
Click “+ New Device” in the upper right corner
Give it a name. Leave Label and Zigbee ID blank. The “Device Network ID” has to be a number no other device is using. A random 5 digit number would work. For “type”, select “Momentary Button Tile”. For version, do “Published”. Select your Location and Hub from the drop-downs. Hit “Create” when you’re all done.

Now you have a virtual switch! Tell your piston to fire when you hit your new button, and you’re good to go.

Many thanks Eric for adding the DS18B20 temperature probe support. I updated the firmware and it worked like a charm. Also updated all my Sonoff’s using OTA for the first time. Again worked like a charm.

Now just looking forward to the Dual and Power support.

I have a sonoff switch that have been used with the Ewlink app (the sonoff app) .
When I flash the Switch it does not create a WiFi hotspot.

Is it to late to flash the switch if it have been used in the sonoff app first ?

thanks

Shouldn’t make a difference. Does the button turn on/off the load?

Hi

Yes the switch works like ut should with the button on the board.

Flashed it 3 times, sucsess everytime.
But when power on there is no hotspot for config.

Off all the 3 I got, this was the only one I tested using the Sonoff app before I got the flash module.

I have 5 more modules on the way, if I dont get this to work it doesn’t matter. But it was strange that this module did not work like the other 2.

If Sonoff uses the same wifi library that I use, it is possible that the device is already connected to your wifi. Flashing a different firmware does not clear the device settings. So check to see. If not, try resetting the wifi settings by holding down the device button 15+ seconds.

1 Like

That is awesome :slight_smile: holding the button for 15 second, green LED flashed 4-5 times…
And then there was a Sonoff hotspot, and everything working perfect now in ST!

You are tha man !! thanx again for an incredible solution :slight_smile:

I know people have discussed this in the past but I have never seen it myself, but all three of my Sonoff’s decided to reset themselves yesterday and are back to defaults (default SSID being broadcast).

Has anybody got any idea what triggers it? Just so strange that I had no problems for 2 months and then suddenly all devices reset on the same day (I cant think of anything else which would cause it…). I was thinking a power surge or something as my power did go off, but I have quite regularly turned them off at the wall up until now, so shouldnt be any different… Bizarrely my two H801s are still running fine, so it seems something Sonoff’y…

I have one that I was testing, worked flawlessly for a month, then out of the blue it reset itself as you described. I hadn’t had time to troubleshoot it yet. If I find anything I’ll post.

Might just be error on my part though.

@PixelEQ @cjcharles This is an sdk level bug. When the esp boots up faster than your AP after a power bump, a credentials wipe occurs.

I was hoping that a fix would be available by now, but it is still open. I’ll look around to see if I can implement a workaround I just didn’t want to dedicate a lot of time to it if there was a fix around the corner.

Even when my AP doesn’t loose power and is remaining consistent? Maybe its a wiring issue on my end?

Someone might have been spamming deauth packets from one of the many wifi jammer type things. When I was playing with that on an ESP it kicked off my flashed sonoffs and they just froze till power cycled, and came back without wifi.

I’m finally trying this. I (the missus actually, but do I dare say that) misplaced one of my GE outdoor outlets so there is not a better time. I ordered 4, hopefully that’s enough. Now for some exercise in patience while waiting for the package.

Thanks for the summary, makes sense and does seem like a tricky problem to fix in a clear/clean way without creating other problems! Though wrapping in persistent(false) and then persistent(true) calls does look like a sensible temporary fix. Perhaps the other way would be requiring a credential reset (using button) during first installation, and then you never reset credentials unless you do the button based reset again.
Thanks for the insight

Hi, what happens when ther is a hub software update? will all devices that are non official be lost?
Non official DTH? asking because i have just started fitting my house with xiaomi sensors and sonoff switches and would want to do all the settings all over.
Thanks

So I spend 6-7 hrs trying to flash my sonoff with the FTDI adapter but nothing worked. Finally with the help of espeasy forum figured that there is a driver issue with fake FTDI chipsets, so I went for CH340 which worked like a charm, I was up & running in minutes.

forum link https://www.letscontrolit.com/forum/viewtopic.php?f=5&t=2772&p=14211#p14211
ch340G that works for me: http://www.ebay.in/itm/111921959292?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

@erocm1231 I tried the generic bin file, sorting the gpio14 with GND does not flip the relay for me.
I tried the firmware from below link but that seems to be having bugs, after doing update my sonoff went offline, no SSID and the relay triggers on/off randomly.
https://github.com/erocm123/SmartThingsPublic/blob/master/devicetypes/erocm123/sonoff-wifi-switch.src/Sonoff.ino.generic.bin

EDIT: Hold on, the GPIO14 firmware may not be the issue, I flash the generic that is listed in the OP, set it up, works fine. Then as I enter a jumber in GPIO14 with other end not connected anywhere, and the sonoff falls off the network and never comes back, not even after a power cycle, though the button still activates the relay, . I then have to re-flash it, I guess maybe a bad solder job, need to re-check everything.

I have never had any of my devices not work after a hub update. Maybe I’m lucky, but just never had any issues. Community developers use exactly the same methods of communicating with devices that the SmartThings team does. It would be really unlikely for official devices to work but community devices not to after an update. Unless SmartThings changed all of their device handlers (in which the community would know about it).

@vbhoj74 I haven’t had any problems with that firmware. Right now GPIO14 is programmed to have a momentary switch attached to it. I will shortly release a firmware option to change that to a toggle switch.

1 Like

Hello Eric thank you for the anwser.
how to connect a FTDI device to a sonoff wifi switch without soldering?
Any connection? Adapter?

Will this FTDI adapter work?and how to connect to the sonoff board?
Sorry for all this beginners questions. Thank you for your help.

This is good to know. Had a power cut yesterday evening and all my devices had their WiFi credentials wiped…

I’ve uploaded new firmware and device handlers for all Sonoff devices. It includes the work around for the wifi credentials bug that has worked in all of my tests. I have also posted a beta firmware and device handler for the Sonoff POW (look in my github repository).

There are a lot of changes with these updates so make sure you update both the firmware and the handler at the same time or things won’t work properly in SmartThings.

Also the following config options have been added:

All

Auto Off - Turns the device off after x seconds. @liteglow you can try using this in the momentary configuration that you are needing. Set it to 1 second and see if that works for you.

Sonoff

External Switch - If you connect an external switch to GPIO 14, you can configure it as either Momentary or Toggle. I believe this is working, but haven’t had a chance to test it fully. Let me know if there are any issues.

Sonoff TH

Temperature & Humidity Offsets

Sonoff POW

W, A, V Report Intervals - Ability to set how often these are reported

3 Likes