Skip to content

Commit 1ce9aff

Browse files
author
CloudFox
committed
updated import for MQTT commanding
1 parent 2f51832 commit 1ce9aff

File tree

4 files changed

+123
-88
lines changed

4 files changed

+123
-88
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Please note, that the json-files are exported from another tenant. So their migh
3030

3131
| Name | Description | Complexity Rating | Prerequisites |
3232
| --- | --- | --- | --- |
33-
| [Command MQTT devices connected via MindConnect](./commandMqttDevice_MindConnect/readme.md) | Send commands back to a device via MindConnect MQTT | :star: :star: | IoT Extension|
33+
| [Command MQTT devices connected via MindConnect](./commandMqttDevice_MindConnect/readme.md) | Send commands back to a device via MindConnect MQTT | :star: | MindConnect MQTT connected device |
3434
| [Command MQTT devices connected via IoT Extension](./commandMqttDevice_IoT-Extension/readme.md) | Send a command to a device via IoT Extension | :star: :star: | IoT Extension|
3535
| [Create custom API endpoints](./createCustomEndpoint/readme.md) | | :star: | - |
3636
| [Create rule for asset type](./createRuleForAssetType/readme.md) | Create a rule for all assets of this type | :star: | - |
File renamed without changes.

commandMqttDevice_MindConnect/IMPORT_commandMqttDevice.json

Lines changed: 0 additions & 87 deletions
This file was deleted.
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
[
2+
{
3+
"id": "e415ac9c.2a734",
4+
"type": "comment",
5+
"z": "cba45765.fb58c8",
6+
"name": "MindConnect MQTT - commading of a device",
7+
"info": "- sends a command to a device which is connected via MindConnect MQTT",
8+
"sticky": 1,
9+
"x": 360,
10+
"y": 1720,
11+
"wires": [],
12+
"readOnly": false,
13+
"userName": "CloudFoxUser",
14+
"tenant": "presiot"
15+
},
16+
{
17+
"id": "5d4d2d1e.1be5f4",
18+
"type": "comment",
19+
"z": "cba45765.fb58c8",
20+
"name": "adjust here:",
21+
"info": "- MQTT clientID(s)\n- commanding payload (data) for device",
22+
"sticky": 1,
23+
"x": 460,
24+
"y": 1820,
25+
"wires": [],
26+
"readOnly": false,
27+
"userName": "CloudFoxUser",
28+
"tenant": "presiot"
29+
},
30+
{
31+
"id": "6dadce05.535e5",
32+
"type": "debug",
33+
"z": "cba45765.fb58c8",
34+
"name": "",
35+
"active": true,
36+
"console": "false",
37+
"xaxis": "_time",
38+
"complete": "payload",
39+
"x": 970,
40+
"y": 1880,
41+
"wires": [],
42+
"readOnly": false,
43+
"userName": "CloudFoxUser",
44+
"tenant": "presiot"
45+
},
46+
{
47+
"id": "100131f0.458a6e",
48+
"type": "function",
49+
"z": "cba45765.fb58c8",
50+
"name": "edit clientID and data",
51+
"func": "/**in the body of the request, specify \n - clientID(s) which should received the command. Can be one or multiple clients\n - in the 'data' section, specify the command-payload to be send to the device. \n This will be received on the device at the command-subscription topic. \n \nExample: \n- tenant: presiot\n- device name: CloudFox-Laptop\n- clientID: presiot_CloudFox-Laptop\n- commanding topic: tc/presiot/presiot_CloudFox-Laptop/i/cmd_v3/c\n\n**/\nvar name = \"a commanding information for my device\";\nvar clientIDs = [\"presiot_CloudFox-Laptop\"]; \nvar commandingData = {\n \"configuration\": \"sample config v1.4.3\",\n \"data\": \"hello world\",\n \"INTvalue\": 5,\n \"light-status\": true,\n \"motor_rpm_setpoint\": 1200.5\n }\n\n//setup body for commanding request\nmsg.payload = {\n \"name\": name,\n \"clientIds\": clientIDs,\n \"data\": commandingData\n}\nreturn msg;",
52+
"outputs": 1,
53+
"language": "javascript",
54+
"noerr": 0,
55+
"x": 400,
56+
"y": 1880,
57+
"wires": [
58+
[
59+
"21c0aab9.b71656"
60+
]
61+
],
62+
"readOnly": false,
63+
"userName": "CloudFoxUser",
64+
"tenant": "presiot"
65+
},
66+
{
67+
"id": "21c0aab9.b71656",
68+
"type": "http request",
69+
"z": "cba45765.fb58c8",
70+
"name": "command to device",
71+
"method": "POST",
72+
"ret": "txt",
73+
"url": "",
74+
"timeout": "",
75+
"mindspherePath": "/api/commanding/v3/deliveryJobs",
76+
"useMindsphereAuth": true,
77+
"isAdmin": false,
78+
"userSecrets": "",
79+
"secretHeaders": "",
80+
"x": 770,
81+
"y": 1880,
82+
"wires": [
83+
[
84+
"6dadce05.535e5"
85+
]
86+
],
87+
"readOnly": false,
88+
"userName": "CloudFoxUser",
89+
"tenant": "presiot"
90+
},
91+
{
92+
"id": "8bd21774.9b5778",
93+
"type": "inject",
94+
"z": "cba45765.fb58c8",
95+
"name": "",
96+
"topic": "",
97+
"payload": "",
98+
"payloadType": "date",
99+
"repeat": "",
100+
"repeatEnd": "0",
101+
"endTime": "0",
102+
"crontab": "",
103+
"offset": "NaN",
104+
"once": false,
105+
"properties": "",
106+
"timezone": "utc",
107+
"betweentimesunit": "m",
108+
"enableRuleEngine": false,
109+
"showNextExecution": false,
110+
"powerMode": false,
111+
"x": 180,
112+
"y": 1880,
113+
"wires": [
114+
[
115+
"100131f0.458a6e"
116+
]
117+
],
118+
"readOnly": false,
119+
"userName": "CloudFoxUser",
120+
"tenant": "presiot"
121+
}
122+
]

0 commit comments

Comments
 (0)