How to use Tuya Home Assistant Integration

This topic describes how to use the new version of the Tuya Home Assistant integration.
In this tutorial, we will show you how to install the Tuya official Home Assistant integration and control smart devices.

You have created a cloud project of Smart Home PaaS type on the Tuya IoT Platform, added at least one device or one virtual device, and authorized your project to use related smart home APIs. For more information, see Tuya IoT Platform Configuration Guide Using Smart Home PaaS.

Note:If your cloud project of Smart Home PaaS type is created before May 25, 2021, you need to migrate to a new project. For more information, see Migrate from old project.

You have installed Python 3.8 (including the package python3-dev) or later.

Procedure

Install Home Assistant Core and copy the Tuya Home Assistant Integration to the Home Assistant configuration directory.

Install Home Assistant Core

See Home Assistant Official Installation Guide to install Home Assistant Core.

Install Tuya Home Assistant integration

Note: The new version of Tuya Home Assistant integration (Tuya v2) can be compatible with the old version. Both versions can be installed at the same time. You don’t need to uninstall the old version before installing the new version.

Option 1: Copy method

Download the tuya-home-assistant repo.
Unzip it and copy the custom_components/tuya/ folder to the Home Assistant configuration directory, for example, ~/.homeassistant.

Option 2: HACS installation

See HACS Official Installation Guide and install HACS.

See Initial Configuration Guide and complete initial configuration.

Enter GitHub - tuya/tuya-home-assistant: Home Assistant custom integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, officially maintained by the Tuya Developer Team. in the address bar at the bottom left of the window. Select Integration from the Category list and click ADD.

In the dialog box that appears, click INSTALL.

Configure Home Assistant

Open a browser, enter localhost:8123 in the address bar, and press Enter.

Create an account and log in.

Select Configuration > Integrations.

Navigate to the Integrations tab, and click ADD INTEGRATION.

Search for and install the Tuya v2.

In the Tuya Integration window, select Smart Home PaaS.

Complete Tuya credential. Check out the table below and enter each item.

Note: The app mentioned in the table must be the one you used to link devices on the Tuya IoT Platform.

Click SUBMIT.
On the Overview page, you can find and control the devices and virtual devices of your cloud project on the Tuya IoT Platform.