Tasmota TuyaMCU Device Conversion - image 1
Tutorialintermediate

Tasmota TuyaMCU Device Conversion

Convert cloud-dependent Tuya WiFi devices to local-only control with Tasmota. Covers flashing, dpId mapping, and full control of dimmers, plugs, fans, thermostats, and RGB lights via MQTT.

Boards:ESP8266ESP8285
Firmware:Tasmota
Use Cases:Device ConversionLocal ControlHome AutomationSmart PlugDimmer Controlprivacy

Tasmota TuyaMCU Device Conversion

Convert commercial Tuya-based smart devices (plugs, dimmers, fans, RGB lights, thermostats) from cloud-dependent to fully local control using Tasmota's TuyaMCU module. No hardware modification needed for many devices — just a firmware flash.

Why This Project

  • Privacy — remove cloud dependency, all data stays local
  • No subscription — Tuya may charge for cloud services in the future
  • Faster — local MQTT is ~10ms vs cloud at 200-500ms
  • Automation — full MQTT control with Home Assistant rules
  • Works with thousands of commercial devices — any Tuya-based product

How TuyaMCU Works

Most Tuya smart devices have two chips:

  1. WiFi module (ESP8266/ESP8285) — handles connectivity
  2. MCU (secondary processor) — controls the hardware (relays, dimmers, motors)

Tasmota replaces the WiFi module firmware while the MCU firmware stays intact. The TuyaMCU module bridges serial communication between Tasmota and the original MCU.

Supported Device Types

  • Smart plugs (with/without power monitoring)
  • Dimmer switches (single, dual, triple)
  • RGB/RGBCW light bulbs
  • Ceiling fans with light
  • Curtain/blind motors
  • Thermostats (floor heating, boiler)
  • Humidifiers / dehumidifiers
  • Smart kettles
  • Air purifiers
  • Garage door openers

Step-by-Step Conversion

1. Flash Tasmota

Option A: Serial flashing (most reliable)

  • Open the device, locate the WiFi module (TYWE3S, CB2S, WB2S, etc.)
  • Connect FTDI adapter to UART pads (3.3V, GND, TX, RX, GPIO0→GND)
  • Flash tasmota.bin via Tasmotizer

Option B: Tuya-Convert (OTA, no soldering — may not work on newer devices)

  • Use tuya-convert on a Raspberry Pi
  • Device must be on firmware ≤2.5 (older devices only)

2. Configure TuyaMCU Module

# Set module type to TuyaMCU
Module 54

# Reboot — Tasmota starts communicating with the MCU

3. Map dpId Functions

Watch the Tasmota console for TYA: messages. The MCU sends data points (dpIds) every ~10 seconds:

# Example console output:
TYA: fnId=11 dpId=1 dpType=1 value=1    # Power ON/OFF
TYA: fnId=21 dpId=2 dpType=2 value=50   # Brightness 50%
TYA: fnId=0 dpId=3 dpType=2 value=255   # Color temperature

# Map functions:
TuyaMCU 11,1    # Relay1 ↔ dpId 1 (power)
TuyaMCU 21,2    # Dimmer ↔ dpId 2 (brightness)
TuyaMCU 0,3     # Unmap dpId 3 if not needed

4. Send Commands

# Boolean values (ON/OFF)
TuyaSend1 1,1   # dpId 1 = ON
TuyaSend1 1,0   # dpId 1 = OFF

# Integer values (dimmer, temperature)
TuyaSend2 2,80  # dpId 2 = 80 (brightness)

# String values
TuyaSend3 4,"abc123"

# Enum values
TuyaSend4 5,2   # dpId 5 = enum index 2

Common dpId Mappings

dpId Typical Function TuyaMCU Mapping
1 Power ON/OFF TuyaMCU 11,1 (Relay1)
2 Brightness TuyaMCU 21,2 (Dimmer)
3 Color temp TuyaMCU 0,3 or custom
4 RGB color TuyaMCU 0,4 or custom
5 Mode selector Enum via TuyaSend4
18 Current (mA) Power monitoring
19 Power (W) Power monitoring
20 Voltage (V) Power monitoring

Useful Tools

Compatible Devices

Almost any Tuya-based product with an ESP8266/ESP8285 WiFi module:

  • Devices with TYWE3S, TYWE2S, CB2S, WB2S, WB3S modules
  • Newer devices with CBU (BK7231) module require replacement with ESP-based module

Resources