Sonoff S31 Smart Plug Mod

Steps

  1. Pop off gray cover

  2. Slide out white slidy corner pieces

  3. unscrew three exposed screws

  4. disassemble main board

  5. make a quick jig for flashing:

    Figure

    1. get 2 double-sided, 1x6 header pins
    2. plug one into a ftdi friend (adafruit)
    3. match up wires, ensuring RX –> TX and TX –> RX
    4. Configure the FTDI friend for 3.3v VCC and 3.3V logic
    5. pull out the 2 pins for D-RX and D-TX, they aren’t used
  6. press the button and align the new jig to the sonoff’s pins

  7. While connected, run the following two commands in order

    python -m esptool --port /dev/ttyUSB0 erase_flash
    python -m esptool --port /dev/ttyUSB0 write_flash -fm dout 0x0 Downloads/tasmota.bin
    
  8. Find the tasmota device Wifi SSID, connect, and set up your home wifi

  9. connect to the new ip address and configure further, from here

SetOption19 on
  1. set up mqtt

    1. go to configuration –> mqtt
    2. define the server, port, and any other advanced settings you might need.
  2. For ESP32 devices, get the tasmota32.factory.bin

esptool.py --chip esp32 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dout --flash_size detect 0x0 tasmota32.factory.bin
  1. relay pulse time

https://tasmota.github.io/docs/Commands/#control

Resources

Sonoff Specific:

Tasmota Documentation