Last Updated on : 2024-06-24 09:51:12download
Product functions are the abstraction of smart device functions and are used to describe the functionalities and parameters of respective products. You can customize functions beyond the standard functions.
You have created at least one product. For more information, see Create Products.
Log in to the Tuya Developer Platform.
In the product list, find a target product whose status is Developing, and click Develop in the Operation column.
Check out the custom functions that have been added to the product. Depending on your needs, you can:
Click Add to add more custom functions.
Click Delete to delete the specified custom function.
Click Edit to edit the specified custom function.
Application: Applies to a binary variable that is either true or false.
Example: For the device switch, child lock on a heating device, fan head, and reset button of the filter cartridge for the air purifier, their DPs of Boolean type can be configured.
Temperature adjustment. For device temperature ranging from 20°C to 40°C with a pitch of 1, it indicates that the device temperature can range from 20°C to 40°C. With each operation, the temperature increases or decreases by 1°C.
Reservation. For the scenario that a device with a 12-hour timer is set to be turned on or off automatically at the specified time point, you can set the reservation from 1 hour to 12 hours with a pitch of 1 hour.
Application: Applies to a finite collection of custom values. After you enter an enum value, press the ENTER button to confirm.
Example:
An enum value can only contain lowercase letters, numbers, and underscores. After entering a value, press the ENTER button to confirm. Then, the enum value is automatically generated. The code of enum values starts from 0. An enum value is transmitted by its code. An enum value must not exceed 15 characters. Up to 10 enum values can be created.
Application: Applies to fault reporting and counting.
Example: temperature sensor faults, motor faults, and high temperature problems.
Faults adopt the bitmap data format. You can define multiple faults. The fault function only supports data reporting, so you can only choose Report Only as the data transfer type.
Application: Applies to DP data transmitted in string format. If the above-mentioned four data types cannot meet your definition of product functions, you can configure DPs to transmit data in the form of strings.
Things to note: The length of a string must not exceed 255 bytes.
Application: Applies to raw data that is passed through in the binary format. This data type is not recommended. You can use the raw data type to deal with complex functions when other function types cannot satisfy your requirements.
Things to note: The length of raw data must not exceed 255 bytes.
After setting the custom functions, you can:
For more information, see Custom Function FAQs.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback