How to use Tuya Convert to flash Tasmota to off-the-shelf smart home devices

Smart home device shelf at store

Flashing Tasmota used to involve the arduous process of soldering fine wires to microscopic contact pads and using a USB to serial programmer board. With the advent of a growing home automation community and the development of tools such as Tuya-convert and Tasmota, DIY smart home enthusiasts have been given the tools to cut the cord and ditch cloud services for their privacy and security issues.

All home automation devices on my network run open-source firmware that works locally without sending data to cloud services. Not only does this result in very low latency and fast response times, but it also stops companies from recording massive amounts of usage data for their benefit.

Smart home devices on shelf at the store (Australian Dollar Prices)

I’ve blogged before about how to Flash Tasmota firmware to Brilliant Smart bulbs with Tuya Convert, this post aims to simplify the process and remove the dependency on a Raspberry Pi.


Advertisement Begins

Advertisement End


Tuya Convert: This is a firmware flashing tool to hack common IoT devices such as light bulbs and power plugs. It tricks the IoT device into thinking the proprietary mobile app is talking to it. This works for tuya based devices. In all likelihood, your device will work. My light bulb was not on the support device list, but I managed to figure out how to write a custom template for it (see the end of this post).

Tasmota: This is excellent firmware for IoT devices. Some 20 devices on my network run on this firmware and it is very responsive and above all — reliable. I dabbled with ESPYaml in the past (post embedded below), but can no longer recommend it since the Tasmota firmware is much more stable, feature-rich and reliable. Not to mention, firmware upgrades can be handled in bulk using TasmoAdmin.

What you’ll need:

Brilliant Smart WiFi Plug with USB Charger (Model 20676/05) – Box on shelf
  • Access to a Linux machine or ability to boot to a Linux live iso (use Ventoy and copy the ISO file onto the thumb drive)
  • External Wifi USB dongle – must support access point (AP) mode. Cheap Wifi dongles cause problems.
  • A Tasmota-compatible device such as the one I am using or another device from their compatibility database

Most Brilliant devices use a compatible ESP8266 chip that can be easily flashed using Tuya Convert and compatibility increases as more devices are added by the community.

The “Brilliant Smart WiFi Plug with USB Charger (Model 20676/05)” pictured right is very affordable at AU$16 and features a built-in USB charging port, but it is bulky and does take up extra space on a power board.

Another model I personally use is “Brilliant Wifi Single Plug with Electricity Monitoring (Model 20925)”. It comes with power monitoring and it’s small form factor saves space. At AU$19 it is still a very good value.


Advertisement Begins

Advertisement End


Brilliant Wifi Single Plug with Electricity Monitoring (Model 20925)

Initial setup for Tuya Convert

Netgear A2610 Wifi USB Adaptor

Plug in a USB wifi dongle into your machine. I tried using the built-in wifi adapter on my laptop, but for some reason, Tuya Convert was unable to use it in access point mode. This is most likely because the Wifi chip in my laptop does not support AP mode. The USB Wifi dongle I am using is a refurbished Netgear A2610 Wifi USB Adaptor.

The video belows walks through the following steps:

  1. Download and extract the latest release of Tuya Convert
  2. Edit the config.txt file by updating the WLAN= line with the correct ID number of your wifi adapter. You can find this ID using the command sudo ifconfig
  3. Install dependencies by running the provided ./install_prereq.sh script

Start the flashing Process

The video below shows how to navigate the whole process from start to finish.

How to flash Tasmota using Tuya Convert (full process)
  1. Tuya Convert needs port 1883 and I’ve had issues with it. Better to stop it before starting the flash process.
  2. Start tuya-convert sudo bash ./start_flash.sh
  3. Accept the terms yes + ENTER
  4. On your phone, connect to trust-vflash network. This step is essential to trick the stock firmware into allowing the flash process.
  5. Activate setup/flash mode on your device (See next section below for Brilliant specific instructions)
  6. When device is in flash mode, tuya-convert will eventually connect to it and send a series of commands. Leave it alone until process is done.
  7. The device may restart multiple times, click on and off and the LED may change colour. Don’t interfere with this process. It’s confusing but perfectly normal.
  8. Tuya Convert automatically takes a backup of the stock firmware that came with your device.
  9. It prompts you for a firmware to install. Simply select Tasmota by typing 2 and then confirm by typing the letter y.
  10. The flashing process takes a few seconds and tuya-convert lets you know that it is done.
  11. You can flash another device or exit out of the program by typing y.

On the next page we will continue with activating flash mode on the smart plug.

Activating Flash Mode on Brilliant

Make sure your bulb is in set up mode (fast light flashing at 0.5s intervals). Check your manual for how to achieve this with your device. Below is a video showing the process (very easy if you know what to do).


Affiliate Content Start

Affiliate Content End


Brilliant Smart WiFi Plug with USB Charger (Model 20676/05)

  1. Plug in device
  2. Make sure the device is switched off (solid red led)
  3. Hold button until red LED blinks rapidly

Brilliant Wifi Single Plug with Electricity Monitoring (Model 20925)


Advertisement Begins

Advertisement End


Entering flash/setup mode on this particular device involved holding the button until Blue LED blinks rapidly

MY MISSION

This blog started nearly 10 years ago to help me document my technical adventures in home automation and various side projects. Since then, my audience has grown significantly thanks to readers like you.

While blog content can be incredibly valuable to visitors, it’s difficult for bloggers to capture any of that value – and we still have to work for a living too. There are many ways to support my efforts should you choose to do so:

Consider joining my newsletter or shouting a coffee to help with research, drafting, crafting and publishing of new content or the costs of web hosting.

It would mean the world if gave my Android App a go or left a 5-star review on Google Play. You may also participate in feature voting to shape the apps future.

Alternatively, leave the gift of feedback, visit my Etsy Store or share a post you liked with someone who may be interested. All helps spread the word.

BTC network: 32jWFfkMQQ6o4dJMpiWVdZzSwjRsSUMCk6

Smart Home Integration

Tasmota Setup

Once flashed, your device enters the normal Tasmota setup process. Connect to the wifi network starting with tasmota-* and go to 192.168.4.1 to enter your regular WiFi password.

Tasmota Backlog Command

The backlog command in Tasmota can be used to quickly setup a series of devices

Use the following Backlog command in Tasmota device Admin interface to configure the device. Leave Hostname %s as is, it will then take the MQTT topic as host name (in my case son_kitchen_bulb.)

Backlog Hostname %s; FriendlyName Kitchen Bulb; MqttHost serverbox; MqttUser sonoff_user; Topic son_kitchen_bulb;

Home Assistant Integration

All my Tasmota based LED lights are single-color, dimmable lights. The following mqtt light configuration should make this work well in Home Assistant.

- platform: mqtt
  name: Bedroom Light
  state_topic: "stat/son_bedroom_light/RESULT"
  command_topic: "cmnd/son_bedroom_light/POWER"
  state_value_template: ""
  brightness_state_topic: "stat/son_bedroom_light/RESULT"
  brightness_command_topic: "cmnd/son_bedroom_light/Dimmer"
  brightness_value_template: ""
  brightness_scale: 100
  payload_on: "ON"
  payload_off: "OFF"

Conclusion

Tasmota is my favourite home automation project. All my lights and switches have been setup with this firmware. Brilliant smart switches (due to their security flaws) are easy to flash with Tasmota.

Please help me keep this post updated by leaving a comment when instructions change.

Related posts

Troubleshooting Intermittent WiFi Issues: Solving “Host Unreachable, No IP Route” Error on Android and NUC Devices

How to Optimize Docker Builds with Nexus OSS for Apt, Maven, Docker and NPM Dependencies

Troubleshooting Asus Xonar U7: Blinking LED and Connectivity Issues

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Read More