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" 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 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!

17 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”

  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

  5. 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.

  6. 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

  7. Winston, I also purchased the Tessan dimmers and am getting weird behavior using the settings. I found the “Forked” firmware you mention but I suspect it can’t be installed by simply DL it and using the update feature. I get an “Upload Failed Magic Byte is not 0xe9” error. Can you explain how the forked bin is applied? My wife is also giving me the stink-eye : )

  8. This is a great article and has helped me get going. I’ve been attempting to configure a rebranded Tuya switch from an Australian reseller – its branded as a “Kogan” switch (the name of the reseller).

    I’ve got to the stage where I’m trying out a number of the configurations from the database, with some parts of the device working, but not all of it yet. A labour intensive process. In these trial-and-error attempts I seem to have got the switch into a bad state. It is connected to the WiFi (I can ping it) but the web interface hasn’t restarted so I can’t reconfigure it.

    Any ideas on how to recover?

    Thanks for the great help so far.

  9. No magic formula for getting them back into working shape, sometimes you can hold down a button during power on. Do you know what change caused it to brick?

  10. Arghhhh…. I entered the wrong password of my SSID in the initial setup…. Now, device cannot connect to the wifi… Any suggestion to help me (out of soldering pin in this ultra small plug)?

  11. If you have another router you can create a network with the same SSID and no password (open network) and connect your plug to it, then you can log into your plug and change to the correct password. Make sure to do this somewhere other than inside your existing wifi network or you could screw some stuff up.

  12. HELP:
    With a WP3 from GoSund I have having problems putting it into pairing mode. Not sure what the issue is. I have also had some difficulty with getting the Tuya Convert to hold the wifi Signal.
    Has anyone had similar challenges?
    Using Raspberry Pi 3B+ with clean version of Raspbian Stretch Lite.
    SSH from a windows 10 Tablet on Putty
    Iphone 10 to capture the

  13. Hi! What about curtain Tuya? Is the procedure the same? Have you tried to flash it?

  14. I have mine flashed, yes, but I feel like my configuration is totally overcomplicated for it, I need to find time to do it better, but it’s at the bottom of my list since my solution is working fine.

  15. I am curious… why does the raspberry pi model B+ require a USB wifi dongle and Kali Linux? Why won’t Raspbian Stretch and the onboard wifi chip work?
    I would prefer to get a better machine (kinda want the 4, in all honesty), but I don’t want it to be harder just to get the newer hardware.

Leave a Reply

Your email address will not be published.