TuyaMCU Devices - Tasmota (2022)

There are several Tuya dimmer and switch variants made by various manufacturers. The switches range from 1 to 8 gangs. The dimmers are usually 1 gang. They dim mains voltage for various lighting types: incandescent, CFL, and LED. Consult the specific device for the type of bulbs and capacity it supports as well as the bulbs themselves to verify they support dimming.

Identification and Technical details~

The basic identification of a Tuya device is when the device information references the "Tuya Smart", "SmartLife", or "Smart Living" app. These switches and dimmers are based on a Tuya TYWE3S Wi-Fi PCB module along with an MCU. TYWE3S is based on the ESP8266 which is supported by Tasmota.

Wiki page for TYWE3S

The TYWE3S module mostly takes care of Wi-Fi and software features while the MCU controls the actual hardware (buttons, relays, dimmer, power measurement, etc). The MCU is interfaced to TYWE3S using the serial interface which connects to the Rx and Tx pins.

The easiest way to identify if your switch or dimmer uses MCU is by using a continuity tester (multimeter, ohmmeter) and checking continuity from the Rx and Tx pins on TYWE3S to any other chip. Then check the datasheet of that chip to see if it is an MCU.

Flashing - Preparation~

To boot the TYWE3S in flashing mode, GPIO0 needs to be connected to GND while powering up. It can be left grounded for the entire process. Flashing a TYWE3S connected to a MCU is a bit trickier than one without MCU. This is due the same Rx Tx pins used by MCU and serial programmer for flashing. The TYWE3S cannot be booted to flash mode with MCU sending data over the same pins. To be able to do that, we need to disable MCU from sending data over Rx and Tx pins. There are few ways to do it:
1. Disconnect TYWE3S module from the rest of board. (Naah, too much work) 2. Just break the Rx track from MCU to TYWE3S, flash and then reconnect. (Messy work, we want cleaner approach) 3. Just keep MCU disabled while flashing TYWE3S without any soldering / cutting. (We like that)

The easiest is to keep MCU disabled is by identifying the NRST/RST (Reset) pin of the MCU from its datasheet and connect it to GND for the entire flashing process. This will keep MCU disabled while you flash TYWE3S. If there are some contacts or test points in switches that connect to the MCU, you might be lucky to find contacts for RST that you can easily solder onto.

TYWE3S Connection Options~

  1. 3D print a flashing Jig and use pogo pins to make nice and easy to use flashing jig
  2. Solder wires directly onto TYWE3S
  3. Use a jumper header like the one below and bend the pins to match VCC, Rx Tx GPIO0 and GND. You can just press the jumper header to the contacts during the flashing process

TuyaMCU Devices - Tasmota (1)

Flashing - Process~

Once you are done identifying the pins and ready to connect, BEFORE connecting USB to PC you need to connect them as follows:
NOTE : Use 3.3V NOT 5V

(Video) How to Setup a Tuya MCU Dimmer - Tasmota Tips Episode 4

TYWE3S Serial
Programmer
RX TX
TX RX
GPIO0 GND
GND GND
VCC 3.3V

If an MCU is present, bridge RST to GND on the MCU

Use a 6.6.0.10 Tasmota version or higher. There are lots of Tuya Serial fixes / features added in there and the tutorial below expects them.

Now you need to follow the commands explained in the flashing tutorial.

TIP: If you are using jumper headers use sleep 15 && before your commands, this would free your hand and give you some time to set the jumper pins and connect the USB to PC.

Configuration~

  1. Once Tasmota is flashed on the TYWE3S, just disconnect GND -> GPIO0 (and RST if there is an MCU), and power your device again from USB.
  2. On your PC, you should see a Wi-Fi network named sonoff-xxxx where xxxx is a number from the ESP's MAC address.
  3. Connect to it and go to 192.168.4.1 in your browser. Enter the Wi-Fi credentials for your network and click save.
  4. Connect your PC back to your network. Now you need to find the IP of newly connected Tasmota device. Refer to this very good video from SuperHouseTV (ignore flashing information) about configuring Tasmota.
  5. Once you get to the Tasmota configuration you need to select TuyaMCU module assign GPIO components as indicated below depending on your hardware. You already know the pin connections to the MCU.
GPIO Component
01 Tuya Rx (108)
03 Tuya Tx (107)
13 Tuya Rx (108)
15 Tuya Tx (107)
  1. If the device is connecting fine to your network, now is the time to power it down and re-assemble it. Connect a test bulb (or to the final place if you don't mind testing there)
  2. Once this is saved and device is rebooted. Open the Tasmota configuration page and you should be able to use the Toggle button to toggle the dimmer or at least one of the gangs in a multi gang switch.
  3. Follow the process here depending on switch or dimmer.

Otim Dimmer~

This Device is based on a Tuya Wi-Fi Module. Refer to "MCU Based Tuya Dimmers and Switches" for details.

TuyaMCU Devices - Tasmota (2) TuyaMCU Devices - Tasmota (3) TuyaMCU Devices - Tasmota (4) TuyaMCU Devices - Tasmota (5)

Flashing and Setup Video Guide

These devices use a Tuya TYWE3S Wi-Fi PCB module. Once the switch is carefully popped open you will need to remove the ribbon cables for flashing and ease of soldering. An easy soldering method is to take several Dupont style jumper wires, cut one end off, and apply a bit of solder to each stripped end. This will keep the wire flexible and prevent any circuit board pads from ripping off. Apply a bit of solder to each pad necessary to flash (double check your pin-outs). Once the wire and pad have solder simply put the two together and apply a bit of heat and they will join together.

TuyaMCU Devices - Tasmota (6) TuyaMCU Devices - Tasmota (7)

(Video) Tasmota 9.2 | TuyaMCU and ESP Futures & Live SwitchBot Kits Giveaway

Attach the GPIO0 wire to ground during initial boot to flash. You may need to also connect MCU RST to GND during initial boot to get it into programming mode as described here. A 3-pin header bridged together works great with GPIO0, GND and the GND from the USB flasher attached. (TX pin to RX pin and RX pin to TX pin on USB flash adapter). Verify that you are using 3.3volts to flash, NOT 5V!

Product Links:

Costco Charging Essentials~

This devices use a Tuya TYWE1S Wi-Fi PCB module. And it uses U1TX (GPIO15) and U1RX (GPIO13) to communicate between ESP8266 and MCU, no other GPIO is used in this device.

Flashing~

TuyaMCU Devices - Tasmota (8) TuyaMCU Devices - Tasmota (9)

The CE dimmer uses standard Tuya GPIO

Touch (EU and US) - Multiple manufacturers~

Flashing~

TuyaMCU Devices - Tasmota (10)

The procedure is similar to above, additionally NRST must be connected to GND during flashing.

Optional configuration (recommended)~

LedState 0 Only use the green LED for Wi-Fi/MQTT connectivity status.

Product Links:~

Zemismart Curtain Motor~

Curtain motors come in a confusing array. This one has a little Wi-Fi dongle, that looks like a USB stick. But it talks using 9600 8N1, not USB. This means we can unplug the Tuya Dongle and flash it without worrying about the PCI micro. Excellent.

(Video) Part 1 - How to Expand Tasmota/Sonoff Devices with the I2C Protocol - I²C

TuyaMCU Devices - Tasmota (11)

TuyaMCU Devices - Tasmota (12)

U1RX and U1TX, top right of the module are connected to the USB plug on D- and D+ respectively. This dongle uses a Tuya TYWE1S, which is an ESP8266 with 2MB flash. USB3 pin R- connects the onboard LED to the MCU via a 4k7 resistor. R+, T+, and T- are all unused and unconnected on the motor PCB, so I liberated them for soldering to GPIO0, U0RX and U0TX, to flash the chip.

TuyaMCU Devices - Tasmota (13)

  • short GPIO0 and flash Tasmota
  • Connect to your Wi-Fi and get MQTT and SSL working
  • change to TuyaMCU with module 54 (will reboot)
  • Switch from U0RX/TX to U1RX/TX with backlog gpio1 0; gpio3 0; gpio15 107; gpio13 108 (will reboot)
  • Treat DpId 0x65 as a Dimmer with tuyamcu 21,101
  • Allow the dimmer to get down to 1% with setoption69 0

And done. The curtain motor now presents as a Dimmer, with 100% full brightness = fully closed, and 0% full darkness = fully open.

The curtain motor also presents DpId 0x66 as a single event "Full Open" 00, "Full Close" 01, and "Stop" 02 command; but as of September 2019, I can't see how to get that working.

The curtain motor also presents DpId 0x67 as a Boolean. I have only seen value 0x01 in all my prodding. 55 aa 00 07 00 05 67 01 00 01 01 75 = 07 Status, 0005 length, 67 DpId, 01 type, 0001 length, 01 value, 75 checksum

Product Links:~

DM_WF_MDV4 Leading edge dimmer~

TuyaMCU Devices - Tasmota (14)

This is a 240V Leading Edge Dimmer with a TYWE3S controller and an STM8 MCU

(Video) Tuya Convert 2.3 Flash Tuya Smartlife Devices | No Soldering! | Remove the cloud | Custom Firmware

Flashing:~

The simplest approach is to use Tuya-Convert to flash the device

In order to flash via serial, the NRST pin of the STM8 needs to be grounded upon boot to disable it, this is brought out to a header pin, along with ground and VCC from the TYWE3S. Confirm by checking continuity with a multimeter

IO0 from the TYWE3s also needs to be grounded upon boot, otherwise it's normal tasmota flashing procedure.

Header J3 (STM8 debug interface) pins from left to right (Pin 1 is the square shaped) *VCC *STM8 SWIM (Pin 18) *Ground *STM8 NRST (Pin 4)

TuyaMCU Devices - Tasmota (15)

TuyaMCU Devices - Tasmota (16)

TuyaMCU Devices - Tasmota (17)

Config:~

As per main TuyaMCU page using

GPIO Component
01 Tuya Rx (108)
03 Tuya Tx (107)

Note that the push button is wired to the MCU (PA3 Pin 10) so it cannot be used by Tasmota. Similarlly the devices has a bi-color LED where one color (green) is wired to the TYWE3S (GPIO14) and the other one (red) to the MCU (PC5 Pin15).

(Video) STOP using Tuya! Transplant your ESP8266 100% LOCAL - Tuya-Convert F.0

More information:~

Bought from ebay

More information on TYWE3S]

Product Links:~

FAQs

How do I flash my Tuya device to Tasmota? ›

Download and install the Tuya-Convert Project
  1. Clone the Tuya-Convert project.
  2. 2.Navigate into the Folder.
  3. Install Prerequisites.
  4. Have your phone in handy to connect to the wifi that the script will create.
  5. Start the Flashing Process.
  6. Open a second window to monitor the logs.
May 21, 2020

What is Tuya MCU? ›

Tuya's MCU low-code connection service is mainly used to create smart products with MCU master control.

How do I convert to Tuya? ›

Run conversion

Plug in your Tuya device, and then put it into EZ Mode. Usually this is done by pressing the main “power” button on the device for at least 5 seconds, but some devices require you to turn its power on, off, on, off, on and then waiting a few seconds.

What can you do with Tasmota? ›

Tasmota allows you to configure and control any device that uses the ESP Wi-Fi chip. Here, we are using the ESP-01 chip and to control LED and read the DHT11 sensor. With it, we first have to configure Tasmota. For that, first click on the 'Configuration' button and then in the next step click on 'Configure Module.

Does Tuya use MQTT? ›

MQTT 3.1. 1 is widely used in IoT environments. Tuya IoT Development Platform supports MQTT 3.1.

Does Tuya use ESP8266? ›

TYWE3S is a low-power embedded Wi-Fi module that Tuya has developed. It consists of a highly integrated wireless RF chip (ESP8266), a few peripherals, an embedded Wi-Fi network protocol stack, and varied library functions.

What brands use Tuya? ›

What devices work with Smart Life / Tuya?
  • Teckin.
  • Gosund.
  • Avatar.
  • Digoo.
  • Novostella.
  • Treatlife.
  • Bakeey.
  • Nooie.
Mar 23, 2021

What is Tuya protocol? ›

Tuya Wi-Fi serial port protocol is a customized protocol for Wi-Fi modules. It is used for serial port communication between Tuya Wi-Fi modules and other MCU serial ports.

Why is Tuya not working? ›

Try uninstalling the APPS and reinstalling them. This is a common fix for the Tuya Apps – before uninstalling double check your username and password so you won't have issues reconnecting. Positivo works in South America and some places in the US but doesn't always connect to all Tuya devices.

How do I flash ESPHome with Tuya? ›

Flashing ESPHome
  1. Your device will provide an open access point with WiFi name tasmota - followed by 4 numbers. ...
  2. Open your browser, enter 192.168. ...
  3. Enter SSID and WiFi password of your home WiFi and confirm. ...
  4. If the access details were right, your bulb will connect to your local network.

How do you flash a WiFi light bulb? ›

Bulbs – physically switch the bulb on-off-on-off-on in semi quick succession. The bulb will start to flash quickly. Plugs – Using the wall switch, turn the plug on-off-on-off-on in semi quick succession. The LED on the button will begin to flash quickly.

Can Tasmota work without Internet? ›

Internet is the backbone of whole system connecting Sonoff devices and eWeLink iOS and Android apps together. It is not possible to control Sonoff without internet using the official firmware.

What does Tasmota stand for? ›

Tasmota actually means Theo-Arends-Sonoff-MQTT-OTA and thus immediately gives a hint about the developer and purpose of this firmware. What is the ESP8266 chip? The ESP8266 chip is used by many manufacturers for the development of devices that are operated in a smart network.

Is Tasmota open source? ›

TASMOTA is open source. This means that it is free software developed by a community of developers. Many smart home devices can use TASMOTA because they contain the ESP8266 chip.

Videos

1. Tasmota device configuration
(Real Smart Home)
2. 🔴 TASMOTA TUYA shutters / rollers - Arduino AC LINE detection
(GreenEyedExplorer)
3. Tuya Convert Not Working? NO Solder Jig | Flash Tasmota & ESPHome
(digiblurDIY)
4. WiFi Dimmer Switch with Tasmota - Local MQTT Control
(digiblurDIY)
5. CP2102 Magic? No mods, no soldering | Flash the ESP8266 TuyaMCU Dimmer
(digiblurDIY)
6. Treatlife DS01 Smart Dimmer Tasmota Convert
(Home Design)

Top Articles

You might also like

Latest Posts

Article information

Author: Fr. Dewey Fisher

Last Updated: 10/28/2022

Views: 6171

Rating: 4.1 / 5 (62 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Fr. Dewey Fisher

Birthday: 1993-03-26

Address: 917 Hyun Views, Rogahnmouth, KY 91013-8827

Phone: +5938540192553

Job: Administration Developer

Hobby: Embroidery, Horseback riding, Juggling, Urban exploration, Skiing, Cycling, Handball

Introduction: My name is Fr. Dewey Fisher, I am a powerful, open, faithful, combative, spotless, faithful, fair person who loves writing and wants to share my knowledge and understanding with you.