forked from CaskAle/iot-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSTSA-Workshop1-Bluemix-Flows.txt
1 lines (1 loc) · 4.39 KB
/
STSA-Workshop1-Bluemix-Flows.txt
1
[{"id":"9fe4f108.b44dd","type":"tab","label":"Bluemix IoT Flows"},{"id":"9de5e3b5.5493d","type":"ibmiot in","z":"9fe4f108.b44dd","authentication":"boundService","apiKey":"","inputType":"evt","deviceId":"","applicationId":"","deviceType":"","eventType":"environment","commandType":"","format":"json","name":"IoT : environment","service":"registered","allDevices":true,"allApplications":"","allDeviceTypes":true,"allEvents":false,"allCommands":"","allFormats":false,"qos":0,"x":100,"y":80,"wires":[["3d21fa87.be59c6","b3dc7d3.bc8fc8"]]},{"id":"3d21fa87.be59c6","type":"debug","z":"9fe4f108.b44dd","name":"debug : sensor data","active":false,"console":"false","complete":"true","x":380,"y":200,"wires":[]},{"id":"b3dc7d3.bc8fc8","type":"function","z":"9fe4f108.b44dd","name":"format : environment data for DB","func":"// Format Sensor Data for dashDB\nmsg.payload = {\n SENSORID : msg.deviceId,\n TEMPERATURE : msg.payload.d.temperature,\n HUMIDITY : msg.payload.d.humidity,\n PRESSURE : msg.payload.d.pressure,\n TIMESENT : 'TIMESTAMP'\n};\nreturn msg;","outputs":1,"noerr":0,"x":420,"y":80,"wires":[["7721f59c.d3346c","485c723a.3d8b7c"]]},{"id":"7721f59c.d3346c","type":"debug","z":"9fe4f108.b44dd","name":"debug : dashDB data","active":true,"console":"false","complete":"payload","x":720,"y":140,"wires":[]},{"id":"485c723a.3d8b7c","type":"dashDB out","z":"9fe4f108.b44dd","dashDB":"","service":"STSA-CaskAle-dashDB","table":"SENSEDATA","name":"dashDB","x":680,"y":80,"wires":[]},{"id":"8a0b61b5.d699f","type":"comment","z":"9fe4f108.b44dd","name":"Receive IoT events from Sense Hat","info":"","x":160,"y":40,"wires":[]},{"id":"5ac223fd.04d72c","type":"ibmiot in","z":"9fe4f108.b44dd","authentication":"boundService","apiKey":"","inputType":"evt","deviceId":"","applicationId":"","deviceType":"","eventType":"motion","commandType":"","format":"json","name":"IoT : motion","service":"registered","allDevices":true,"allApplications":"","allDeviceTypes":true,"allEvents":false,"allCommands":"","allFormats":"","qos":0,"x":90,"y":140,"wires":[["3d21fa87.be59c6"]]},{"id":"8eeb288d.9705a8","type":"ibmiot in","z":"9fe4f108.b44dd","authentication":"boundService","apiKey":"","inputType":"evt","deviceId":"","applicationId":"","deviceType":"+","eventType":"joystick","commandType":"","format":"json","name":"IoT : joystick","service":"registered","allDevices":true,"allApplications":"","allDeviceTypes":true,"allEvents":"","allCommands":"","allFormats":"","qos":0,"x":90,"y":200,"wires":[["3d21fa87.be59c6"]]},{"id":"ca376b26.84e9a8","type":"ibmiot out","z":"9fe4f108.b44dd","authentication":"boundService","apiKey":"","outputType":"cmd","deviceId":"TinySense","deviceType":"SenseHat","eventCommandType":"n/a","format":"json","data":"n/a","qos":0,"name":"IoT : commands","service":"registered","x":700,"y":320,"wires":[]},{"id":"fc31147f.b858b8","type":"inject","z":"9fe4f108.b44dd","name":"Green","topic":"alarm","payload":"green","payloadType":"str","repeat":"","crontab":"","once":false,"x":90,"y":360,"wires":[["92f44b42.0787c8"]]},{"id":"92f44b42.0787c8","type":"function","z":"9fe4f108.b44dd","name":"format : command test","func":"msg.eventOrCommandType = msg.topic;\nif (msg.topic == \"alarm\") { \n msg.payload={d:{color:msg.payload}};\n}\nelse if (msg.topic == \"message\") { \n msg.payload={d:{color:\"navy\",\n background:\"black\", \n message:msg.payload}};\n}\nelse msg = null;\nreturn msg;","outputs":1,"noerr":0,"x":380,"y":320,"wires":[["ca376b26.84e9a8","5303167e.9bdf88"]]},{"id":"a7142fa5.67696","type":"inject","z":"9fe4f108.b44dd","name":"Turn off LED","topic":"alarm","payload":"off","payloadType":"str","repeat":"","crontab":"","once":false,"x":110,"y":320,"wires":[["92f44b42.0787c8"]]},{"id":"5303167e.9bdf88","type":"debug","z":"9fe4f108.b44dd","name":"debug : IoT commands","active":true,"console":"false","complete":"true","x":730,"y":380,"wires":[]},{"id":"78064a84.b322f4","type":"inject","z":"9fe4f108.b44dd","name":"Send Message","topic":"message","payload":"Z","payloadType":"str","repeat":"","crontab":"","once":false,"x":120,"y":440,"wires":[["92f44b42.0787c8"]]},{"id":"e429d07c.c11fc","type":"comment","z":"9fe4f108.b44dd","name":"Send IoT commands to Sense Hat LED Matrix","info":"","x":190,"y":280,"wires":[]},{"id":"e54ff772.1db5b8","type":"inject","z":"9fe4f108.b44dd","name":"Red","topic":"alarm","payload":"red","payloadType":"str","repeat":"","crontab":"","once":false,"x":90,"y":400,"wires":[["92f44b42.0787c8"]]}]