Sonoff WIFI smart switch - uses ESP8266

Posted on
Fri Jun 15, 2018 3:11 pm
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Sonoff WIFI smart switch - uses ESP8266

I’ve got a bunch of these now, mostly as playthings, but I like them. Be sure to check out Tasmota for firmware, and find Dr. Zzz’s channel on YouTube, he has a ton of how-it’s with these. He uses Home Assistant, but most of what he does is easily transferable to Indigo.

Terry


Sent from my iPhone using Tapatalk

Posted on
Mon Jan 21, 2019 4:30 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Sonoff WIFI smart switch - uses ESP8266

My technician at work just asked me "Have you heard of Sonoff".

I thought it must be a new thing, so was surprised to find it on here dating back to 2016!

Posted on
Fri Aug 02, 2019 2:44 am
zoff offline
Posts: 47
Joined: Jan 21, 2013

Re: Sonoff WIFI smart switch - uses ESP8266

[quote="mclass"]Pleased to report that my Sonoffs have arrived, .... I am also investigating the use of the Sonoff SV (safe voltage) devices as part of my sprinkler system.
/quote]

Hi, I ordered the Sonoff 4 channel relay thinking it would be good for a sprinkler system too, even if I could only program the system via eWelink app but apparently the app can only schedule one relay at a time. What I would really like to do is to control the Sonoff 4 channel via indigo.
Can you give any information on what you have found?

Posted on
Fri Aug 02, 2019 7:36 am
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Re: Sonoff WIFI smart switch - uses ESP8266

The short answer is:

Flash your SonOff devices with Tasmota (alternate firmware). Search YouTube as there are several videos on how to do each. That will give you the ability to use MQTT

Install an MQTT server somewhere on your LAN, such as Mosquitto. Learn about MQTT pub/sub and topics

Wait for FlyingDiver’s Indigo Plugin to be released, or install Node Red, and the proper Indigo and MQTT nodes from the palette and wire the connections between the MQTT topics and Indigo variables/devices.

I’ll leave the googling to you; none of the steps are difficult, but they all require a little digging and planning, especially reflashing the SonOff devices. You will also need a USB adapter, some small jumper wires, and possibly soldering skills. Once you get the hang of it though, it’s pretty easy.

Terry


Sent from my iPhone using Tapatalk

Posted on
Fri Aug 02, 2019 8:26 am
FlyingDiver offline
User avatar
Posts: 7216
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Sonoff WIFI smart switch - uses ESP8266

roussell wrote:
Install an MQTT server somewhere on your LAN, such as Mosquitto. Learn about MQTT pub/sub and topics

Wait for FlyingDiver’s Indigo Plugin to be released, or install Node Red, and the proper Indigo and MQTT nodes from the palette and wire the connections between the MQTT topics and Indigo variables/devices.


If you wait a week or so, I've decided to add an MQTT Server (Broker) to the plugin. So you won't need to install some other software.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Aug 15, 2019 10:24 am
zoff offline
Posts: 47
Joined: Jan 21, 2013

Re: Sonoff WIFI smart switch - uses ESP8266

racarter did you flash the Sonoff 4ch Pro rev2 with a Raspberry Pi?
I just received a Raspberry Pi and I'm trying tp wrap my head around all of this. It could save me some time if I know that someone was successful. Thanks.

Posted on
Thu Aug 15, 2019 10:35 am
FlyingDiver offline
User avatar
Posts: 7216
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Sonoff WIFI smart switch - uses ESP8266

zoff wrote:
racarter did you flash the Sonoff 4ch Pro rev2 with a Raspberry Pi?
I just received a Raspberry Pi and I'm trying tp wrap my head around all of this. It could save me some time if I know that someone was successful. Thanks.


You don't use a Pi to flash Sonoff devices, Follow the instructions here:

https://github.com/arendst/Sonoff-Tasmo ... ff-4ch-pro

You'll need to do some soldering to get a serial-USB adapter connected to the board.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Aug 15, 2019 10:43 am
racarter offline
User avatar
Posts: 477
Joined: Jun 18, 2016
Location: North Yorkshire, UK

Re: Sonoff WIFI smart switch - uses ESP8266

@zoff

I used a Windows machine. The link in my post leads to instructions.

Posted on
Thu Aug 15, 2019 12:09 pm
zoff offline
Posts: 47
Joined: Jan 21, 2013

Re: Sonoff WIFI smart switch - uses ESP8266

Thanks for the quick replies but this is all way over my head.
I want to use the Sonoff 4CH as an irrigation controller via Indigo, I conflated "Control Sonoff from Raspberry Pi" with "flash sonoff Raspberry Pi".
There is a tutorial for flashing with a Raspberry Pi https://www.sigmdel.ca/michel/ha/sonoff ... ff_en.html.
Maybe I should just get an irrigation controller :roll:

Posted on
Thu Aug 15, 2019 12:34 pm
FlyingDiver offline
User avatar
Posts: 7216
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Sonoff WIFI smart switch - uses ESP8266

If you want to use the Sonoff and control it from Indigo, you need to flash it with the Tasmota firmware so that it uses MQTT. By default, you have to use their proprietary apps.

And that requires opening it up and connecting some wires so the you can connect it via a serial-USB adapter. Which isn't trivial, if you've never done any soldering or other hardware hacking. If all of that is outside your comfort zone, maybe pass this one by.

But if you want to give it a shot, you can use the rPi, which means learning some things about them. Or return the rPi, and get one of these: https://www.amazon.com/gp/product/B075N82CDL

Then you can use the Mac (or Windows) based tools to flash the firmware. You'll still need to solder some wires or headers, because the Sonoff doesn't have anything on the serial connectors you'll want to use.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Fri Aug 16, 2019 7:38 am
zoff offline
Posts: 47
Joined: Jan 21, 2013

Re: Sonoff WIFI smart switch - uses ESP8266

Thanks. I don't have a problem with soldering. "Mac based tools to flash the firmware" this is interesting, do you have a link?

Posted on
Fri Aug 16, 2019 11:10 am
FlyingDiver offline
User avatar
Posts: 7216
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Sonoff WIFI smart switch - uses ESP8266

zoff wrote:
Thanks. I don't have a problem with soldering. "Mac based tools to flash the firmware" this is interesting, do you have a link?


command line: https://github.com/espressif/esptool

GUI program that uses esptool: https://github.com/marcelstoer/nodemcu-pyflasher

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat Aug 17, 2019 2:41 am
zoff offline
Posts: 47
Joined: Jan 21, 2013

Re: Sonoff WIFI smart switch - uses ESP8266

Great thanks!
I've ordered the USB-serial adapter you linked to. So if I run the GUI program, in your link, via the USB-serial adaptor to the Sonoff, this GUI program will flash the Sonoff with Tasmota firmware?

Posted on
Sat Aug 17, 2019 4:48 am
FlyingDiver offline
User avatar
Posts: 7216
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Sonoff WIFI smart switch - uses ESP8266

zoff wrote:
Great thanks!
I've ordered the USB-serial adapter you linked to. So if I run the GUI program, in your link, via the USB-serial adaptor to the Sonoff, this GUI program will flash the Sonoff with Tasmota firmware?


You'll need to download the Tasmota image file first. The instructions are all in the Tasmota Wiki on GitHub.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Fri Aug 30, 2019 12:03 pm
zoff offline
Posts: 47
Joined: Jan 21, 2013

Re: Sonoff WIFI smart switch - uses ESP8266

Okay, I think I flashed the Sonoff 4ch Pro using NodeMCU-PyFlasher-4.0 on mac via USB-serial adaptor and the Sonoff-Tasmota v6.6.0 firmware. The software says "Firmware successfully flashed." So it must be true :? I installed Karl's arduino plug-in, what do I do next?

Sorry to be such a noob at this but I would appreciate any advice.

Who is online

Users browsing this forum: No registered users and 2 guests