|
2 | 2 | sidebar_position: 4 |
3 | 3 | --- |
4 | 4 |
|
5 | | -# Product Model |
| 5 | +# Thing Model |
6 | 6 |
|
7 | | -The purpose of the Product Model (Thing Model) is to reuse data definitions and charts. |
| 7 | +A Thing Model defines reusable device fields and the Web/App chart pages that are generated from those fields. Device templates can reference a Thing Model so devices of the same type share the same data structure and visualization configuration. |
8 | 8 |
|
9 | 9 | ## 1. Description |
10 | | -- Click Device Onboarding - Product Model to enter the management page. |
11 | | -- Product Model corresponds to real-world product names, e.g., "Temp & Hum Sensor" in "Brand X Temp & Hum Sensor". |
12 | | -- Defines charts and data structures. |
13 | | -- Charts for Apps can be pre-configured for efficient device onboarding. |
14 | | -- Product Model can be called by Device Templates. |
| 10 | + |
| 11 | +- Go to **Device Onboarding** > **Thing Model** to open the Thing Model management page. |
| 12 | +- A Thing Model usually represents a real device type, such as a temperature and humidity sensor. |
| 13 | +- The model definition contains telemetry, attributes, events, and commands. These fields can be used as data sources in chart configuration. |
| 14 | +- Web Chart Configuration and App Chart Configuration use the ThingsVis editor to create previewable visualization pages. |
| 15 | +- The saved chart configuration is applied when devices using this model display their details page. |
15 | 16 |
|
16 | 17 | ## 2. Operations |
17 | 18 |
|
18 | | -### 2.1 Create Product Model |
| 19 | +### 2.1 Create a Thing Model |
19 | 20 |
|
20 | | -- Click "Add Product Model" to create new. |
21 | | -- Set Template Name, Tags, etc. |
| 21 | +- Click **Add Thing Model**. |
| 22 | +- Enter the name, tag, author, version, description, icon, and other basic information. |
22 | 23 |
|
23 | | - |
| 24 | + |
24 | 25 |
|
25 | | -### 2.2 Configure Product Model |
| 26 | +### 2.2 Define the Thing Model |
26 | 27 |
|
27 | | -- Configure mapping relations for Telemetry, Attributes, Events, Commands parameter data names and identifiers. |
| 28 | +- Configure the data name, identifier, data type, unit, description, and read/write settings for telemetry and attributes. |
| 29 | +- Configure events and commands when the device needs event reporting or platform-issued control instructions. |
| 30 | +- Save the model definition before entering the chart configuration steps. |
28 | 31 |
|
29 | | - |
| 32 | + |
30 | 33 |
|
31 | | -### 2.3 Configure Charts |
| 34 | +### 2.3 Configure Web Charts |
32 | 35 |
|
33 | | -- Select charts to display and data sources. |
| 36 | +The Web chart step is configured through the embedded ThingsVis preview and editor. The **Thing Model Configuration DEMO** shows the current workflow. |
34 | 37 |
|
35 | | - |
| 38 | +- In the edit dialog, go to step **3 Web Chart Configuration**. |
| 39 | +- Select the refresh interval at the top of the card. In the DEMO, the interval is set to **5 seconds**. |
| 40 | +- The center area displays the current Web chart page as a ThingsVis preview. In the DEMO, it includes temperature trend, humidity trend, device switch, temperature setting, current temperature, and current humidity widgets. |
| 41 | +- Click **Edit Configuration** to open the ThingsVis editor. |
36 | 42 |
|
37 | | - |
| 43 | + |
38 | 44 |
|
39 | | -### 2.4 Configure App Charts |
| 45 | +- In the editor, use the left component library to add widgets, adjust the canvas in the center, and configure the selected page or widget in the right property panel. |
| 46 | +- When binding data, select the fields from the current Thing Model, such as `temperature`, `humidity`, and `switch`. |
| 47 | +- Click **Save Configuration** to save the page back to the Web chart configuration. Click **Cancel** only when you do not want to save the changes. |
| 48 | +- After saving, the Web chart step returns to the preview. Confirm the preview is correct, then click **Next Step**. |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +#### Data binding examples |
| 53 | + |
| 54 | +Select a widget on the canvas, or switch to **Layers** and select the target widget by name. The selected widget's binding options are shown in the right property panel. |
| 55 | + |
| 56 | +For a trend chart, select a line chart widget, such as `chart/uplot`. In **Content**, configure the chart title and display options. In **Data**, set the dataset binding mode to **Field**, set **Data Range** to **Device Data**, set **Data Type** to **Historical Data**, and select a historical array field such as `temperature__history` or `humidity__history`. Configure the time range, aggregation function, aggregation window, smooth curve, and area fill as needed. |
40 | 57 |
|
41 | | -- View App chart styles. |
| 58 | + |
| 59 | + |
| 60 | +For a value card, select `interaction/value-card`. Set the card title, then set the value binding mode to **Field**. Use **Device Data** as the data range, **Thing Model Field** as the data type, and select a numeric field such as `humidity` or `temperature`. Configure the unit, whether to show the unit, the decimal places, and optional trend or icon display. |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +For a switch, select `interaction/switch`. Set **Switch Status** to **Field**, use **Device Data** as the data range, select **Thing Model Field**, and bind it to a Boolean field such as `switch`. Configure the label text, label position, on/off text, size, colors, and behavior options such as disabled state or confirmation before switching. |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | +### 2.4 Configure App Charts |
42 | 69 |
|
43 | | - |
| 70 | +The App chart step also uses the ThingsVis editor, but the result is saved separately for the mobile App detail page. |
44 | 71 |
|
45 | | -### 2.5 Complete Configuration |
| 72 | +- Go to step **4 App Chart Configuration**. |
| 73 | +- Select the refresh interval for the App detail page. |
| 74 | +- Click **Create Configuration** or **Edit Configuration** to open the editor. |
| 75 | +- Design the mobile detail page and bind widgets to telemetry or attribute fields from the Thing Model. |
| 76 | +- Click **Save Configuration** to save the App chart page and return to the preview. |
| 77 | +- Click **Next Step** to enter the publish step. |
46 | 78 |
|
47 | | -- View template info and complete configuration. |
| 79 | +### 2.5 Complete and Publish |
48 | 80 |
|
49 | | - |
| 81 | +- Review the Thing Model information, model definition, Web chart configuration, and App chart configuration. |
| 82 | +- Publish the model after confirming that the configuration is correct. |
0 commit comments