Is this page helpful?
YesNoLast Updated on : 2022-08-11 06:20:12download
This topic describes how to install and use the official Tuya integration in Home Assistant.
This integration only supports the basic product categories, such as switches, lights, fans, thermometers, and hygrometers. For more information, see the table for supported device categories. We do not promise that all the Powered by Tuya devices can work with the Home Assistant Integration. If your device is not supported by the integration, see this tutorial to develop the driver yourself.
You have created a cloud project of Smart Home type on the Tuya IoT Development 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 the Tuya Home Assistant Integration.
You have installed Python 3.8 (including python3-dev) or a later version on your system.
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.
Enter localhost:8123
into the address bar in your browser and hit Enter to connect to Home Assistant.
Register and log in.
Click Configuration > Integrations.
On the Integrations page in the configurations panel, click the + button in the lower right and search for Tuya.
Select Tuya and set up the integration.
Enter your Tuya credentials.
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.
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.
I got an error saying ‘Config flow could not be loaded’ when setting up the Tuya integration. How to fix it?
Go to custom_components
under the Home Assistant directory and delete the tuya_v2
folder. Restart Home Assistant and try installing the integration again.
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.
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.
Click Extend Trial Period.
Complete this form.
You will get the result within one working day.
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 |
|
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.
|
How to get the diagnostic log?
You can get the diagnostic log with the following two options.
Option 1: Edit the configuration file. You can get the complete log but you need to restart Home Assistant after editing the file.
Copy the following code to the configuration.yaml and save.
logger:
default: critical
logs:
custom_components.tuya_v2: debug
After your Home Assistant is restarted, you can check the log of Tuya integration from the Terminal or from the home-assistant.log file.
Option 2: Export the log directly.
On the homepage of the Home Assistant, choose Configurations > Devices & Services.
Find the Tuya integration and click ⋮ > Download diagnostics to download the log file.
What categories are supported by the Tuya Home Assistant integration?
See the following table for supported device categories.
First Class Category | category code | category[en] | HA Core Supported Version | HA Platforms |
---|---|---|---|---|
Large Home Appliances | kt | Air conditioner | Release 2021.10 | Climate, Switch |
Small Home Appliances | cwysj | Pet Water Feeder | Release 2021.10 | Switch |
qn | Heater | Release 2021.10 | Climate, Switch | |
sd | Robot Vaccum | Release 2021.11 | Vacuum | |
fs | Fan | Release 2021.10 | Fan,Light | |
cl | Curtain | Release 2021.11 | Cover | |
kj | Air Purifer | Release 2021.10 | Fan, Switch | |
cs | Dehumidifier | Release 2021.11 | Humidifier | |
cwwsq | Smart Pet Feeder | / | Sensor, Binary Sensor | |
rs | Heater | / | Climate, Switch | |
szjqr | Fingerbot | / | Number | |
Electrician Category | kg | Switch | Release 2021.10 | Sensor, Switch |
cz | Socket | Release 2021.10 | Sensor, Switch | |
pc | Power Strip | Release 2021.10 | Sensor, Switch | |
clkg | Curtain Switch | Release 2021.11 | Cover | |
jdcljqr | Curtain Robot | Release 2021.11 | Cover | |
wk | Thermostat | Release 2021.10 | Climate | |
dlq | Circuit Breaker | Release 2021.10 | Switch | |
ckmkzq | Garage Door Opener | Release 2021.11 | Switch, Binary Sensor | |
fskg | Fan wall switch | / | Switch, Fan | |
xxj | Diffuser | / | Switch | |
Security & Sensors | wsdcg | Temperature and Humidity Sensor | Release 2021.11 | Sensor |
mc | Door and Window Controller | / | Sensor, Binary Sensor | |
mcs | Door Window Sensor | Release 2021.10 | Sensor, Binary Sensor | |
ywbj | Smoke Detector | Release 2021.11 | Sensor, Binary Sensor | |
rqbj | Gas Detector | Release 2021.11 | Sensor, Binary Sensor | |
pir | PIR Detector | Release 2021.10 | Sensor, Binary Sensor | |
sj | Water Detector | Release 2021.11 | Sensor, Binary Sensor | |
pm25 | PM2.5 Sensor | Release 2021.11 | Sensor | |
hps | Human Presence Sensor | Release 2021.11 | Binary Sensor, Number | |
sos | Emergency Button | Release 2021.10 | Binary Sensor, Sensor | |
ldcg | Luminance Sensor | Release 2021.10 | Sensor | |
ms | Lock | Not Support | Lock | |
sp | Smart Camera | Release 2021.11 | Camera, Siren, Switch | |
sgbj | Siren Alarm | Release 2021.11 | Number, Siren, Switch | |
zd | Vibration Sensor | Release 2021.11 | Sensor, Binary Sensor, Number | |
co2bj | CO2 Detector | Release 2021.11 | Sensor | |
cobj | CO Detector | Release 2021.11 | Sensor | |
jqbj | Formaldehyde Detector | Release 2021.11 | Sensor | |
jwbj | Methane Detector | Release 2021.11 | Sensor | |
voc | Volatile Organic Compound Sensor | Release 2021.11 | Sensor | |
ylcg | Pressure Sensor | Release 2021.11 | Sensor | |
pm2.5 | PM2.5 Sensor | / | Sensor, Binary Sensor | |
wkf | Thermostatic Radiator Valve | / | Sensor, Binary Sensor | |
hjjcy | Air Quality Monitor | / | Sensor | |
Lighting | dj | Light | Release 2021.10 | Light, Switch |
dd | Light Strip | Release 2021.10 | Light | |
fwl | Ambient light | Release 2021.10 | Light | |
dc | Light string | Release 2021.10 | Light | |
xdd | Ceiling Light | Release 2021.10 | Light, Switch | |
fsd | Ceiling Fan Light | Release 2021.11 | Light | |
fwd | Ambient Light | Release 2021.11 | Light | |
gyd | Motion Sensor Light | Release 2021.11 | Light, Humidifier | |
jsq | Humidifier Light | Release 2021.10 | Light | |
tgkg | Dimmer Switch | Release 2021.11 | Light, Number, Select | |
tgq | Dimmer | Release 2021.11 | Light, Number | |
tyndj | Solar Light | Release 2021.11 | Light, Sensor, Switch | |
ykq | Remote Control | Release 2021.11 | Light | |
Kitchen Appliances | bh | Smart Kettle | Release 2021.10 | Switch |
kfj | Coffee Maker | Release 2021.10 | Number, Select | |
Energy | zndb | Smart Electricity Meter | Not Support | Sensor, Switch |
Is this page helpful?
YesNoIs this page helpful?
YesNo