Sonoff Basic

Revision: Sonoff RF R2 POWER V1.0 PCB - ESP8285 Chipset
Need to be flashed with custom firmware to prevent the switch to connect the Itead cloud.

Resources

Tasmota

https://github.com/arendst/Sonoff-Tasmota

Tasmota firmware

https://github.com/arendst/Sonoff-Tasmota/releases Actual version: 6.4.1.8

ESPTool

https://github.com/arendst/Sonoff-Tasmota/wiki/Esptool#esptool-executable-windows–linux

Scheme

scheme

Source Domoblog

Wall switch

https://github.com/arendst/Sonoff-Tasmota/wiki/Sonoff-Basic#new-board-layout
A physical switch can be added to the Sonoff devices.
Can be achieved connecting GPIO3 labeled RX and GND.
In Tasmota Web interface, setup the module and bind the GPIO3 to 9 Switch1 (SwitchMode2 1).

Firmware mode

https://github.com/arendst/Sonoff-Tasmota/wiki/Esptool#put-device-in-firmware-upload-mode

On ESP8285, the green LED don’t blink in firmware mode.

Erase firmware

Can be useful if WiFi issue.

esptool -cp COM5 -cb 115200 -ce -v
esptool.py --port COM5 erase_flash

Flash firmware

  1. Plug the FTDI (without power supply) to the Sonoff device
  2. Push (and hold) the Sonoff button
  3. Plug in the FTDI to the PC
  4. Launch the following command (supposing you downloaded the Tasmota firmware into the same directory)

    EXE version

     esptool.exe -cp COM5 -cb 115200 -bm dout -cf sonoff.bin -v
    

    Python version

     esptool.py --port COM5 write_flash -fs 1MB -fm dout 0x0 sonoff.bin
    
  5. As soon as the firmware update begins, the button can be released.
esptool v0.4.13 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
setting flash mode from qio to dout
opening bootloader
resetting board
trying to connect
trying to connect
Uploading 534032 bytes from sonoff.bin to flash at 0x00000000
................................................................................ [ 15% ]
................................................................................ [ 30% ]
................................................................................ [ 45% ]
................................................................................ [ 61% ]
................................................................................ [ 76% ]
................................................................................ [ 91% ]
..........................................                                       [ 100% ]
starting app without reboot
closing bootloader
 

Setting up

Connect to the new WiFi AP : sonoff-...

  1. Setup the WiFi connection to home network
  2. Setup MQTT broker

Troubleshooting

Miscellaneous

Add to HomeAssistant

configuration.yaml:

switch:

  - platform: mqtt
    name: "Sonoff "
    state_topic: "stat/sonoff/RESULT"
    value_template: ""
    command_topic: "cmnd/sonoff/POWER"
    payload_on: "ON"
    payload_off: "OFF"