Home Assistant, ESP Home and tuya-convert

Most people seem to flash a Tuya based device with Tasmota however, I invested in ESP Home early back when I set my garage controller. I completed the following on a Ubuntu 20.04 install on a HP laptop after I found a compatible wireless card by pulling apart old laptops 😁

Install Tuya-Convert

First step is to install tuya-convert. detailed instructions can be found here: Tuya Convert

Crash course guide below:

# git clone https://github.com/ct-Open-Source/tuya-convert
# cd tuya-convert
# ./install_prereq.sh

After install pre-reqs I suggest checking your WIFI interface name, I spent some time sorting this out leading me down a rabbit hole to change WIFI interface name when all I had to do was change the settings in the config.txt file. Change the part that says wlan0 to the name of your interface. If you need to find the interface name you can type ifconfig in the terminal.

Create ESP home bin file

I created a basic a basic image file in ESP Home, My requirements were for lightbulbs by Arlec but should work with most similar style device

  • Node Name: Describe location or device
  • Device Type: Left as generic
  • Wifi & Updates: Added my network info

My Config including light information ended up like the below

esphome:
  name: "master_bedroom_light"
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "!SSID"
  password: "!password"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Masterbl Fallback Hotspot"
    password: "!wificode"

logger:

api:

ota:

output:
  - platform: esp8266_pwm
    id: output_warm_white
    pin: GPIO13
  - platform: esp8266_pwm
    id: output_daylight
    pin: GPIO5

light:
  - platform: cwww
    name: "Master Bedroom Light"
    id: garagelight
    cold_white: output_daylight
    warm_white: output_warm_white
    cold_white_color_temperature: 6500 K
    warm_white_color_temperature: 2700 K

    # Ensure the light turns on by default if the physical switch is actuated.
    restore_mode: ALWAYS_ON

I then Compiled the file and downloaded the bin file. I placed the bin file in the tuya-convert/files/ directory with the other bin files.

Run Install and flash

For light bulbs that have been configured already turn them off and on 4 or 5 times until the light starts blinking.

run the start_flash.sh in the tuya-convert folder

./start_flash.sh

Allow the install to close any services required and once the WIFI point has been created connect with your mobile device.

Select your bin file you created when it is listed.

Once the flash has been completed check your ESP Home in home assistant to see if the light / device has connected.

Happy Flashing

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.