-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
172 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,172 @@ | ||
[{"id":"cb57872b.b46508","type":"ibmiot in","z":"fa8482a6.16ee5","authentication":"quickstart","apiKey":"","inputType":"evt","deviceId":"virtualdevice-117540092104722525225-default","applicationId":"","deviceType":"+","eventType":"+","commandType":"","format":"json","name":"My Virtual Sensors","service":"quickstart","allDevices":"","allApplications":"","allDeviceTypes":true,"allEvents":true,"allCommands":"","allFormats":"","qos":0,"x":240,"y":313.33323669433594,"wires":[["8a3dc070.bc463"]]},{"id":"8a3dc070.bc463","type":"switch","z":"fa8482a6.16ee5","name":"Read the sensor data","property":"payload.name","propertyType":"msg","rules":[{"t":"eq","v":"CO2_sensor","vt":"str"},{"t":"eq","v":"Noise_sensor","vt":"str"}],"checkall":"true","outputs":2,"x":346.9999542236328,"y":188,"wires":[["f750a14e.15c1c"],["224c3caa.c682c4"]]},{"id":"f750a14e.15c1c","type":"function","z":"fa8482a6.16ee5","name":"Check CO_2 Levels","func":"var mp = msg.payload\nvar a = {value:0,payload:\"\"};\nif (mp.value > 400) {\n a.payload= 'Carbon dioxide level exceeded 400 ppm.'+'\\n'+'CO_2 Reading:'+mp.value+ ' ppm';\n a.topic='Sensor Alert'\n return a; } \nelse {\n a.payload='ppm smaller';\n } \n\n\n\n","outputs":1,"noerr":0,"x":491,"y":52,"wires":[["580f3965.b2da18","2f220a05.1a27b6"]]},{"id":"224c3caa.c682c4","type":"function","z":"fa8482a6.16ee5","name":"Check Noise Levels","func":"var mp = msg.payload\nvar a = {value:0,payload:\"\"};\n\nif (mp.value > 85)\n {\n a.payload= 'Noise level exceeded 85 dB. '+'\\n'+'Noise Reading:'+mp.value+' dB';\n a.topic = 'Sensor Alert'\n return a;\n } \nelse {\n a.payload='Below Harmful Noise';\n } \n\n\n\n\n","outputs":1,"noerr":0,"x":496.9999694824219,"y":87.99998474121094,"wires":[["580f3965.b2da18","2f220a05.1a27b6"]]},{"id":"5af3140a.feb70c","type":"e-mail","z":"fa8482a6.16ee5","server":"smtp.gmail.com","port":"465","name":"naikrushin@gmail.com","dname":"recepient 1","x":766.9999847412109,"y":213.33323669433594,"wires":[]},{"id":"580f3965.b2da18","type":"debug","z":"fa8482a6.16ee5","name":"Show Alert Message","active":true,"console":"false","complete":"payload","x":753.8332977294922,"y":74,"wires":[]},{"id":"df6ea5b8.44d848","type":"e-mail","z":"fa8482a6.16ee5","server":"smtp.gmail.com","port":"465","name":"rsn_174@outlook.com","dname":"recepient 2","x":767.8332939147949,"y":282.3332977294922,"wires":[]},{"id":"b5b0efa.618281","type":"e-mail","z":"fa8482a6.16ee5","server":"smtp.gmail.com","port":"465","name":"naikrushin@gmail.com","dname":"recepient 3","x":771.8332939147949,"y":360.3332977294922,"wires":[]},{"id":"2f220a05.1a27b6","type":"function","z":"fa8482a6.16ee5","name":"Forward Alert Messages","func":"\nreturn msg;","outputs":1,"noerr":0,"x":441.8333435058594,"y":427.66661071777344,"wires":[["5af3140a.feb70c","df6ea5b8.44d848","b5b0efa.618281"]]}] | ||
[ | ||
{ | ||
"id": "cb57872b.b46508", | ||
"type": "ibmiot in", | ||
"z": "fa8482a6.16ee5", | ||
"authentication": "quickstart", | ||
"apiKey": "", | ||
"inputType": "evt", | ||
"deviceId": "virtualdevice-117540092104722525225-default", | ||
"applicationId": "", | ||
"deviceType": "+", | ||
"eventType": "+", | ||
"commandType": "", | ||
"format": "json", | ||
"name": "My Virtual Sensors", | ||
"service": "quickstart", | ||
"allDevices": "", | ||
"allApplications": "", | ||
"allDeviceTypes": true, | ||
"allEvents": true, | ||
"allCommands": "", | ||
"allFormats": "", | ||
"qos": 0, | ||
"x": 240, | ||
"y": 313.33323669433594, | ||
"wires": [ | ||
[ | ||
"8a3dc070.bc463" | ||
] | ||
] | ||
}, | ||
{ | ||
"id": "8a3dc070.bc463", | ||
"type": "switch", | ||
"z": "fa8482a6.16ee5", | ||
"name": "Read the sensor data", | ||
"property": "payload.name", | ||
"propertyType": "msg", | ||
"rules": [ | ||
{ | ||
"t": "eq", | ||
"v": "CO2_sensor", | ||
"vt": "str" | ||
}, | ||
{ | ||
"t": "eq", | ||
"v": "Noise_sensor", | ||
"vt": "str" | ||
} | ||
], | ||
"checkall": "true", | ||
"outputs": 2, | ||
"x": 346.9999542236328, | ||
"y": 188, | ||
"wires": [ | ||
[ | ||
"f750a14e.15c1c" | ||
], | ||
[ | ||
"224c3caa.c682c4" | ||
] | ||
] | ||
}, | ||
{ | ||
"id": "f750a14e.15c1c", | ||
"type": "function", | ||
"z": "fa8482a6.16ee5", | ||
"name": "Check CO_2 Levels", | ||
"func": "var mp = msg.payload\nvar a = {value:0,payload:\"\"};\nif (mp.value > 400) {\n a.payload= 'Carbon dioxide level exceeded 400 ppm.'+'\\n'+'CO_2 Reading:'+mp.value+ ' ppm';\n a.topic='Sensor Alert'\n return a; } \nelse {\n a.payload='ppm smaller';\n } \n\n\n\n", | ||
"outputs": 1, | ||
"noerr": 0, | ||
"x": 491, | ||
"y": 52, | ||
"wires": [ | ||
[ | ||
"580f3965.b2da18", | ||
"2f220a05.1a27b6" | ||
] | ||
] | ||
}, | ||
{ | ||
"id": "224c3caa.c682c4", | ||
"type": "function", | ||
"z": "fa8482a6.16ee5", | ||
"name": "Check Noise Levels", | ||
"func": "var mp = msg.payload\nvar a = {value:0,payload:\"\"};\n\nif (mp.value > 85)\n {\n a.payload= 'Noise level exceeded 85 dB. '+'\\n'+'Noise Reading:'+mp.value+' dB';\n a.topic = 'Sensor Alert'\n return a;\n } \nelse {\n a.payload='Below Harmful Noise';\n } \n\n\n\n\n", | ||
"outputs": 1, | ||
"noerr": 0, | ||
"x": 496.9999694824219, | ||
"y": 87.99998474121094, | ||
"wires": [ | ||
[ | ||
"580f3965.b2da18", | ||
"2f220a05.1a27b6" | ||
] | ||
] | ||
}, | ||
{ | ||
"id": "5af3140a.feb70c", | ||
"type": "e-mail", | ||
"z": "fa8482a6.16ee5", | ||
"server": "smtp.gmail.com", | ||
"port": "465", | ||
"name": "naikrushin@gmail.com", | ||
"dname": "recepient 1", | ||
"x": 766.9999847412109, | ||
"y": 213.33323669433594, | ||
"wires": [ | ||
|
||
] | ||
}, | ||
{ | ||
"id": "580f3965.b2da18", | ||
"type": "debug", | ||
"z": "fa8482a6.16ee5", | ||
"name": "Show Alert Message", | ||
"active": true, | ||
"console": "false", | ||
"complete": "payload", | ||
"x": 753.8332977294922, | ||
"y": 74, | ||
"wires": [ | ||
|
||
] | ||
}, | ||
{ | ||
"id": "df6ea5b8.44d848", | ||
"type": "e-mail", | ||
"z": "fa8482a6.16ee5", | ||
"server": "smtp.gmail.com", | ||
"port": "465", | ||
"name": "rsn_174@outlook.com", | ||
"dname": "recepient 2", | ||
"x": 767.8332939147949, | ||
"y": 282.3332977294922, | ||
"wires": [ | ||
|
||
] | ||
}, | ||
{ | ||
"id": "b5b0efa.618281", | ||
"type": "e-mail", | ||
"z": "fa8482a6.16ee5", | ||
"server": "smtp.gmail.com", | ||
"port": "465", | ||
"name": "naikrushin@gmail.com", | ||
"dname": "recepient 3", | ||
"x": 771.8332939147949, | ||
"y": 360.3332977294922, | ||
"wires": [ | ||
|
||
] | ||
}, | ||
{ | ||
"id": "2f220a05.1a27b6", | ||
"type": "function", | ||
"z": "fa8482a6.16ee5", | ||
"name": "Forward Alert Messages", | ||
"func": "\nreturn msg;", | ||
"outputs": 1, | ||
"noerr": 0, | ||
"x": 441.8333435058594, | ||
"y": 427.66661071777344, | ||
"wires": [ | ||
[ | ||
"5af3140a.feb70c", | ||
"df6ea5b8.44d848", | ||
"b5b0efa.618281" | ||
] | ||
] | ||
} | ||
] |