Skip to main content
Device Type:dimmer
Electrical Standard:ukeu
Board:rtl87xx
Difficulty:Soldering required (4/5)

Ledkia LED Cord DIMMER Switch

Ledkia LED Cord DIMMER Switch

"The Smart Wi-Fi dimmer is powered by Tuya platform with excellent compatibility to most Dimmable LED lamps also works pefectly with halogen or eclectronic transformer and incandescent lighting. Possibiliity of wireless voice control via Alexa or Google home."

Also known as C152547 WIFI LED Cord Dimmer is a dimmer based on Tuya, with 2 microcontrollers. The dimmer side is controlled by stm microcontroller (Tuya MCU), and the Wi-Fi functionality by a Tuya WR3 module.

Specs

DescriptionValue
Rated input voltage220-240 Vac, 50Hz
Power range5-50VA @ 220-240V LED
Power range10-100W @ 220-240 INC, HAL
Type of loadLED retrofit-Incandescent-halogen
Dimming MethodRotary
Ambient temperature35°C
Cables section0.75 mm²
Dimension96.7mm X 24.9mm X 39.4mm
Item weight41g

Original paperwork

Ledkia LED Cord DIMMER Switch

Pinout

Ledkia LED Cord DIMMER Switch Ledkia LED Cord DIMMER Switch

PinFunction
GNDGround connection
3V33.3V input for powering the controller
TX0Transmit pin connected to the Tuya MCU
RX0Receive pin connected to the Tuya MCU
TX2Transmit pin used for flashing/programming
RX2Receive pin used for flashing/programming

Prerequisites

Ledkia LED Cord DIMMER Switch

  • Connect your serial programming adapter to the WR3 module as follows:

    • GND → GND

    • 3V3 → 3V3

    • RX → TX2 (TX in image)

    • TX → RX2 (RX in image)

      Refer to the image above for the pinout layout.

  • If you haven’t already, download ltchiptool, a command-line utility for flashing and dumping firmware.
    Note: The standard ESP flasher is not compatible with this device.

Flashing

IMPORTANT NOTE

BY NO MEANS SHOULD THE DEVICE BE CONNECTED TO THE MAINS WHILE FLASHING OR DEALING WITH THE DEVICE. RISK OF INJURY OR DEATH, AT MINIMUM YOU WILL FRY YOUR PC IF YOU TRY TO FLASH WHILE THE MAINS IS CONNECTED.

Before flashing or dumping firmware, the device must be placed in download mode:

  1. Short TX2 to GND.
  2. Power on the device by connecting 3.3V:
    • the 3.3V and GND lines to an adjustable power supply, or the serial adapter.
  3. Connect the programming adapter to your PC.

    ltchiptool will prompt you later to disconnect TX2 from GND.

Note: As an alternative to disconnecting and reconnecting power, you can also power cycle the device by shorting the EN pin to GND

Backing up the original firmware

Before flashing ESPHome, it’s highly recommended to back up the original firmware in case you want to restore the stock tuya functionality later. Run:

ltchiptool flash read realtek-ambz lcds_backup.uf2

After issuing the command, disconnect TX2 from GND to begin the backup process.

Flashing ESPHome

  1. In the ESPHome device builder, after configuring your firmware, select: Install > Manual download, then click UF2 package to download the compiled binary.
  2. Put the device back into download mode (short TX2 to GND, then power on).
  3. Flash the new firmware using:
ltchiptool flash write realtek-ambz firmware.uf2

Basic configuration

esphome:
name: Ledkia-LED-Cord-DIMMER
friendly_name: Ledkia LED Cord DIMMER Switch

rtl87xx:
board: wr3

# Enable logging
logger:

uart:
rx_pin: RX0
tx_pin: TX0
baud_rate: 9600

tuya:

# Create a light using the dimmer
light:
- platform: "tuya"
name: "Dimmer"
dimmer_datapoint: 3
min_value_datapoint: 2
switch_datapoint: 1
max_value: 1000

# Enable Home Assistant API
api:
encryption:
key: !secret api_key

ota:
- platform: esphome

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Dimmer Fallback Hotspot"
password: !secret fallback_wifi_password

captive_portal: