Skip to content

Commit 3f0cd2d

Browse files
authored
MCS-4259: add new tutorial (#117)
1 parent 94a23c1 commit 3f0cd2d

24 files changed

+319
-81
lines changed

content/en/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,6 @@
6666
* [2.21](change_log/2.21.md)
6767
* [2.22](change_log/2.22.md)
6868
* [2.23](change_log/2.23.md)
69+
* [2.25](change_log/2.25.md)
6970

7071

content/en/change_log/2.25.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 2018/07/25
2+
3+
## New Features
4+
1. Users can be notified directly on MCS web console by adding **Console Alert** in Trigger & Action. [more information](../tutorial/setting_notification)
5+
6+
7+
## Resolved Issues
8+
1. Users might receive 2 mobile push notifications while uploading data points via web console or mobile App.

content/en/change_log/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# MCS Change log Summary
22

3+
4+
## 2018/07/25
5+
6+
### v2.25
7+
8+
[Users can be notified directly on MCS web console by adding **Console Alert** in Trigger & Action.](./2.25)
9+
10+
311
## 2018/05/11
412

513
### v2.23
9.05 KB
Loading
19.2 KB
Loading
9.29 KB
Loading
7.63 KB
Loading

content/en/tutorial/setting_notification.md

Lines changed: 94 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,133 @@
1-
# Using Trigger and Action
1+
# Trigger & Action
22

3-
## How to add trigger and action
3+
The Trigger & Action feature is used when you would like to get a notification while the value of a data channel meets certain criteria.
44

5-
You can set the trigger and action value for a data channel. When the value passes the limit of the defined range, you will get an email or a Mobile Push notification based on the trigger and action settings. In addition, MCS supports webhook trigger, you can input the URL that you would like to recieve this trigger.
5+
You can set trigger rules on the following data channels
66

7-
Please note that MCS only supports trigger and action for integer and float data channel types at the time of writing. Also, only data points uploaded by the device (data points uploaded with deviceKey) will trigger the action. The data points uploaded by user (via web using authentication) will not be triggered.
7+
1. ON/OFF
8+
2. Category
9+
3. String
10+
4. Hex
11+
5. Integer
12+
6. Float
813

14+
and choose one of the following conditions to apply on that data channel
915

10-
In the **Prototype** detail page, click the **Trigger & action** tab.
16+
1. Greater than
17+
2. Lower than
18+
3. Equal to
19+
4. Between
20+
5. OnChange
1121

12-
![](../images/Trigger/img_trigger_01.png)
22+
The conditions which must be met before the trigger action executes and there are 4 trigger actions provided.
1323

14-
Click **Add trigger & action** to enter the trigger name and description.
24+
1. Email
1525

16-
![](../images/Trigger/img_trigger_02.png)
26+
Users with access privilege to this device can receive the Email notification, including device owner, administrator and viewer.
27+
28+
2. Mobile Push
1729

18-
Then click **Next** to set the trigger criteria by selecting the data channel you would like to set alert for and enter the value. The rules include greater than, lower then, equal to, and between.
30+
Users with MediaTek Cloud Sandbox App installed on his mobile can receive the push notification.
31+
32+
3. Webhook
1933

20-
If there are more than one data channel rules in the trigger criteria, all data channel rules need to be satisfied in order to trigger the action('AND' logic). You can create separate trigger and action rules to use the 'OR' logic.
34+
MCS makes an HTTP request to the callback URL that user provided.
35+
36+
4. Console Alert
37+
38+
When that trigger occurs, there is an alert message on web console directly.
2139

22-
![](../images/Trigger/img_trigger_03.png)
2340

24-
Click **Next** to select the trigger action. You can select to get email or Mobile Push notification when the trigger criteria are met. The email and Mobile Push notification will be sent to anyone with the access to the test device.
41+
## Defining a trigger & action
2542

26-
Furthermore, you are allowed to use MCS pre-defined variables in **Title** and **Content** fileds to capture the real value when the action was triggered. You can find more detail under this page.
43+
You can set **Trigger & Action rules** for a **prototype** and the rules will be applied to each device under this prototype. In addition, you can edit the **value in condition** at **device** level afterward.
2744

45+
Here are the steps:
2846

29-
![](../images/Trigger/img_trigger_04.png)
47+
1. In the **Prototype** detail page, click the **Trigger & Action** tab -> **Add trigger & action**.
3048

31-
The test device will inherit all the trigger and action from its parent prototype. In a test device, you can only change the value of the trigger criteria or select to switch on or off a specific trigger and action.
49+
![](../images/Trigger/img_trigger_01.png)
50+
51+
2. Provide the necessary information in the **Add trigger & action** dialog.
52+
53+
Step 1: The **trigger name** will display in the **console alert** when it is triggered.
54+
![](../images/Trigger/img_trigger_02.png)
55+
56+
Step 2: The match condition is **AND** if there are multiple criteria set. That means you have to upload these data points **in one payload** and all of them match the conditions.
57+
![](../images/Trigger/img_trigger_03.png)
58+
59+
Step 3: At least one action need to be selected. We will explain more about each action later.
60+
![](../images/Trigger/img_trigger_04.png)
61+
62+
63+
The device inherits all the trigger & action rules from its prototype. However, you can still change the value of the trigger criteria and enable or disable trigger & action rules for a device.
3264

3365
![](../images/Trigger/img_trigger_05.png)
3466

35-
## Setting trigger and action for different mobile devices
3667

37-
If you have multiple mobile devices, MCS allows you to set which mobile devices will receive the mobile push notification. You can find the setting in two places:
68+
Please note, only data points uploaded by the device (with **deviceKey in HTTP header** or via **MQTT**) can trigger the action. The action will NOT be triggered by the UI operation on the web console.
69+
3870

39-
1. In the **User Profile** page, you can switch on or off all the notification from MCS to a specific mobile device.
40-
2. In the **Test device** page, you can switch on or off all notification from a specific test device to a specific mobile device.
71+
## More about Trigger Actions
72+
### Configuring the Mobile Push
4173

42-
In the **User Profile** page, you can see a mobile list that includes all user's mobile devices with MCS app installed. You can use the **Swith** to control which mobile device will receive notifications from MCS.
74+
If you have multiple mobile devices, you can choose which mobile devices can receive the mobile push notification. You can find the setting in two places:
75+
76+
1. In the **User Profile** page, you can switch on or off **all the mobile push** to a mobile device.
77+
2. In the **Test Device** page, you can switch on or off all **mobile push for a test device** to a mobile device.
78+
79+
In your **User Profile** page, there is a mobile list that includes all your mobile devices with MCS App installed. You can use the **Switch** to control which mobile device can receive mobile push from MCS.
4380

4481
![](../images/Trigger/img_trigger_06.png)
4582

46-
In the **Trigger & action** tab in the test device page, expand the **Manage your action** section and you will see a list of all user's mobile devices with MCS app installed. You can use the **switch** here to control which specific mobile device will receive the notification from this test device.
83+
In the **Trigger & Action** tab in the test device page, expand the **Manage your action** section and there is a mobile list that includes all your mobile devices with MCS App installed. You can use the **Switch** here to control which mobile devices can receive the mobile push for this test device.
4784

4885
![](../images/Trigger/img_trigger_07.png)
4986

5087

88+
### Configuring the Webhook
5189

52-
# Set up a webhook trigger
53-
54-
To set up a webhook trigger, you have to select the **webhook** as the action in the Trigger & action tab in the prototype. And input the url that you would like to get the webhook trigger.
90+
There is no extra setting for webhook. To use webhook trigger, you only have to select the **webhook** as the action in the trigger & action setting and provide the callback URL that MCS makes an HTTP request to.
5591

5692
![](../images/Trigger/img_trigger_08.png)
5793

58-
There is a Test button for you to test if the trigger has been sent to the url. The device name, deviceId and the triggered value will be sent to the triggered url.
94+
There is a Test button for you to test if the trigger has been sent to the URL. The device name, deviceId and the triggered value will be sent to the triggered URL.
95+
96+
97+
### Configuring the Console Alert
98+
99+
You have to specify the severity level while configuring console alert in Trigger & Action.
100+
101+
![](../images/Trigger/img_trigger_13.png)
102+
103+
When that trigger occurs, the console alert with severity information will show on the web console immediately. It is displayed on the following page.
104+
105+
1. Data Channel Card
106+
107+
You can expand the alert message bar to see more information, including **trigger name** and **alert time**. In this case, a data was uploaded on "2018-07-19 11:36" and triggered a rule named "Water is too hot".
108+
109+
After you click **Dismiss**, this alert will be cleared. You won't see this alert until the new data is uploaded and the trigger rule is matched.
110+
111+
![](../images/Trigger/img_trigger_10.png)
112+
113+
2. Test Device List
114+
115+
It always displays the alert with **highest severity** right this moment.
116+
117+
Take the previous case for example. You will see "High" alert on the card, if "High" alert is dismissed, and then it shows "Medium" alert instead.
118+
119+
![](../images/Trigger/img_trigger_11.png)
120+
121+
3. Scene
122+
123+
The presentation logic is the same as Device List.
124+
125+
![](../images/Trigger/img_trigger_12.png)
126+
59127

60128

61-
MCS supports customized webhook body message. You can also use the pre-defined variables. For the customized variables, please refer to the following paragraph.
62129

63-
# Use variables in notification message
130+
## Use variables in notification message
64131

65132
MCS provides pre-defined variables which can be used in both Title and Content fileds. These variables will be replaced with real values when the action is triggered. The pre-defined variables include:
66133

content/zh-CN/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,5 @@
6666
* [2.21](change_log/2.21.md)
6767
* [2.22](change_log/2.22.md)
6868
* [2.23](change_log/2.23.md)
69+
* [2.25](change_log/2.25.md)
6970

content/zh-CN/change_log/2.25.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 2018/07/25
2+
3+
## 新功能
4+
1.**触发动作**中,新增**网页警示**,当触发条件符合时,使用者能在网页上看到警示内容。[详细介绍](../tutorial/setting_notification)
5+
6+
7+
## 问题修复
8+
1. 在 MCS 网页或是手机应用程式操作资料通道时,有时候会触发两笔手机推播通知。

0 commit comments

Comments
 (0)