Last Updated on : 2024-06-20 06:58:10download
This topic describes how to install and use the Tuya v2 integration.
You have created a cloud project of Smart Home type on the Tuya Developer Platform, added at least one real device or one virtual device, and authorized your project to use the required API services. For more information, see Configuration Wizard of Smart Home PaaS.
If your cloud project was created before May 25, 2021, you need to perform project migration. For more information, see How to Migrate to Tuya v2.
You have installed Python 3.8 (including python3-dev) or a later version on your system.
After you have installed Home Assistant Core, copy the Tuya v2 integration folder to the Home Assistant directory.
See the official installation guide and install Home Assistant Core.
Tuya v2 is compatible with the original Tuya integration (developed by a third party) so you do not need to uninstall the original Tuya integration to install Tuya v2.
Download the tuya-home-assistant repo.
Unzip it and copy the custom_components/tuya/
folder to the Home Assistant configuration directory, for example, ~/.homeassistant
.
See HACS Official Installation Guide and install HACS.
See Initial Configuration Guide and complete the initial configuration.
Open Home Assistant. Choose HACS > Integrations > ⋮ > Custom repositories.
Enter https://github.com/tuya/tuya-home-assistant
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.
localhost:8123
into the address bar in your browser and hit Enter to connect to Home Assistant.Fields | Description |
---|---|
Access ID and Access Secret | Go to the Tuya Developer Platform and select your cloud project. Click the Overview tab and find the Access ID and Access Secret in the Authorization Key area. |
Mobile app | The mobile app must be the one you use to scan the QR code for linking devices to your cloud project on the Tuya Developer Platform. |
Country code | The country you select on logging in to Tuya Smart or Smart Life app. |
Account | Your account of the Tuya Smart app or Smart Life app. |
Password | Your password of 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 Developer Platform.
I got an error saying ‘Invalid authentication’. How to fix it?
Please check the following things:
Will I be billed after the 1-year free trial of the API service expires?
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 |
|
1100 | param is empty | Account or mobile app is empty. You must enter the account or select a mobile app. |
2017 | schema does not exist | Incorrect mobile app. You must select the mobile app you use to scan the QR code for linking devices to your cloud project on the Tuya Developer Platform. |
2406 | skill id invalid | Your cloud project on the Tuya Developer Platform should be created after May 25, 2021. Otherwise, you need to create a new project. For more information, see Operation on the Tuya Developer 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.
|
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?
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.
Here is how to find the region: open the mobile app you use and tap Me > Setting > Account and Security > Region.
See Mappings Between OEM App Accounts and Data Centers and find the data center that can serve your region.
(Optional) If you do not find the data center you want to use, click the Overview tab and then Edit to add data centers.
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.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback