forked from avrahams/elevator-simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Node-RED-Action-flow.json
1 lines (1 loc) · 1.77 KB
/
Node-RED-Action-flow.json
1
[{"id":"c007a43b.ec9808","type":"debug","z":"67f6e691.542dc8","name":"","active":true,"console":"false","complete":"false","x":704.765625,"y":105.00001525878906,"wires":[]},{"id":"3671da7d.5c3e46","type":"http in","z":"67f6e691.542dc8","name":"Action Receiver","url":"/action","method":"post","swaggerDoc":"","x":165.76560974121094,"y":131,"wires":[["55b76707.08c268","56344857.3120f8","1450cde3.97bc02"]]},{"id":"36a24d8a.3d2212","type":"ibmiot out","z":"67f6e691.542dc8","authentication":"apiKey","apiKey":"35fcbc9f.e98294","outputType":"cmd","deviceId":"frompayload","deviceType":"0.14.6","eventCommandType":"frompayload","format":"json","data":"{}","qos":"2","name":"IBM IoT","service":"registered","x":681.0655822753906,"y":214.80004119873047,"wires":[]},{"id":"1450cde3.97bc02","type":"function","z":"67f6e691.542dc8","name":"Prepare Maintenance command","func":"var orgId = msg.payload.orgId;\nvar clientId = msg.payload.deviceId;\n\nvar deviceType = clientId.split(':')[1];\nvar deviceId = clientId.split(':')[2];\nvar rule = msg.payload;\n\nvar msg = {\n payload: {\n \"reason\": rule.ruleName,\n \"stop\":true\n },\n deviceId: deviceId,\n deviceType: deviceType,\n eventOrCommandType: \"maintenance_command\"\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":447.06561279296875,"y":206.20001220703125,"wires":[["36a24d8a.3d2212","c007a43b.ec9808"]]},{"id":"55b76707.08c268","type":"http response","z":"67f6e691.542dc8","name":"Action Response","x":291.6822814941406,"y":63,"wires":[]},{"id":"56344857.3120f8","type":"debug","z":"67f6e691.542dc8","name":"","active":true,"console":"false","complete":"false","x":304.37890625,"y":258.5,"wires":[]},{"id":"35fcbc9f.e98294","type":"ibmiot","z":"","name":"yq8qg5","keepalive":"60","cleansession":true,"appId":"1234","shared":true}]