Help Center> IoT Device Access> FAQs> Products Models
Updated on 2023-11-14 GMT+08:00

Products Models

This section describes the problems that may occur when you use product models and the solutions.

How Can I Develop a Product Model?

The IoT platform supports online and offline development of product models. For details, see Developing a Product Model Online and Developing a Product Model Offline.

How Do I Select a Data Type When Developing a Product Model Online?

The rules for configuring the data type are as follows:

  • int: If the reported data is an integer or Boolean value, set the data type to int. The plug-in can be of the int or array type.
  • decimal: If the reported data is a decimal, set the data type to decimal. The plug-in can be of the string, int, or array type.
  • string: If the reported data is a string, enumerated value, or Boolean value, set the data type to string. If enumerated or Boolean values are reported, use commas (,) to separate the values. The plug-in can be of the string or array type.
  • dateTime: If the reported data is a date, set the data type to dateTime. The plug-in can be of the string or array type.
  • jsonObject: If the reported data is in JSON structure, set the data type to jsonObject. The plug-in can be of the string or array type.

Should the Values of serviceId and serviceType in a Product Model Be the Same?

Not necessary. For offline codec development, the values of serviceId and serviceType can be different. One serviceType can correspond to multiple serviceId values. For online codec development, to simplify the development process and make it easy for users to understand, serviceType is set to the same value as serviceId. The value should be consistent with the service type on the platform.

Why Does a Child Device Added Through the Gateway Not Belong to Any Product?

When a child device is added by calling an AgentLite API, the device information carried in the request must be consistent with the product model defined on the IoT platform for the child device. Otherwise, the child device cannot match with the product. Delete the child device that does not belong to any product and add it again. Ensure that the device information is correct.

How Can I Upload a Product Model with a Codec on the IoTDA Console?

IoTDA does not support the upload of product models with codecs.

If you want to use product models with codecs, develop or import product models and codecs on the IoTDA console.

Why Is the Upload Button Unavailable When I Want to Upload a Product Model to the IoTDA Console?

Description:

On the product details page, you upload a product model file, but cannot click OK.

Figure 1 Uploading a product model file

Possible Causes:

  1. The file name does not meet requirements.
  2. The uploaded file is not in ZIP format.

Solutions:

  1. Check whether the name of the product model is in the format of deviceType_manufacturerId_model.zip and whether the values of deviceType, manufacturerId, and model are the same as those defined in the devicetype-capability.json file.
  2. Check whether the product model is compressed to a ZIP file. If it is compressed as something else, decompress the file, compress it as a ZIP file, and upload it.

What Should I Do If the File Format Was Incorrect When I Was Uploading a Product Model to the IoTDA Console?

Description:

On the product details page, you upload a product model file, and a message is displayed, indicating that the file format is incorrect.

Figure 2 Error message displayed when a model file is uploaded

Possible Causes:

  1. The JSON file format is incorrect.
  2. The value of commands/properties in the servicetype-capability.json file is not in array format.
  3. The package contains unrelated files.

Solutions:

  1. Check the format of each JSON file by using a format verification tool.
  2. Check whether the values of commands and properties in the servicetype-capability.json file are in the array format (the value should be enclosed in brackets).
  3. Check whether the compressed package contains unrelated files or hidden files. If yes, delete them and upload the package again.

Why Was a Message Displayed Indicating the Manufacturer ID and Device Model Exist When I Was Uploading a Product Model to the IoTDA Console?

Description:

On the product details page, you upload a product model file, and a message is displayed, indicating that the manufacturer ID and device model exist.

Figure 3 Error message displayed when a model file is uploaded

Possible Causes:

The product model and plug-in of the same device model and manufacturer ID already exist on the IoT platform.

Solutions:

  1. Delete the plug-in and product model of another product or account (delete the plug-in first), and then import the product model.
  2. Modify the device model and manufacturer ID, and then import the product model.