Last Updated on : 2023-02-02 05:59:26download
This topic describes how to install 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, go to GitHub to check the supported device categories.
It is not guaranteed 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.
For now, you can extend the trial period multiple times. However, Tuya does not promise it to be permanent. As the integration will make relevant adjustments accoding to the Tuya IoT Development Platform rules in the following years.
You have added at least one real device or one virtual device.
You have authorized your project to use the required API services.
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.
After you have installed Home Assistant Core (v2021.10.4 or later), you can search for and set up the Tuya integration in Home Assistant.
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.
Search for Tuya and click the icon to install.
Enter your Tuya credentials.
Parameters | Description |
---|---|
Country | Select the region of your account of the Smart Life app.Note: Open the mobile app 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 Smart Life app. |
Password | Your password for the 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.
Go to custom_components
under the Home Assistant directory and delete the tuya_v2
folder. Restart Home Assistant and try to install the integration again.
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 Smart Life app and tap Me > Setting > Account and Security > 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.
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.
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 |
|
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.
|
28841002 | No permissions. Your subscription to cloud development plan has expired | Your subscription to Tuya cloud development IoT Core Service resources has expired, please click to extend trial period. |
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 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.
The following table lists the supported product categories:
Level-1 category | Category code | Category | Supported HA Core version | HA Platform |
---|---|---|---|---|
Large Home Appliances | kt | Air Conditioner | Release 2021.10 | Climate, Switch, Light |
Small Home Appliances | cwysj | Pet Feeder | Release 2021.10 | Switch |
qn | Heater | Release 2021.10 | Climate, Switch, Select, Sensor | |
sd | Robot Vacuum | Release 2021.11 | Vacuum | |
fs | Fan | Release 2021.10 | Fan | |
cl | Curtain Motor | Release 2021.11 | Cover | |
kj | Dehumidifier | Release 2021.10 | Fan, Switch | |
cs | Dehumidifier | Release 2021.11 | Humidifier | |
xxj | Aroma Diffuser | Release 2021.11 | Switch | |
cwwsq | Pet Feeder | / | Sensor, Binary Sensor | |
rs | Water Heater | / | Climate, Switch | |
szjqr | Fingerbot | / | Number | |
Electrical Products | kg | Switch | Release 2021.10 | Sensor, Switch, Light, Select |
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 | Cover, Switch | |
fskg | Fan Wall Switch | / | Switch, Fan | |
xxj | Diffuser | / | Switch | |
Sensor and Security | wsdcg | Temperature and Humidity Sensor | Release 2021.11 | Binary Sensor, Sensor |
mc | Door/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 | Passive Infrared Sensor | Release 2021.10 | Sensor, Binary Sensor | |
sj | Water Detector | Release 2021.11 | Sensor, Binary Sensor | |
pm25 | PM2.5 Sensor | Release 2021.11 | Binary Sensor, 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 | Binary Sensor, Sensor | |
sp | Smart Camera | Release 2021.11 | Camera, Siren, Switch, Light, Number, Select, Sensor | |
sgbj | Siren | Release 2021.11 | Number, Siren, Switch, Select | |
zd | Vibration Sensor | Release 2021.11 | Sensor, Binary Sensor, Number | |
co2bj | CO2 Sensor | Release 2021.11 | Binary Sensor, Sensor | |
cobj | CO Sensor | Release 2021.11 | Binary Sensor, Sensor | |
jqbj | Formaldehyde Detector | Release 2021.11 | Binary Sensor, Sensor | |
jwbj | Methane Detector | Release 2021.11 | Binary Sensor, Sensor | |
voc | VOC Sensor | Release 2021.11 | Binary Sensor, Sensor | |
ylcg | Pressure Sensor | Release 2021.11 | Binary Sensor, Sensor | |
pm2.5 | PM2.5 Detector | / | Sensor, Binary Sensor | |
wkf | Thermostatic Radiator Valve | / | Sensor, Binary Sensor | |
hjjcy | Air Quality Monitor | / | Sensor | |
Lighting Products | dj | Light | Release 2021.10 | Light, Switch |
dd | Strip Lights | Release 2021.10 | Light | |
fwl | Ambient Light | Release 2021.10 | Light | |
dc | String Lights | 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 | |
jsq | Humidifier | Release 2021.10 | Light, Humidifier | |
tgkg | Dimmer Switch | Release 2021.11 | Light, Number, Select | |
tgq | Dimmer | Release 2021.11 | Light, Number, Select | |
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, Number, Sensor |
kfj | Coffee Maker | Release 2021.10 | Number, Select |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback