English
English
简体中文
Contact Us
Register
Log In
Language
English
English
简体中文
Contact Us
Log In
Register
Go to main website
App Develop

App Development

Tuya provides multiple mobile app development methods such as no-code or IoT App SDK development to maximize the monetization of IoT apps.
layoutIndex
DocumentationCloud DevelopmentBest PracticeIntegrating Home Assistant & HomebridgeHow to Set Up Tuya Integration (Stable) in Home Assistant

How to Set Up Tuya Integration (Stable) in Home Assistant

Last Updated on : 2021-11-24 11:22:54download

This topic describes how to install and use the official Tuya integration in Home Assistant.

Prerequisites

Set up

After you have installed Home Assistant Core, you can search for and set up the Tuya integration in Home Assistant.

Only Home Assistant 2021.10.4 and later versions support the official Tuya integration.
How to Set Up Tuya Integration (Stable) in Home Assistant

  1. Enter localhost:8123 into the address bar in your browser and hit Enter to connect to Home Assistant.

  2. Register and log in.

  3. Click Configuration > Integrations.

    How to Set Up Tuya Integration (Stable) in Home Assistant
  4. On the Integrations page in the configurations panel, click the + button in the lower right and search for Tuya.
    How to Set Up Tuya Integration (Stable) in Home Assistant

  5. Select Tuya and set up the integration.

    How to Set Up Tuya Integration (Stable) in Home Assistant
  6. Enter your Tuya credentials.

    How to Set Up Tuya Integration (Stable) in Home Assistant

    Fields Description
    Country Select the region of your account of the Tuya Smart app or Smart Life app.
    Note: Open the mobile app you use and tap Me > Setting > Account and Security > Region.
    Tuya IoT Access ID and Tuya IoT Access Secret Go to the Tuya IoT Development Platform and select your cloud project. Click the Overview tab and find the Access ID and Access Secret in the Authorization Key area.
    Account Your account of the Tuya Smart app or Smart Life app.
    Password Your password for the Tuya Smart app or Smart Life app.

    The mobile app mentioned in the above table must be the one you use to scan the QR code for linking devices to your cloud project on the Tuya IoT Development Platform.

  7. Click Submit.

    Click Overview in the sidebar on the left. You will find all the smart devices linked to your cloud project created on the Tuya IoT Development Platform.

    How to Set Up Tuya Integration (Stable) in Home Assistant

FAQs



I got an error saying ‘Config flow could not be loaded’ when setting up the Tuya integration. How to fix it?

How to Set Up Tuya Integration (Stable) in Home Assistant

Go to custom_components under the Home Assistant directory and delete the tuya_v2 folder. Restart Home Assistant and try installing the integration again.

How to Set Up Tuya Integration (Stable) in Home Assistant



I got an error shown in the following screenshot when I tried to scan a QR code to link my devices to my cloud project. How to fix it?

How to Set Up Tuya Integration (Stable) in Home Assistant

This is because the data center you selected for your cloud project cannot serve the region of your app account. You must switch to the correct data center and scan the QR code again.

  1. Here is how to find the region: open the mobile app you use and tap Me > Setting > Account and Security > Region.

    How to Set Up Tuya Integration (Stable) in Home Assistant
  2. See Mappings Between OEM App Accounts and Data Centers and find the data center that can serve your region.

  3. (Optional) If you do not find the data center you want to use, click the Overview tab and then Edit to add data centers.

    How to Set Up Tuya Integration (Stable) in Home Assistant
  4. Click the Devices tab > Link Tuya App Account. Select the correct data center from the drop-down menu in the top right corner and click Add App Account.

    How to Set Up Tuya Integration (Stable) in Home Assistant

  5. Scan the QR code again to link devices.



Will I be billed after the free trial of the API service expires?

  • After your API service expires, go to Cloud > My Services on the Tuya IoT Development Platform to request extending your API service by up to 6 months.

    1. Click Extend Trial Period.

      How to Set Up Tuya Integration (Stable) in Home Assistant
    2. Complete this form.

      How to Set Up Tuya Integration (Stable) in Home Assistant
    3. You will get the result within one working day.

      How to Set Up Tuya Integration (Stable) in Home Assistant
  • The Trial Edition allows you to use all free API services but puts limits on the quota of API calls. For more information about the quota, see Pricing.

How to deal with the following errors?

Error code sample:

[tuya-openapi] Response: {
  "code": 2406,
  "msg": "skill id invalid",
  "success": false,
  "t": 1624477851701
}

Error code Message Troubleshooting
1004 sign invalid The Access ID and Access Secret you entered are not correct. For more information, see Credentials Configuration.
1106 permission deny
  • Your app account is not linked to your cloud project. This operation is a must-do. For more information, see Link devices by app account.
  • Incorrect account or password. You must enter the account and password of the mobile app that you use to scan the QR code for linking devices to your cloud project on the Tuya IoT Development Platform.
  • Incorrect country. You must select the region of your account of the Tuya Smart app or Smart Life app.
2406 skill id invalid Your cloud project on the Tuya IoT Development Platform should be created after May 25, 2021. Otherwise, you need to create a new project. For more information, see Operation on the Tuya IoT Development Platform.
28841105 No permissions. This project is not authorized to call this API Insufficient API permissions. You need to subscribe to the required API services and authorize your cloud project to use these API services. The following API services are required.
  • Authorization
  • IoT Core
  • Smart Home Scene Linkage
  • IoT Data Analytics
  • Device Status Notification