· 6 years ago · Jan 07, 2020, 07:40 AM
1[
2 {
3 "id": "173c5dba.da9582",
4 "type": "tab",
5 "label": "Flow 1",
6 "disabled": false,
7 "info": ""
8 },
9 {
10 "id": "ccd1ab3f.0ba058",
11 "type": "function",
12 "z": "173c5dba.da9582",
13 "name": "temp",
14 "func": "return{payload:msg.payload.d.temp};",
15 "outputs": 1,
16 "noerr": 0,
17 "x": 390,
18 "y": 260,
19 "wires": [
20 [
21 "50930bc7.be51fc",
22 "481cbf7b.b0001",
23 "901cffbc.1fa138",
24 "eab40dd3.50d308"
25 ]
26 ]
27 },
28 {
29 "id": "50930bc7.be51fc",
30 "type": "switch",
31 "z": "173c5dba.da9582",
32 "name": "temp thresh",
33 "property": "payload",
34 "propertyType": "msg",
35 "rules": [
36 {
37 "t": "lte",
38 "v": "40",
39 "vt": "str"
40 },
41 {
42 "t": "gt",
43 "v": "40",
44 "vt": "str"
45 }
46 ],
47 "checkall": "true",
48 "repair": false,
49 "outputs": 2,
50 "x": 539,
51 "y": 261,
52 "wires": [
53 [
54 "3e5902ca.99aa56"
55 ],
56 [
57 "e09b5192.222f4"
58 ]
59 ]
60 },
61 {
62 "id": "23431960.c91046",
63 "type": "debug",
64 "z": "173c5dba.da9582",
65 "name": "cpustatus",
66 "active": true,
67 "tosidebar": true,
68 "complete": "false",
69 "x": 1140,
70 "y": 280,
71 "wires": []
72 },
73 {
74 "id": "344a115b.ac8696",
75 "type": "debug",
76 "z": "173c5dba.da9582",
77 "name": "device data",
78 "active": true,
79 "tosidebar": true,
80 "console": false,
81 "tostatus": false,
82 "complete": "payload",
83 "targetType": "msg",
84 "x": 390,
85 "y": 171,
86 "wires": []
87 },
88 {
89 "id": "3e5902ca.99aa56",
90 "type": "template",
91 "z": "173c5dba.da9582",
92 "name": "safe",
93 "field": "payload",
94 "fieldType": "msg",
95 "syntax": "mustache",
96 "template": "Temperature({{payload}}) within safe limits",
97 "x": 703,
98 "y": 212,
99 "wires": [
100 [
101 "244768be.8c7ee"
102 ]
103 ]
104 },
105 {
106 "id": "e09b5192.222f4",
107 "type": "template",
108 "z": "173c5dba.da9582",
109 "name": "danger",
110 "field": "payload",
111 "fieldType": "msg",
112 "syntax": "mustache",
113 "template": "Temperature ({{payload}}) critical",
114 "x": 702,
115 "y": 306,
116 "wires": [
117 [
118 "244768be.8c7ee"
119 ]
120 ]
121 },
122 {
123 "id": "7ece4b9d.830204",
124 "type": "ibmiot in",
125 "z": "173c5dba.da9582",
126 "authentication": "quickstart",
127 "apiKey": "",
128 "inputType": "evt",
129 "logicalInterface": "",
130 "ruleId": "",
131 "deviceId": "97744390927a",
132 "applicationId": "",
133 "deviceType": "+",
134 "eventType": "+",
135 "commandType": "",
136 "format": "json",
137 "name": "John Cena Sensor",
138 "service": "quickstart",
139 "allDevices": "",
140 "allApplications": "",
141 "allDeviceTypes": true,
142 "allLogicalInterfaces": false,
143 "allEvents": true,
144 "allCommands": "",
145 "allFormats": "",
146 "qos": "0",
147 "x": 186,
148 "y": 265,
149 "wires": [
150 [
151 "344a115b.ac8696",
152 "ccd1ab3f.0ba058",
153 "7589ad92.bd35cc",
154 "1f7ff3a5.31922c",
155 "26318c35.338894"
156 ]
157 ]
158 },
159 {
160 "id": "481cbf7b.b0001",
161 "type": "cloudant out",
162 "z": "173c5dba.da9582",
163 "name": "CenaBase",
164 "cloudant": "",
165 "database": "CenaBase",
166 "service": "IoT G2 first app-cloudantNoSQLDB",
167 "payonly": false,
168 "operation": "insert",
169 "x": 590,
170 "y": 380,
171 "wires": []
172 },
173 {
174 "id": "244768be.8c7ee",
175 "type": "watson-translator",
176 "z": "173c5dba.da9582",
177 "name": "CenaTranslate",
178 "action": "translate",
179 "basemodel": "en-tr",
180 "domain": "general",
181 "srclang": "en",
182 "destlang": "it",
183 "password": "",
184 "apikey": "",
185 "custom": "",
186 "domainhidden": "general",
187 "srclanghidden": "en",
188 "destlanghidden": "it",
189 "basemodelhidden": "en-tr",
190 "customhidden": "",
191 "filetype": "forcedglossary",
192 "trainid": "",
193 "lgparams2": true,
194 "neural": false,
195 "default-endpoint": true,
196 "service-endpoint": "https://gateway.watsonplatform.net/language-translator/api",
197 "x": 920,
198 "y": 260,
199 "wires": [
200 [
201 "23431960.c91046",
202 "ab5a5d09.054848"
203 ]
204 ]
205 },
206 {
207 "id": "901cffbc.1fa138",
208 "type": "ui_gauge",
209 "z": "173c5dba.da9582",
210 "name": "",
211 "group": "b2303f15.1d503",
212 "order": 1,
213 "width": 0,
214 "height": 0,
215 "gtype": "gage",
216 "title": "Temperature",
217 "label": "°C",
218 "format": "{{value}}",
219 "min": "-10",
220 "max": "60",
221 "colors": [
222 "#00b500",
223 "#e6e600",
224 "#ca3838"
225 ],
226 "seg1": "30",
227 "seg2": "40",
228 "x": 390,
229 "y": 520,
230 "wires": []
231 },
232 {
233 "id": "1f7ff3a5.31922c",
234 "type": "function",
235 "z": "173c5dba.da9582",
236 "name": "Humidity",
237 "func": "return{payload:msg.payload.d.humidity,topic:'Humidity'};",
238 "outputs": 1,
239 "noerr": 0,
240 "x": 240,
241 "y": 600,
242 "wires": [
243 [
244 "a6b14cb7.130918",
245 "eab40dd3.50d308"
246 ]
247 ]
248 },
249 {
250 "id": "7589ad92.bd35cc",
251 "type": "function",
252 "z": "173c5dba.da9582",
253 "name": "Object Temperature",
254 "func": "return{payload:msg.payload.d.objectTemp,topic:'Object temperature'};",
255 "outputs": 1,
256 "noerr": 0,
257 "x": 230,
258 "y": 720,
259 "wires": [
260 [
261 "eab40dd3.50d308",
262 "abc32f5b.1cc33"
263 ]
264 ]
265 },
266 {
267 "id": "a6b14cb7.130918",
268 "type": "ui_gauge",
269 "z": "173c5dba.da9582",
270 "name": "",
271 "group": "7809a163.8b785",
272 "order": 1,
273 "width": 0,
274 "height": 0,
275 "gtype": "gage",
276 "title": "Humidity",
277 "label": "units",
278 "format": "{{value}}",
279 "min": 0,
280 "max": "100",
281 "colors": [
282 "#00b500",
283 "#e6e600",
284 "#ca3838"
285 ],
286 "seg1": "",
287 "seg2": "",
288 "x": 400,
289 "y": 640,
290 "wires": []
291 },
292 {
293 "id": "eab40dd3.50d308",
294 "type": "ui_chart",
295 "z": "173c5dba.da9582",
296 "name": "",
297 "group": "271b1766.ce053",
298 "order": 2,
299 "width": "30",
300 "height": "5",
301 "label": "",
302 "chartType": "line",
303 "legend": "false",
304 "xformat": "HH:mm:ss",
305 "interpolate": "linear",
306 "nodata": "",
307 "dot": false,
308 "ymin": "0",
309 "ymax": "100",
310 "removeOlder": 1,
311 "removeOlderPoints": "100",
312 "removeOlderUnit": "3600",
313 "cutout": 0,
314 "useOneColor": false,
315 "colors": [
316 "#1f77b4",
317 "#aec7e9",
318 "#ff7f0e",
319 "#2ca02c",
320 "#98df8a",
321 "#d62728",
322 "#ff9896",
323 "#9467bd",
324 "#c5b0d5"
325 ],
326 "useOldStyle": false,
327 "outputs": 2,
328 "x": 690,
329 "y": 600,
330 "wires": [
331 [],
332 []
333 ]
334 },
335 {
336 "id": "abc32f5b.1cc33",
337 "type": "ui_gauge",
338 "z": "173c5dba.da9582",
339 "name": "",
340 "group": "dc369e1c.436d2",
341 "order": 2,
342 "width": 0,
343 "height": 0,
344 "gtype": "gage",
345 "title": "Object Temperature",
346 "label": "°C",
347 "format": "{{value}}",
348 "min": 0,
349 "max": "100",
350 "colors": [
351 "#00b500",
352 "#e6e600",
353 "#ca3838"
354 ],
355 "seg1": "80",
356 "seg2": "95",
357 "x": 430,
358 "y": 780,
359 "wires": []
360 },
361 {
362 "id": "ab5a5d09.054848",
363 "type": "function",
364 "z": "173c5dba.da9582",
365 "name": "Test Text Change",
366 "func": "\nvar PrevMsg = context.get('PrevMsg') || \"\";\n\nif (msg.payload === PrevMsg) {\n msg.payload = \" \";\n} else {\n context.set(\"PrevMsg\", msg.payload); \n}\nreturn msg;",
367 "outputs": 1,
368 "noerr": 0,
369 "x": 890,
370 "y": 480,
371 "wires": [
372 [
373 "a5a0b434.63429",
374 "8162993b.9414c8"
375 ]
376 ]
377 },
378 {
379 "id": "a5a0b434.63429",
380 "type": "debug",
381 "z": "173c5dba.da9582",
382 "name": "",
383 "active": true,
384 "tosidebar": true,
385 "console": false,
386 "tostatus": false,
387 "complete": "false",
388 "x": 1090,
389 "y": 540,
390 "wires": []
391 },
392 {
393 "id": "8b4dd47a.40dce8",
394 "type": "ui_audio",
395 "z": "173c5dba.da9582",
396 "name": "",
397 "group": "271b1766.ce053",
398 "voice": "it",
399 "always": true,
400 "x": 1300,
401 "y": 420,
402 "wires": []
403 },
404 {
405 "id": "8162993b.9414c8",
406 "type": "watson-text-to-speech",
407 "z": "173c5dba.da9582",
408 "name": "TextToCena",
409 "lang": "it-IT",
410 "langhidden": "it-IT",
411 "langcustom": "NoCustomisationSetting",
412 "langcustomhidden": "",
413 "voice": "it-IT_FrancescaV3Voice",
414 "voicehidden": "es-US_SofiaV3Voice",
415 "format": "audio/wav",
416 "password": "",
417 "apikey": "",
418 "payload-response": true,
419 "service-endpoint": "",
420 "x": 1090,
421 "y": 420,
422 "wires": [
423 [
424 "8b4dd47a.40dce8"
425 ]
426 ]
427 },
428 {
429 "id": "26318c35.338894",
430 "type": "function",
431 "z": "173c5dba.da9582",
432 "name": "Format Device Payload",
433 "func": "// Create MQTT message in JSON\nmsg = {\n payload: JSON.stringify({\n d:{\n \"temp\" : msg.payload.d.temp,\n \"humidity\" : msg.payload.d.humidity,\n \"objectTemp\": msg.payload.d.objectTemp\n \n }\n })\n};\nreturn msg;",
434 "outputs": 1,
435 "noerr": 0,
436 "x": 370,
437 "y": 80,
438 "wires": [
439 [
440 "428aa503.018754"
441 ]
442 ]
443 },
444 {
445 "id": "428aa503.018754",
446 "type": "ibmiot out",
447 "z": "173c5dba.da9582",
448 "authentication": "boundService",
449 "apiKey": "b152847c.5f049",
450 "outputType": "evt",
451 "deviceId": "Sensor1",
452 "deviceType": "CenaSensor",
453 "eventCommandType": "update",
454 "format": "json",
455 "data": "{d:{“temp\":28,\"humidity\":79,\"objectTemp\":24}}",
456 "qos": 0,
457 "name": "IBM IoT",
458 "service": "registered",
459 "x": 580,
460 "y": 80,
461 "wires": []
462 },
463 {
464 "id": "b2303f15.1d503",
465 "type": "ui_group",
466 "z": "",
467 "name": "Temperature",
468 "tab": "89815996.0c7258",
469 "order": 1,
470 "disp": true,
471 "width": "11",
472 "collapse": false
473 },
474 {
475 "id": "7809a163.8b785",
476 "type": "ui_group",
477 "z": "",
478 "name": "Humidity",
479 "tab": "89815996.0c7258",
480 "order": 2,
481 "disp": true,
482 "width": "11",
483 "collapse": false
484 },
485 {
486 "id": "271b1766.ce053",
487 "type": "ui_group",
488 "z": "",
489 "name": "Chart",
490 "tab": "89815996.0c7258",
491 "order": 4,
492 "disp": true,
493 "width": "33",
494 "collapse": false
495 },
496 {
497 "id": "dc369e1c.436d2",
498 "type": "ui_group",
499 "z": "",
500 "name": "Object Temperature",
501 "tab": "89815996.0c7258",
502 "order": 3,
503 "disp": true,
504 "width": "11",
505 "collapse": false
506 },
507 {
508 "id": "b152847c.5f049",
509 "type": "ibmiot",
510 "z": "",
511 "name": "watson api key",
512 "keepalive": "60",
513 "serverName": "https://b7ctoa.internetofthings.ibmcloud.com",
514 "cleansession": true,
515 "appId": "b7ctoa",
516 "shared": false
517 },
518 {
519 "id": "89815996.0c7258",
520 "type": "ui_tab",
521 "z": "",
522 "name": "IoT sensor",
523 "icon": "dashboard",
524 "order": 3
525 }
526]