TuyaAPI driver | Integrates tuya devices using the open Tuya API
Connecting
To use this driver, you will need to create an account in the Tuya IoT Platform.
In order to do so, please follow these steps:
- Go to Cloud->Development in the Tuya IoT Platform.
- Click Create Cloud Project and fill the required fields.
- In Development Method, select SmartHome.
- In Data Center, choose the one that fits best with your location. If you are not sure which one, you can select more than one.
- The next window will be “Authorize API Services” where you should choose at least: IoT Core, Authorization, Smart Home Scene Linkage, IoT Data Analytics, and Device Status Notification.
- Once the project is created, go to Cloud->Development->Your Project->Overview.
- Copy the Access ID/Client ID and the Access Secret/Client Secret.
- Paste them in the Client id and Client secret fields in the Systems Tab of the BLI.
- Next, you will need to link your Tuya app account.
- In Cloud->Development->Your Project->Devices, choose Link Tuya App Account->Add App Account.
- A QR code will appear that must be scanned with the Tuya app.
- If the linking isn’t successful, check if the data center chosen corresponds with the region on your app (if you selected more than one Data Center, you can change it in the top right, scan the code until the app account appears in the list).
- Once this is done, copy the UID and paste it in the “User ID” field on the BLI.
Resources
To add resources, simply click on Import Resources->Load resource from the connected system. The address of the resource corresponds to the Device ID presented in Cloud->Development->Your Project->Devices->All Devices.
Currently, as v0.7, the following resources are tested and working correctly:
- “Dimmable light”
- “Light non-dimmable”
- “Thermostat”: 1SP thermostat (ON/OFF/Temperature)
- “Switch”
The following resources are implemented but were never tested with real hardware, so please send us your feedback if you use them:
- “Shade”
Switches that correspond to lights will be discovered as switches and as non-dimmable lights, choose the one that fits best for you. For thermostats, it is important to adjust the temperature unit and correction parameters in the BLI System settings. Tuya does not provide this information, and they change depending on the thermostat manufacturers. For reference, command correction is a multiplier while state correction is a divider.
Please let us know your experience and any issues with this driver at: support+drivers_tuya@khimo.com
Changelog
v0.4
- First public version
v0.6
- Added support for lights with Tuya code “dj”
v0.7
- Fixed “cz” switches not discovering as lights
v0.8
- Fixed dimmable and non-dimmable lights command bug
v0.9
- Improves helps, adds some logs.
v0.10
- Adds support to category “tdq” supporting ON/OFF dimmers or GPIO