Tuya Convert Walk Through – February 2019

1. Before you begin you'll need:

  1. One of the Linux machines listed below:
    1. A raspberry pi model B with the latest version of Raspbian Stretch Lite (Recommended Method).
    2. A raspberry pi model B+ with a USB wifi dongle and Kali Linux.
  2. A micro SD Card for your raspberry pi (at least 2gb, 8+ recommended).
  3. A wifi device that can connect to the SSID that will be generated by the raspberry pi and eventually the flashed tuya device.  This cannot be an iOS device, android devices will work.

2, Installing the OS on raspberry pi:

  1. Download and install Etcher
  2. Plug your microSD card into your PC using a microSD adapter
  3. Start Etcher.
  4. Select the disk image you downloaded and your microSD card from the etcher interface.
  5. Press Flash and wait.
  6. Add a blank file called "ssh" to the root of the raspberry pi to enable the SSH service on raspbian.
  7. Plug the SD card into your raspberry pi, connect power and ethernet and boot it up.

3. Connecting to your raspberry pi via SSH:

  1. Download and install Putty
  2. Start Putty.
  3. Enter the IP address of your raspberry pi in the box that says "Host Name".  I recommend using an app like Fing to find the IP address of your raspberry pi.
  4. In the "Saved Sessions" input box, name your raspberry pi connection and then press "save".
  5. Select your new saved session.
  6. Press "Open"

4. Setting up your Pi and updating the OS

  1. In the putty window login with user "pi" and password "raspberry"
  2. Expand the file system by typing "sudo raspi-config" then selecting "Advanced Options" and then "Expand Filesystem", select "Finish" and then select "Yes" when it asks to reboot.
  3. Reconnect via putty using your saved session and login with username "pi" and password "raspberry" again.
  4. Type "sudo apt-get update" and wait for the updates to install
  5. Type "sudo apt-get dist-upgrade" and wait for the upgrades to install
    1. You may get a prompt for permission, just type "y" and press enter.
  6. Type "sudo apt-get install network-manager" and wait for it to install.
  7. Type "sudo apt install git" and wait for it to install.

5. Setup and Install Tuya-Convert

  1. In the putty window type "git clone https://github.com/ct-Open-Source/tuya-convert" press enter and wait.
  2. Type "cd tuya-convert" and press enter.
  3. Type "./install_prereq.sh" and wait.

6. Use Tuya-Convert to install Tasmota

  1. Type "cd tuya-convert" and press enter.
  2. Type "./start_flash.sh".
  3. Types "yes" and press enter.
  4. Connect your separate WiFi device to the "vtrust-flash" SSID that is being broadcast by your Raspberry Pi. The Password is "flashmeifyoucan".
  5. Plug in your Tuya plug, switch, dimmer, or bulb and put into pairing mode.
    1. Different models are put into pairing mode via different methods, check the curated product pages for information for putting your device in pairing mode.  The LED should flash rapidly if done successfully.
  6. Press enter on your putty window to start the flash process and wait.
  7. Once the process completes you can type " curl http://10.42.42.42/flash3" to install tasmota, or look at the other options available.

7. Setup Tasmota

  1. On your secondary device, disconnect from vtrust-flash and connect to the new SSID called "sonoff-XXXX"
  2. Open 192.168.4.1 in your browser and enter your WiFi's SSID and password.
  3. Use Fing to find your new device on your WiFi network, it should be called "Sonoff-XXXX"
  4. Open the IP address of your new device in a browser.
  5. If using MQTT:
    1. Click "configuration"
    2. Click "configure MQTT"
    3. Enter your MQTT information
  6. If not using MQTT:
    1. Click "Console"
    2. Type "setoption3 0"
  7. To get the best compatability with Tuya products you should update to the most recent version of Tasmota.
    1. From the main tasmota screen click "Firmware Upgrade"
    2. In the top box change the URL to "http://thehackbox.org/tasmota/sonoff.bin"
    3. Press "Start Upgrade"
  8. Update the name of your device under "Configure Other" and then "Friendly Name"

7. Configure your specific device

  1. On the main tasmota screen click "Configuration".
  2. Click "Configure Module"
  3. Consult the list of known devices to input the correct GPIO pins and chips for your device.
  4. Press "Save" and enjoy!

7 thoughts on “Tuya Convert Walk Through – February 2019”

  1. Love the channel and this article. Some thoughts:

    “Step 2, 4. Select the disk image you downloaded ” That’s the first time you mention disk image. Maybe you could break that out in 1.1

    “Putty” Why complicate things? It’s easier to open a command window and type “ssh pi@192.168.x.x”

    1. he’s referring to 1.1.1A and 1.1.1B – either download rasbian stretch lite or kali on the links provided and use etcher to write them onto the sdcard.

      ssh in windows wasn’t a default thing until Windows 10 in 2018. the terminal emulation isn’t perfect and PuTTY will probably still be a popular option for many.

  2. I don’t really get the point, just reflash any 8266 with any software, using an FTDI interface. What’s so special about tuya convert?
    I am sure it’s me, but I don’t get it

  3. I went to add a T.Y.D. Smart Plug to the Tuya database, but GPIO13 needs to be set to “Button1”. But there No Buttons in the dropdown selection..

  4. Great, I was waiting this kind of ota flash from a long.
    I bought a teckin and a blitzwolf plugs about a year ago and I was nearly conviced to open them to solder cables to flash… but I’m not so good in soldering so you save me. Now I will bought a lot of them (they’re very cheap, about 10€ each) instead if buying some sonoff pow or shelly plug s.
    Your job is very helpful, thank you very much.
    Greetings from Italy
    Giancarlo

  5. Thank you so much for this walk through! I purchased a pair of the Tessan dimmers, and successfully flashed them over the air using tuya-convert and your instructions. I wasn’t successful in using your module and rule settings however. The new overall behavior of the dimmer switch did not make my wife happy. Fortunately, I dug through digiblur’s channel and found his github page. I found that his forked firmware of Tasmota contains the MJ (Martin Jerry) Dimmer module that works perfectly with the Tessan dimmers, bringing my dimmers to their original behavior. Thanks to your’s and digiblur’s work, I now have complete local control of my Tessan dimmers.

    Here’s digiblur’s firmwares: https://github.com/digiblur/Sonoff-Tasmota/tree/development/bins

Leave a Reply

Your email address will not be published. Required fields are marked *