Skip to content
My Account

HomeKit

LSC Smart Plug with an ESP8285 as a HomeKit Outlet

The LSC Smart Connect plug from Action, flashed through its TYWE2S module with an FTDI adapter, as an Apple HomeKit outlet with over-the-air updates.

  • ESP8285
  • HomeKit
  • Safety notes
  • 4 min read
No ratings yet, be the first.

The LSC Smart Connect Smart Power Plug is a white WiFi plug that is easy to get at Action, and it normally works through a cloud app. This project replaces the original firmware with your own, so the plug shows up in Apple Home as an outlet, and you switch it from the Home app or with Siri without any cloud in between.

It is one of the first plug projects of this site, started in June 2020. Later versions of the plug are in LSC Smart Plug Versions 1 and 2 and the ESP32 Smart Connect Plug.

High voltage

The plug connects to 230 V. Unplug it before you open it and never work on it while it is in a wall socket. Flash it with only the FTDI adapter connected, never with the mains connected at the same time. Solder only if you have some experience, and close the plug completely before it goes back into a wall socket.

The plug

The label on the back shows 220 to 240 V at 50/60 Hz, protection class IP20 and the model code YU M19d. It is meant for indoor use.

The back of the plug with its label: CE mark, IP20, 220-240 V and the model code YU M19d

Inside is a green board with a blue relay, a small power supply with a yellow transformer, and a blue WiFi module. The module is marked BM8 102, the markings of a TYWE2S, and esptool identifies the chip as an ESP8285 with embedded flash, which is an ESP8266 with the flash memory built in.

The opened plug: the green board with the plug pins beside the white housing
Side view of the board with the blue relay on top of the board
The blue TYWE2S WiFi module, marked BM8 102, on the board

Action has sold this plug in more than one hardware revision. Look at the module on your own board before you flash: this article describes the plug in the photos, with a TYWE2S module.

What it does

FeatureDetails
HomeKit outletOne outlet with a power switch
SwitchingOn and off only, no power measurement
UpdatesOver the air, with an Update Firmware switch in the accessory
No cloudControl stays on your own network
Two phone screenshots of the plug as an Outlet, first in the Home app and then in the Eve app with Power and Update Firmware switches

The Home app shows a note that the accessory is not certified. That is normal for a device you build yourself. Once the plug is in the app you can switch a lamp or appliance from anywhere in range, on a schedule or after a set time.

Connect the FTDI adapter

Flashing goes over the serial pins of the module with an FTDI adapter set to 3.3 V. The photos show wires soldered to the pads. Connect the module like this:

TYWE2S padFTDI adapter
3V3VCC (jumper on 3.3 V)
GNDGND
RXTXD
TXRXD
IO0GND, only while flashing

RX and TX cross over: the RX pad of the module goes to the transmit pin of the adapter. Connecting IO0 to GND puts the module in flash mode. Do not use the 5 V setting of the adapter, the module runs on 3.3 V.

Four wires soldered to the pads of the module on the open plug
The board with the four wires and a black jumper wire from IO0 to GND

Flash and install

Flash the bootloader files with esptool, with IO0 connected to GND:

esptool.py -p /dev/cu.usbserial-XXXX --baud 115200 write_flash -fs 1MB -fm dout -ff 40m 0x0 rboot.bin 0x1000 blank_config.bin 0x2000 otaboot.bin

Replace the port with the one of your adapter. esptool reports the chip as an ESP8285, writes the three files and resets the module. The files are the ones of Life Cycle Manager 2, which sets up the WiFi and installs the firmware over the air. Remove the wire from IO0 to GND, then join the LCM- WiFi network that the plug creates. The full steps, from installing esptool to pairing, are in ESP8266 HomeKit Blinds.

In the portal, use these values:

FieldValue
OTA repositoryAchimPieters/ESP8285-Power-Plug
OTA binary filemain.bin

When the installation is done, scan the QR code the device generates in the Home app to add the plug.

Firmware releases

VersionDateStage
0.0.13 June 2020Pre-alpha
0.0.63 June 2020Alpha
0.0.818 June 2020Beta
1.0.018 June 2020Release candidate
2.0.019 June 2020Release to manufacturing
3.7.017 January 2021Latest release

Every release has a main.bin of about 434 KB and a signature file, main.bin.sig. The table shows a selection of the versions. All releases are on the releases page of the repository.

Good to know

  • The HomeKit Accessory Protocol specification the firmware follows is the non-commercial version, for accessories you build yourself and do not distribute or sell.
  • The repository is under the MIT licence. It holds the releases and the photos, without source code.
  • Why open firmware is better than the cloud app is in Why You (Should or Shouldn’t) Buy a Smart Plug from Action.

The project is in the ESP8285-Power-Plug repository on GitHub.

Advertisement
All HomeKit

More HomeKit

Keep building.

Switches, sensors, plugs and blinds: more accessories that you build yourself and add to the Home app.

All HomeKit