Saturday 1 February 2020

Tuya smart devices

Over the past year, I have collected a number of smart home devices, the majority of which are based on the Tuya platform.
Here is some of what I have learnt about these devices.
  1. The apps are all compatible.
    If you buy a new device, it is worth checking whether it works with the app you already have installed before installing yet another brand specific app on your phone.
  2. The features are defined by the device, not the app.
    I bought two heaters, the first branded by Kogan, the second by Goldair. The Kogan heater had full automation enabled, the Goldair heater app worked only as a remote control and for setting simple off/on timers. On seeing that the apps had identical UIs apart from color scheme and available features, i thought to try the Goldair heater with the Kogan app. It worked, but the Goldair heater was still unavailable in the automation UI, and interestingly, the Goldair color scheme was still used to display the Goldair heater.
  3. Tuya also publishes their own brand app.
    I ended up switching away from the brands own app on the assumption that Tuya's own app should have the full feature set (the Goldair one was missing the automation UI completely, though I never tried using the Kogan heater with it, so it may have just been hidden due to no paired devices supporting it). It also gets updates before the branded apps, but from what I saw during the few months I kept multiple apps installed, it is only a couple of weeks ahead at most.
  4. Local control is possible
    A big issue if you are concerned about privacy and security is that Smart Home devices typically send data through the cloud rather than directly from your phone to the device. In the case of Tuya, the connection is going via Amazon servers in the US, Europe, or Tencent servers in China, which is collecting data your device is sending in order to show you graphs of usage over time. If you have a home automation server like openHAB or Home Assistant on your local network though, you can send commands directly to the device. If you firewall the tuya servers so the devices cannot send data to them, this can give you a completely offline solution. A better way to go completely offline is to reflash the devices with open source firmware such as Tasmota or ESPHome. Many of the Tuya devices are based on ESP8266 or ESP8285 modules, which are easily reflashable, even without opening any devices up by subverting the Tuya OTA capability. For simple devices such as Smart Plugs, Lightbulbs and switches, there is good support in the open source firmware, and you can likely find some simple instructions to follow. I have successfully flashed my Kogan Smart Plugs to ESPHome using tuya-convert, keeping all of their original functionality. I also tweaked the status LED to show whether any significant current had been drawn since it was last switched on, as mostly my smartplugs are connected to heaters with their own thermostat, so I can see easily whether the heater has actually been running or not from the LED.
    For more complex devices, you'll most likely need to do some research or investigation to understand how the device works first. Some Tuya modules are based on RTL8710 microcontrollers, which do not have as many options as ESP8266 devices for reflashing. Another potential issue you'll want to avoid is that many of the more complex devices connect to a separate microcontroller through a UART on the ESP8266, but default ESPHome configurations configure that UART as a debug logging port, which can lead to a bricked device needing serial flashing to recover if you take a simple ESPHome configuration to start, thinking you can reflash it as you learn about the details of your device.
Following this general post, I'll make a few device specific posts to give anyone with the same devices some guidance if they want to follow the same path.

No comments: