20 Sep 2019
Tasmota 'Smart Plug' Reflashing With 'tuya-convert' (2018)
Tasmota is an open source firmware for ESP8266-based (so, WiFi-enabled) “smart” devices, such as smart plugs, bulbs, power strips, etc.
2022 Note: This process (using
tuya-convert) no longer works with many types of cheap Chinese-import smart plugs, because they use a different SoC.
Opening them up and soldering them is usually required to reflash.
(Or you can just buy ones pre-loaded with Tasmota and save yourself the trouble. They are much easier to get in 2022 than in 2018 and the price premium over crappy manufacturer firmware is smaller.) However, if you have older devices that were previously flashed to Tasmota with
tuya-convert, I found that the Tasmota online upgrade process worked well, as long as I followed the instructions.
My plugs are marked model “YM-WS-1” with no obvious brand.
They are round, about 2 inches in diameter, with a single push-button on the side. They don’t look like they’d be especially easy to open up.
Instructional video that I followed: https://www.youtube.com/watch?v=O5GYh470m5k
- A Raspberry Pi with Ethernet and WiFi (so, not a Pi Zero)
- SD card and USB adapter
- Cheap Chinese generic WiFi smart plug
- Flash Raspbian Lite to the card
touch sshon the /boot partition to enable SSH access
- Insert card, connect RPi to Ethernet and power, determine IP address from DHCP
- SSH into the RPi
- Resize to take advantage of entire card
sudo apt update && sudo apt upgrade
sudo apt install network-manager
sudo apt install git
git clone https://github.com/ct-Open-Source/tuya-convert
- Accept disclaimer / warning
- IF YOU GET “unknown log file” error… instructions in video at 7m04s on editing the script
- Connect to the emitted Wifi network (trust-flash?) with a phone or other device—this is important or the process won’t work
- Follow prompts — Put the device into Wifi pairing mode by pressing and holding primary button for 5s
curl http://10.42.42.42/flash3to continue to flash custom firmware (Sonoff-Tasmota)
- Connect to Sonoff Wifi network and set up per documentation
- In “Other Configuration” enable single-device Belkin emulation in order to allow control from Amazon Alexa and/or Google Home
Template to use:
This can be copied and pasted into the “Other Parameters” configuration pane.