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

that is nice! which model did you use?

@KmanOz the pic was taken from another forum. In my scheme i’ts a switch to ground.

There’s only 1 POW

How long is the wire from the switch on the wall to the Sonoff?

@KmanOz Actually the circuit is on a proto board (see pic)

When it will be installed, the wire from switch to the sonoff should be 2meters, and the wire runs near the 220v power wire to the light.

i got my sonoff flash and upload 100% but not working the led light not blink anymore,how to solve?

mine is the normal version not the pow

Uploading 242208 bytes from C:\Users\RATTAK~1\AppData\Local\Temp\arduino_build_892356/ESPsonoff_TH-v1t.ino.bin to flash at 0x00000000
… [ 33% ]
… [ 67% ]
… [ 100% ]

Do you have a TH series or original Sonoff because you are flashing TH series firmware and it will not work in an original Sonoff. If that is the case use the right firmware,

now i can’t get into flash mode…:frowning:

reload firmware but still not chance no light on LED, not sure why, also not connected to my router

Well you need to sort that out first. Were you using the wrong firmware for the switch? Anyway, what is the LED doing? How is it flashing? You can leave it plugged into serial (without mains power) and open up the console in Arduino to troubleshoot. There is ZERO reason for it not to connect if your entered your credentials correctly, and your router uses DHCP to assign an IP address.

Hi Kmanoz

i have been hanging back but still have not got this to work so it is time to post a question.
Using the latest code on GitHub (today 30 December 2016) I can get the code to compile and upload to the Sonoff POW but it is not connecting.
I think the problem is that I have not installed the “power” library correctly.
I have put a folder called “power” with the power.cpp and power.h files inside it in the Arduino libraries folder in my documents.
The #include power.h is not an orange colour so thinking something is not right.

Any ideas?
Thanks
RAWB

Sorry for reply to old post :slight_smile:

I plan to handle 3way and 4way switches in my house by having one sonoff wired to the light itself and then use existing wiring to power ONLY the sonoff modules, leaving the relays empty. I plan to have a “common” mqtt state for relay status shared amongst all switches I wish to control a particular light.

Fairly certain the switch itself can be added to a gpio and have a similar shared mqtt state that toggles with light toggle or home-assistant toggle, relying on the mqtt broker to keep everything sync’d. I have not deployed this yet but hope to test in he next few days. Comments encouraged!

Hi

Put all 3 files in your sketch directory for the POW exactly as is in Github. No need to install the Library. Try that.

Kman

i think i use the correct firmware no led flashing at all, is it i connect sonoff from arudino uno instead of usb to serial ?? my arduino ide serial port manager nothing show up. i try whole night witth all different version, manage to upload but not working. any other way to test my sonoff whether is ok anot, before flashing is working normal and is a new one.

So you are plugging your Sonoff via FTDI adaptor into your computer. If so, that is correct. If no serial port is showing up then your FTDI adaptor is defective or you have a driver issue in Windows or something else. Fix that issue first before you can do anything else.

You don’t need an Arduino Uno for this. Not sure why you have one in the mix.

You say you manage to upload, but to what, the Uno? I, confused because you said your Arduino IDE serial port manager, nothing shows up, then what are you uploading to?

I think I understand but am unsure. Draw a schematic. It will help you and others :smiley:

I’m looking to use this firmware in my Home Assistant setup. Just so I’m on the right page, would this be the right USB cable to use?

Thank you

I think it should be fine although personally I haven’t used that type. You will need to re arrange the pins to suit the pins on the Sonoff. Also TTL levels need to be 3.3V NOT 5V or you will blow the ESP chip. I can’t see where it’s selectable. From the photo it looks like it may be wired wrong but basically you need -

CABLE/FTDI ADAPTER         SONOFF

VCC                        VCC
TX                         RX
RX                         TX
GND                        GND

Personally I use this adapter

http://www.ebay.com.au/itm/FTDI-FT232RL-USB-to-TTL-Serial-Converter-Adapter-Module-5V-3-3V-For-Arduino-GH-/272279719836?hash=item3f6522cf9c:g:j3QAAOSw5ZBWPbNF

and make my own cable using female to female pre made jumper cables from the Sonoff to the FTDI adapter and use a standard USB cable to the computer.

http://www.ebay.com.au/itm/40pcs-20cm-Jumper-Wire-Cable-For-Arduino-Breadboard-Prototyping-Female-to-Female-/252324355458?hash=item3abfb41d82:g:p08AAOSwiDFYRR2A

Good luck