Wiki source code of How to creat dashboard for a device?
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | |||
| 2 | |||
| 3 | **Table of Contents:** | ||
| 4 | |||
| 5 | {{toc/}} | ||
| 6 | |||
| 7 | |||
| 8 | = 1. Overview: = | ||
| 9 | |||
| 10 | After device data arrive to the platform via the method of [[Connect Device to ThingsEye>>https://wiki.thingseye.io/xwiki/bin/view/Main/How%20to%20connect%20my%20devices%20to%20ThingsEye%3F/#]]. We can creat the Dashboard for the specify device. so to view the sensor detail of each device. | ||
| 11 | |||
| 12 | |||
| 13 | Note: We can create only one rule chain, device profile and dashboard for one type of devices. | ||
| 14 | |||
| 15 | |||
| 16 | = 2. For devices which already have dashboard / profile/ rule chain. = | ||
| 17 | |||
| 18 | == 2.1 Get the json files == | ||
| 19 | |||
| 20 | where to get:[[https:~~/~~/github.com/ThingsEye-io/te-platform/tree/main/Devices/Dragino>>path:/xwiki/bin/get/Main/How%20to%20import%20and%20use%20the%20dashboard%3F/?sheet=CKEditor.ResourceDispatcher&outputSyntax=plain&language=&type=doc&reference=&typed=]] | ||
| 21 | |||
| 22 | what files to get:Select the model you need and download three JSON files from it | ||
| 23 | |||
| 24 | Such as: | ||
| 25 | |||
| 26 | * [[sn50v3_nb_mod9_dashboard_.json>>url:https://github.com/ThingsEye-io/te-platform/blob/main/Devices/Dragino/SN50v3-NB-Mod9/sn50v3_nb_mod9_dashboard_.json]] | ||
| 27 | * [[sn50v3_nb_mod9_device_profile.json>>url:https://github.com/ThingsEye-io/te-platform/blob/main/Devices/Dragino/SN50v3-NB-Mod9/sn50v3_nb_mod9_device_profile.json]] | ||
| 28 | * [[sn50v3_nb_mod9_rule_chain.json>>url:https://github.com/ThingsEye-io/te-platform/blob/main/Devices/Dragino/SN50v3-NB-Mod9/sn50v3_nb_mod9_rule_chain.json]] | ||
| 29 | |||
| 30 | == 2.2 Import Rule chain == | ||
| 31 | |||
| 32 | Firstly, we need to import the rule chain. The rule chain tells platform how we should handel the uplink and downlink for this device. | ||
| 33 | |||
| 34 | Open rule chains, click on the "+" in the upper right corner, | ||
| 35 | |||
| 36 | select "import rule chain", and then drag the downloaded JSON file with the suffix "_rule_chain" into the text box | ||
| 37 | |||
| 38 | * Only need to import once for same type of devices. | ||
| 39 | |||
| 40 | ****[[image:1729040952504-811.png||height="556" width="1138"]] | ||
| 41 | |||
| 42 | [[image:1729066864346-718.png||height="596" width="1140"]] | ||
| 43 | |||
| 44 | == 2.3 Import Device profile and select the rule chain == | ||
| 45 | |||
| 46 | === 2.3.1 Import Device profile === | ||
| 47 | |||
| 48 | At this step, we need to import the device profile first, as shown in the figure. | ||
| 49 | |||
| 50 | First, we need to open the device profiles, click on the "+" in the upper right corner, select "import device profile", | ||
| 51 | |||
| 52 | and then select the file with the suffix "_device_defiles" that we have already downloaded. Drag it into the text box. | ||
| 53 | |||
| 54 | [[image:1729041156898-931.png||height="523" width="1144"]] | ||
| 55 | |||
| 56 | [[image:1729066636027-958.png||height="603" width="1143"]] | ||
| 57 | |||
| 58 | === 2.3.2 Modify the rule chain in the device profiles === | ||
| 59 | |||
| 60 | After importing the rule chain and device profile, we need to link them together. | ||
| 61 | |||
| 62 | At this point, we need to modify the rule chain on the device profiles page. | ||
| 63 | |||
| 64 | In this section, first we need to open the device profiles module again, | ||
| 65 | |||
| 66 | click on the newly imported device profile file, and then click on the top right corner“ 🖊” After entering the editing mode, | ||
| 67 | |||
| 68 | we will see the Default rule chain under the details section. | ||
| 69 | |||
| 70 | Click on it and select the corresponding rule chain we have newly imported, | ||
| 71 | |||
| 72 | then click the "√" in the upper right corner to save it. | ||
| 73 | |||
| 74 | [[image:1729041627624-611.png||height="567" width="1148"]] | ||
| 75 | |||
| 76 | [[image:1729041918618-753.png||height="558" width="1151"]] | ||
| 77 | |||
| 78 | == 2.4 Import Dashboard and link to each device == | ||
| 79 | |||
| 80 | After importing the rule chain and device profile, we need to import the dashboard and configure its datasource. | ||
| 81 | |||
| 82 | === ** **2.4.1 Import dashboard === | ||
| 83 | |||
| 84 | Firstly, we need to open the dashboard module, | ||
| 85 | |||
| 86 | click on the "+" in the upper right corner, select "import dashboard", | ||
| 87 | |||
| 88 | then we shoud drag the downloaded _dashboard file into the text box. | ||
| 89 | |||
| 90 | [[image:1728978901199-201.png||height="591" width="1156"]] | ||
| 91 | |||
| 92 | [[image:1729066158155-749.png||height="603" width="1165"]] | ||
| 93 | |||
| 94 | |||
| 95 | === 2.4.2 Modify the datasource of each module in the dashboard === | ||
| 96 | |||
| 97 | After importing the dashboard, we need to link it with our input device, | ||
| 98 | |||
| 99 | So we need to change the input device of each module in the dashboard , and the corresponding device name is the IMEI of the device we are connected to. | ||
| 100 | |||
| 101 | (For example, if our input device IMEI is 863663062789483, then our input device name is 863663062789483) | ||
| 102 | |||
| 103 | |||
| 104 | In this section, we should first open our newly imported dashboard and click on "Edit mode" in the upper right corner to edit it. | ||
| 105 | |||
| 106 | Afterwards, select the module to be modified and click on the top right corner of the module“ 🖊” Enter the editing interface, | ||
| 107 | |||
| 108 | then find the Datasource section, select the corresponding device name, and click "Apply" in the upper right corner. | ||
| 109 | |||
| 110 | * Need to repeat for every new device. | ||
| 111 | * Make sure the device already creat in the platform. | ||
| 112 | |||
| 113 | [[image:1729042442077-819.png||height="580" width="1160"]] | ||
| 114 | |||
| 115 | [[image:1729042599152-568.png||height="571" width="1166"]] | ||
| 116 | |||
| 117 | [[image:1729042895928-321.png||height="565" width="1165"]] | ||
| 118 | |||
| 119 | Now our dashboard has been successfully imported and the data can be displayed after processing. | ||
| 120 | |||
| 121 | Next, we only need to transfer the data in and we can see the data displayed on the dashboard. | ||
| 122 | |||
| 123 | [[image:1728978901221-951.png||height="591" width="1134"]] | ||
| 124 | |||
| 125 | = 3. For devices doesn't have dashboard / profile/ rule chain. = | ||
| 126 | |||
| 127 | |||
| 128 | |||
| 129 | {{{Hope this article can be helpful to you.Good luck to you!}}} |