Sonoff-HomeAssistant (Alternative firmware for Sonoff Switches for use with mqtt/HA)

Did they show any signs of failure before they died? Any flickering or chattering on and off? Or did they suddenly just stop working?

The brand of led lights that worked well for me is Toggled. They sell them here at home depot. I think they sell on amazon too.

The Hyperikon ones feed back a lot of noise.

Can you share the link with instructions on how to flash a Sonoff without soldering?

Just deleted my post - I solved my problem by setting the subnet mask on the Raspberry Pi device - all is now good.

something external as power surge or
Voltage going low ?

You don’t even need to solder, at least I don’t anymore. I just load my firmware once by plugging in a 4 or 5 pin header into the cable coming from the programmer and hold the pins in place on the Sonoff with a little bluetack on the top of the circuit board until it finishes receiving the code once. From then on I use OTA. I don’t solder them in anymore. It takes all of 1 minute to do.

The repo has issues usually in scripting. Using the Arduino IDE is quick, easy and proven.

@KmanOz, In your two years of using the Sonoffs, have you had any problems with surges drying the boards? What do you do to prevent surges from frying the Sonoffs?
Also, when putting the Sonoff into the gang box, do the electric wires interfere with the WiFi signal?

No issues in 2 years but surges are not regular here at all. As for a gang box, we don’t use them in Australia so have no idea sorry.

Hello. I’m new to using Sonoff basic and home control. I have a general question that may have been answered before but it may have been a while back. If I flash the SonOff basic so that I can use a regular on/off toggle switch can I still control the system with Goggle Home Assitant by voice?

Roy

Some of the custom firmwares will still allow you to connect to google home/alexa by emulating a device, for example, Tasmota says it can emulate hue and wemo devices: https://github.com/arendst/Sonoff-Tasmota/wiki

There is also another option, which is to connect Google Assistant to Home Assistant, in that scenario I believe Home Assistant would expose certain devices that are already configured in Home Assistant to Google Assistant. I’m not sure of the details of how this second option works. Can someone confirm if this is via emulation as well? https://home-assistant.io/components/google_assistant/

I use some Sonoff switches for lights and configured the Google Assistant component in home assistant. Basically you expose the light entities to Google assistant and then you are able to control them via voice. It’s pretty fast too.

So do i need to add birth messages for all my sonoff devices?

just create a switch with platform: mqtt and all the other required config.

if you have HA entities exposed to alexa then it should be found. i assume google home is the same.

Hi people…

While Itead has not developed a 3 gang US sized smart wall switch, what about those below:

Have you ever tried those aliexpress switches?
Can someone tell if they are sonoff based?

From the picture they seem ESP8266 based (like the sonoff) so in theory any firmware like Tasmota or ESPEasy should work, at least with light modifications.

1 Like

This is the next step in my Home automation project so I will definitely try this out when my parts come in. Thanks!

@KmanOz thanks for this share !

I have a sonoff th16 and it contains 4 pins i.e. 1 is GND, 2 of them are J3 and the last one is VCC.

I suppose when I am flashing your .ino code I can select any of the 2 J3 pins to flash the code in my sonoff? Is that correct?

The reason why I am asking is because I have this FTDI with 5 pins (https://www.ebay.co.uk/itm/CH340-CH340G-USB-to-Serial-Module-TTL-UART-adapter-Programmer-Arduino-mini-pro/132100659448?epid=17004374289&hash=item1ec1d018f8:g:-X8AAOSwx6pYqKJD)

Can I use a CH340g to flash the ino code? if yes how are the pin connections as I have tried to check them in the ino code but it doesnt make sense.

Thanks.

Guys can someone please help me?

I have the sonoff th16 ver 2.1 and I have followed all the steps but my arduino on mac cannot detect the port when I connect via USB to TTL.

What am I doing wrong? about to pull my hair !!

First you have to understand if the Mac can talk to the serial interface, if drivers are ok, if permission on port are ok. Then make sure the pins are connected correctly, the vcc is correct, the sonoff is booted in flash mode.

Having gone through this process a week or so ago on a Mac, a couple of issues I found with the various instructions on the web etc that caught me out.

  1. The USB to MicroUSB cable I was initially using (pulled out of my ‘box of wires’) was a charging cable and so didn’t have data lines. Spent a while not being able to find the port due to this! Swapped to a proper cable and all was good.

  2. The latest Sonoff’s have changed the chipset used. Most of the instructions online refer to the earlier Sonoffs and say to use the ‘Generic ESP8266 Module’. I have some TH version 2.0 and 2.1 and for both of these use ‘Generic ESP8285 Module’ instead.