Home Home Control: Setup SONOFF S26 SmartPlug with Tasmota
Post
Cancel
Preview Image

Home Control: Setup SONOFF S26 SmartPlug with Tasmota

The Sonoff S26R2 uses an ESP8285 MCU and can be re-programmed to use the Tasmota home control firmware.

Dismantle Socket

  • Remove bezel around plug pins; just pulls off
  • Remove three small screws (PH1 screwdriver)
  • Pull from bottom to open shell; has clip at top edge

Attach Wires for Serial Connection

  • Pins are clearly marked on underside of PCB
  • Found it easiest to solder three-pin header socket to Vcc/Tx/Rx
  • Separate wire to ground pin pad

Flash Tasmota

  • DO NOT PLUG INTO MAINS
  • Connect USB serial adapter to SONOFF S26 pins. ENSURE adapter is set on 3.3 volts and connect Tx to Rx and vice versa
  • Test connection by plugging in USB; LED should flash
  • Unplug USB, hold down pushbutton on unit whilst plug USB in, then release button; LED should remain off
  • Flash Tasmota
    • Either via Tasmota Web Installer (needs Google Chrome) which downloads precompiled release version
    • Or by compiling source code in PlatformIO:
      • Open Tasmota GitHub download in VSCode; open tasmota/tasmota.ino file
      • Compile and flash to the S26 socket (should erase flash first)
  • Unsolder temporary programming cables

Configure Tasmota

  • If using Web Installer can configure through that
  • Or use Web UI via SoftAP:
    • Use phone/MacBook to connect WiFi AP “tasmota_XXXXXX-####” where string is derived from the device’s MAC address
    • Will open Tasmota configuration page, or if not browse to http://192.168.4.1
    • Setup WiFi; select SSID and enter password
      • Click Save; device will try to connect to network, and show device’s IP address
      • Go to new IP address (note: SoftAP will be shut off)
    • Configure Module; select Sonoff S2X (8), press Save
    • Configure MQTT;
      • host: 192.168.0.21 / 1883
      • user/password: homeassistant / [STRONGBOX]
      • topic: S26_n; n= number of socket
      • full topic: %topic%/%prefix%/
      • press Save
    • Configure Other:
      • Web admin password: [STRONGBOX]
      • Device name: ESP-S26-n; n = number of socket
      • Friendly name: Socket One (etc)
      • Emulation: Hue Bridge
      • Press Save
  • Record MAC address and allocated IP in Network Configuration file

Add to Alexa Control

  • Goto “alexa.amazon.co.uk”, select “Smart Home” -> “Devices
  • At bottom of page press “Discover” button; new device should appear in list
  • Select “Smart Home” -> “Groups“, select “Christmas
  • Tick new device in list to add to group

Notes re Christmas Lights

Sonoff S26 sockets are programmed with Tasmota 12.3.1 and should be automatically discovered by HASS Tasmota integration (Tasmota needs “setoption 0” which is the default setting since “MQTT Discovery” removed from Tasmota, now use “Tasmota Integration”)

  • However needs to be configured correctly and MQTT was actually setup for old MQTT on Raspberry Pi (use configure above)
  • Changed “switch” to “light” in HASS (Settings → Devices & Services → Helpers)
  • Added group for “Christmas Lights” in HASS (Settings → Devices & Services → Helpers) and added sockets
  • Add this group to “All Lights”
  • Set “Christmas Lights” voice assistant to Alexa (click group, cog at upper RHS, Voice Assistants)

Also downloaded MQTT Explorer (link), connected to MQTT as above, and can see all the discovery messages, etc

References / Resources

This post is licensed under CC BY 4.0 by the author.