Skip to content

Thing Model ​

A thing model is a digital description of device capabilities with three element types — properties, services, and events — unifying data semantics between devices and the platform. Both device-reported and platform-delivered payloads are keyed by thing model identifiers.

Page Guide ​

What This Page CoversThe three thing-model elements and data types, the define-and-publish flow, identifier rules and value conventions, and common troubleshooting.
Use CasesFor users who have created a product and need to define the device data model before connecting devices.
PrerequisitesA product has been created; work in the Thing Model tab on the product detail page.
Acceptance CriteriaThe thing model is published, identifiers match the device-side code, and reported data displays correctly on the platform.

Three Elements ​

TypeDescriptionExample
PropertyDevice state data (read/write or read-only)temperature, humidity, switch state
ServiceOperations the device can executerestart, set temperature
EventNotifications from devicealarm, fault

Data Types ​

TypeDescription
int32-bit integer
floatSingle-precision floating point
doubleDouble-precision floating point
boolBoolean (0/1)
enumEnumeration with predefined values
textString
dateDate and time
structStructure with nested sub-properties
arrayArray

Define the Model ​

  1. Go to Product Detail > Thing Model tab
  2. Click Add and choose Property / Service / Event
  3. Enter the identifier (in English, used in MQTT topics), name, and data type
  4. Set the value range, step, unit, and so on
  5. Click Publish to activate the thing model

警告

Connected devices must reconnect to load updated thing models.

Take a "temperature" property as an example: identifier temperature, data type float, range -40~125, unit ℃, read-only. The device reports by identifier:

json
[{
  "id": "temperature",
  "value": "25.6",
  "remark": ""
}]

Identifier Rules ​

  • All identifiers are unique within a product; use letters and digits and avoid special characters
  • Sub-property identifiers of a struct (object type) use the parentId_childId format
  • Array identifiers start with array_index (a two-digit index, e.g. array_00_power_switch), and array length must not exceed 100

Value Conventions ​

  • value is always passed as a string
  • bool uses "0" / "1"
  • enum uses the predefined enumeration keys
  • array values are separated by commas

Thing Model Templates ​

The platform includes built-in templates for common models (such as temperature & humidity, light, and switches); you can pick a template for quick import when creating a product.

FAQ ​

Why doesn't the updated thing model take effect on the device? ​

After modifying a thing model, you must click Publish again for it to take effect. Connected devices need to reconnect (or restart) to load the latest model. If it still doesn't work, check whether the device is bound to the product.

Why is reported property data not shown on the platform? ​

Check that the id in the reported payload exactly matches the thing model identifier (case-sensitive), and that the data type can be converted by the platform — for example, bool only accepts 0/1.

What is the difference between properties, functions, and events? ​

A property describes device state (such as temperature or switch status) and can be read-write or read-only; a function is an operation command sent from the platform to the device (such as reboot); an event is a notification proactively reported by the device (such as an alarm). The three differ in MQTT topics and payload structure.