How to define functions?

Define Product Function

Defining product functionality is the first step in product development. Product features are combined in 3 parts, including standard, custom, and cloud functions.

Standard Functions

cmd-markdown-logo

The standard feature are common features available under this category. You can directly choose to enable it. After enabling, you can edit it according to the actual product features. Useless features can be deleted, can still be re-enabled after deletion.

cmd-markdown-logo

It is important to note that the standard functionality does not support changing identifiers, function types, and data transfer classes because it is already bundled with some App interface components. Other properties can be edited.

Custom Functions

If your product functions are not in the standard function selections, you can customize the function. Function points are abstract representations of product functions, each of which can be defined by different functional types. The current platform provides: Boolean, numeric, enum type, fault type, string type, through the transmission of these six types of functions.

cmd-markdown-logo

Among them, the Boolean type, numerical type, enumeration type is the basic type, most of the functions can be defined by the three types of functions. Fault type specifically for fault definition, easy to failure statistics in the background. The string type and the transparent type are advanced types. They are used for more complicated functions. They are recommended only when other types can not be satisfied.

How to define function points, as described in detail below.

Cloud Functions

Currently support cloud features including cloud timing and web page jumps.

Cloud timing function, for Tuya Smart cloud packaging timing features, including setting the switch time and week cycle, no hardware embedded development. Web page jump function, can be used to set the product purchasing page such as micro-mall, product description and other pages. cmd-markdown-logo

Currently, only part of the interface template support cloud features, please consider when setting. The effect is as follows:

cmd-markdown-logo

How to Define Function Point

Function Point:That is, the abstraction of the specific smart device functions, used to describe the product function and its parameters.

Function Point ID:Function point coding, follow-up equipment and the function of cloud data transmission through the function point ID.

Function Point Name:Custom Function Name

Identifier Name:Function point code value used for the multi-language management of App display function name. Support for letters, numbers, underscores, beginning with a letter.

Data Category

  • Boolean (bool): non-true or false binary variable. Such as: switch function, on / off
  • Value (value): suitable for linear adjustment of the type of data. Such as: temperature regulation, temperature range 20-40 ℃
  • Enum (enum): custom finite set value. Such as: working levels, low / mid / high
  • Fault (fault): dedicated to reporting and statistical failure of the function points. Support multi-fault, the data reported only
  • String(string): A function point that is transmitted as a string
  • Transparent (raw): in binary form transparent function points. Generally do not recommend the use of the function points.Can be used when you meet some complex functions that can’t be satisfied with the function points above.

Data transfer type

  • Can be issued and reported: the command data can be sent to the equipment, equipment data can be reported to the cloud;
  • Report only: Data only supports reporting from the device;
  • Only issue: data can only issue from the cloud;

Detailed functional types

Bool Type

cmd-markdown-logo

Applicable functions: non-true or false binary variable function. Function example: the device switch, heater child lock, electric fan swing, air purifier filter reset and other functions, can be used Boolean expression.

Value Type

Applicable functions: Suitable for linearly adjustable data types.

cmd-markdown-logo

Function Case:

  • Temperature change, the temperature range of 20-40, spacing 1, the unit is ℃, it means that the product can adjust the temperature of 20-40 ℃, each change in operation 1 ℃.
  • For schedule function, you can reserve 1, 2, 3, … 12 hours to switch on/off, you can set the value range: 1-12, space: 1, unit: hour.

Enumeration type

Applicable functions: This feature has a limited set of custom values.

cmd-markdown-logo

Function Case:

  • Levels,low / mid-range / high-grade;
  • Mode: Comfort mode, sleep mode, intelligent mode, energy-saving mode;
  • Color: red, blue, green, black;

Note: When editing a function point, the enumeration value supports letters, numbers, and underscores. When the Enter key is pressed, the enumeration value is automatically generated. Enumerated values ​​are encoded starting at 0, and are transferred with hardware encoding in an enumerated value encoding. Each enumeration value is no more than 15 characters in length and supports up to 10 enumerated values.

Enumeration value Enter one for each, need to enter once, the enumeration value will confirm the generation.

**Fault Type **

Applicable functions: Dedicated for reporting and statistical failure of the function points. This type of function will be used for statistics.

cmd-markdown-logo

Function Case:

  • Temperature sensor failure, motor failure, high temperature fault …

Note: Faulty data format is the bitmap type, can support multiple fault definitions. The fault type function only supports data report, so the data transmission type can only choose Report Only.

String Type

Applicable functions: Function points transmitted in the form of character strings. If the above four types of functions can not meet the definition of product functions, can be agreed through the string of data transmission

cmd-markdown-logo

Note: String-type maximum length of not more than 255 bytes.

Transparent Type

Applicable functions: Binary mode transparent function points. Generally do not recommend the use of the function points.Can be used when you meet some complex functions that can’t be satisfied with the function points above.

cmd-markdown-logo

Note: Transparent type maximum length does not exceed 255 bytes.

At present each product, supports up to 25 function points. If your product features more than 25 points, you can contact Tuya Smart Staff for support to find a better solution for you.

400 Call

Consult

400-881-8611