How to creat dashboard for a device?
Table of Contents:
- 1. Overview:
- 2. For devices which already have dashboard / profile/ rule chain.
- 3. For devices doesn't have dashboard / profile/ rule chain.
1. Overview:
After device data arrive to the platform via the method of Connect Device to ThingsEye. We can creat the Dashboard for the specify device. so to view the sensor detail of each device.
Note: We can create only one rule chain, device profile and dashboard for one type of devices.
2. For devices which already have dashboard / profile/ rule chain.
2.1 Get the json files
where to get:https://github.com/ThingsEye-io/te-platform/tree/main/Devices/Dragino
what files to get:Select the model you need and download three JSON files from it
Such as:
2.2 Import Rule chain
Firstly, we need to import the rule chain. The rule chain tells platform how we should handel the uplink and downlink for this device.
Open rule chains, click on the "+" in the upper right corner,
select "import rule chain", and then drag the downloaded JSON file with the suffix "_rule_chain" into the text box
- Only need to import once for same type of devices.
2.3 Import Device profile and select the rule chain
2.3.1 Import Device profile
At this step, we need to import the device profile first, as shown in the figure.
First, we need to open the device profiles, click on the "+" in the upper right corner, select "import device profile",
and then select the file with the suffix "_device_defiles" that we have already downloaded. Drag it into the text box.
2.3.2 Modify the rule chain in the device profiles
After importing the rule chain and device profile, we need to link them together.
At this point, we need to modify the rule chain on the device profiles page.
In this section, first we need to open the device profiles module again,
click on the newly imported device profile file, and then click on the top right corner“ 🖊” After entering the editing mode,
we will see the Default rule chain under the details section.
Click on it and select the corresponding rule chain we have newly imported,
then click the "√" in the upper right corner to save it.
2.4 Import Dashboard and link to each device
After importing the rule chain and device profile, we need to import the dashboard and configure its datasource.
2.4.1 Import dashboard
Firstly, we need to open the dashboard module,
click on the "+" in the upper right corner, select "import dashboard",
then we shoud drag the downloaded _dashboard file into the text box.
2.4.2 Modify the datasource of each module in the dashboard
After importing the dashboard, we need to link it with our input device,
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.
(For example, if our input device IMEI is 863663062789483, then our input device name is 863663062789483)
In this section, we should first open our newly imported dashboard and click on "Edit mode" in the upper right corner to edit it.
Afterwards, select the module to be modified and click on the top right corner of the module“ 🖊” Enter the editing interface,
then find the Datasource section, select the corresponding device name, and click "Apply" in the upper right corner.
- Need to repeat for every new device.
- Make sure the device already creat in the platform.
Now our dashboard has been successfully imported and the data can be displayed after processing.
Next, we only need to transfer the data in and we can see the data displayed on the dashboard.
3. For devices doesn't have dashboard / profile/ rule chain.
If your device is connected to the platform and there is no existing dashboard, the following instructions will tell you how to create your own dashboard
3.1 Creat the adshboaed and add branch
Sometimes the dashboard we need to create may not have just one interface, so in the following tutorial, we will use a hierarchical dashboard as an example to teach you how to create your own dashboard
3.1.1 Create Dashboard
When we want to create a dashboard, we need to open the dashboard menu and follow the tutorial shown in the figure to create it
Assigning users and groups is not necessary and can be done uniformly after completing the overall project creation
3.1.2 Add branch
If the dashboard you need requires multiple display interfaces, you need to add branches to the dashboard and connect them together.
- If the dashboard you need only requires a simple interface, then this step is not necessary
How many interfaces do you need to display, and how many statuses you need to create.
After creating the branch, you can add widgets into your dashboard and decorate it.
3.1.3 Creat actions
If you have created a multi-level dashboard, you need to connect your dashboard with actions to achieve functionality: when you click on a module in the first level dashboard, you can jump to the second dashboard
3.2 Creat device profiles and set up Alarm
Device configuration can set common message processing methods for a certain type of device, such as rule chain, message transmission queue, transmission protocol configuration, alarm rule configuration, etc.
3.2.1 Creat device profiles
In the process of creating device configuration, it is necessary to separately set device configuration details, transmission configuration, alarm rules, and device pre configuration. The creation process is as follows.
S
Equipment configuration details
In the details, the following configurations can be made:
Name: required field, the name of the device configuration;
Default rule chain: optional item, can specify which set of rule chains to use. If not filled in, the default root rule chain will be used;
Mobile dashboard: optional field, specifying the dashboard used by the mobile application for device details;
Queue: optional, can specify the strategy for message submission and processing, default is Main;
Default edge rule chain: No configuration required;
Equipment configuration image: optional, device images can be uploaded;
Description: Optional field, equipment description;
Transmission configuration
In the transmission configuration, the protocol for uploading device data can be configured, and the system provides the following protocols:
Default: Supports basic MQTT, HTTP, and CoAP transmission. If there are no special requirements, the default is generally selected;
MQTT: Enable advanced MQTT transport settings for advanced configuration;
CoAP: Enable advanced CoAP transmission settings for advanced configuration;
LWM2M: LWM2M transmission type, capable of advanced configuration;
SNMP: Specify SNMP transmission configuration for advanced configuration;
3.2.2 Set up Alarm
3.2.2.1 Creat alarm
In the alarm rules of device configuration, the conditions for creating and eliminating alarms can be configured (the same effect as configuring in the rule engine, where configuration can avoid encoding).
Go to the Alarm Rule Configuration tab, click Add Alarm Rule, and enter the Alarm Rule Configuration page.
Alarm creation rule configuration:Multiple items can be created using the 'Add Create Condition' button.
Severity level:The system provides five severity levels of alarms for configuration personnel to choose from, namely dangerous, important, secondary, warning, and uncertain, and can be selected according to the situation.
condition:The condition requires configuring the logic for creating alarms. Click the "Add Alarm Rule Condition" button and follow the steps below to complete the creation of an alarm rule condition.
step1:
step2:
step3:
step4:
step5:
Among them:
When configuring the filter in step 2, the system provides three key types for selection, namely attribute, Timeseries, and constant. When selecting the first two, the key name is a dropdown menu, and you can choose the corresponding attribute name; When selecting a constant, the key name is an input box and you need to input it yourself. The value type is a dropdown selection box, including four types to choose from: string, number, boolean, and date time.
When configuring the filter in step 4, multiple logics can be added by clicking the add button; Operate as a dropdown selection box, providing various comparison logics; The value is the threshold for comparison. The dynamic comparison threshold configuration can be achieved through the following operations. Note that it is necessary to create the source attributes filled in for the selected dynamic source type in advance (the configuration method is described in https://wiki.thingseye.io/xwiki/bin/view/Main/Basic%20configuration%20of%20rule%20chains/' customer attributes and tenant attributes).
When configuring the condition type in step 5, the system provides three types: simple, duration, and repetition. When selecting the duration, it is necessary to configure the value and time unit of the duration, which can also be configured using dynamic sources; When selecting repetition, it is necessary to configure the number of repetitions, which can also be configured using dynamic sources.
3.2.2.1 clear alarm
The configuration and creation steps of alarm clearing rules are exactly the same, only the difference in configuration content is not elaborated here.
3.2.3 replace device profile
3.3 creat rule chain
3.3.1 creat rule chain
The following link will provide a tutorial on rule chains:
https://wiki.thingseye.io/xwiki/bin/view/Main/Basic%20configuration%20of%20rule%20chains/
3.3.2 replace rule chain
Hope this article can be helpful to you.Good luck to you!