Flashing Tuya/Smart Life based RGBW bulbs to use in Home Assistant

by Andrew Calcutt last modified 2019-12-08T22:14:42+00:00
This guide is a reference to install the 'Tasmota' firwmware on your smart life smart bulb to allow use in Home Assistant (freeing it from some unknown cloud)

References

Flashing the bulb with tasmota firmware

  1. Boot into kali linux (I used 'kali-linux-2019.4-amd64.iso' on a Dell E6430 for this, which had a supported wireless card out of the box)
  2. In kali, Connect to a wifi connection with internet access
  3. Open a shell and download tuya-convert with the following commands
    1. git clone https://github.com/ct-Open-Source/tuya-convert
    2. cd tuya-convert
    3. ./install_prereq.sh
  4. Disconnect from the wifi connection with internet
  5. Update your bulbs firmware
    1. ./start_flash.sh
    2. The script requests that you connect something (anything) to the 'vtrust-flash' ap before starting the flash. I connected to this with my cell phone during the flash only.
    3. The script makes you put the bulb into fast blinking mode. In my bulbs case, this means your turn the light on and off 3 times, then it starts blinking.
    4. The script asks what firmware you want, I selected '2.) flash tasmota'
    5. The flash should tell you it has completed, read carefully in case there are some extra steps (mine did not have any but I read some devices do)
  6. Connect directly to the new bulb wifi access point, it should be called 'tasmota-xxxx'
  7. Configure the bulbs wifi network, by going to 192.168.4.1 in your web browser.
    1. In the bulb configuration, scan for your wifi network (don't type it in).
    2. Make sure you get the password correct. I have not done it yet, but i read if you put wrong info here, you could be locked out of the device, so make sure it is right.
    3. In the bottom field, give the device a easy to find name, since this should show up in your DHCP server when you look for it later.
    4. After saving the settings, the device will restart and connect to the wifi network you set. You will no longer see the 'tasmota-xxxx' network.
  8. Find the new devices IP in your DHCP server. it should have whatever name you set in the previous step. You will then browse to this IP in your web browser
  9. At the bulb config page, choose the 'Firmware Upgrade' button, set the OTA Url (I left this default), and click 'Start Upgrade'. The bulb will install a firmware update and reboot (takes about a minute)
  10. Once the bulb reboots, you can set its configuration options. A good place to look for a configuration is the 'Tasmota Device Templates Repository'. For my devices i did the following.
    1. Go to 'Configuration --> Configuration Other'
      1. Set your device Template string, for my devices I used the fowllowing
  • After settings up the configuration, you should now be able to control your light from the main page when you go to the lights IP. Verify the colors in the interface match what the light is showing, otherwise you may need to tweak your configuration at 'Configuration --> Configuration Template'
  • You bulb is now flashed and ready to go, the next step will be to set up 'Configuration --> Configuration MQTT', so it can be controlled by Home Assistant(Hass.io)
  •  

    Set up bulb for Home Assistant Auto Discovery 

    1. On your Home Assistant Server, set up MQTT. I used this helpful youtube video  ( How to Configure Tasmota with Home Assistant - Auto Discovery and Legacy - Tasmota Tips Episode 2 )
      1. Go to 'Hass.io', 'Add-on store' and install mosquitto broker
      2. Under the mosquitto broker page, set up the login information in the config, use the example shown here ( https://www.home-assistant.io/addons/mosquitto/ )
        1. "logins": [ {"username": "local-user", "password": "mypw"} ],
        2. Once this is set the mosquitto add-on can be started.
      3. Configure Home Assistant to use the new MQTT broker just created
        1. Go to 'Configuration -> Integrations' and you should see a MQTT configure button.
        2. Cleck 'Enable Discovery', then click submit.
    2. Set up your bulb to connect to your new Home Assistant Server MQTT Broker
      1. Go to your bulbs ip address in a browser.
      2. 'Configuration --> Configuration MQTT'
        1. Host [Your MQTT Server, same as the Home Assitant server IP]
          Port [1883]
          User [Username set up in MQTT config]
          Password [Username set up in MQTT config]
          Client and Topic can be left default, but I usually set them to something identifiable.

      3. Go back to the main page and select console, and look for the following (If you do not see this, restart the light and look again)
        1. 20:30:59 MQT: Attempting connection...
          20:30:59 MQT: Connected

        2. If you see connected, your MQTT is working
      4. enable 'Home Assistant automatic discovery'
        1. Go back to the bulb main page and select 'Console'
        2. Enter 'SetOption19 1' and hit enter
        3. Home Assistant automatic discovery should now be enabled, you home assistant should now detect the new devices

     

     

     

    Document Actions