-
Notifications
You must be signed in to change notification settings - Fork 0
/
node.txt
1 lines (1 loc) · 7.02 KB
/
node.txt
1
[{"id":"f91d577e.06e2a8","type":"http in","name":"","url":"/leds","method":"get","x":100,"y":318,"z":"1841639.fe7be9c","wires":[["1c2351f.fe3dcae"]]},{"id":"f8e0cf37.071f3","type":"http response","name":"hello","x":804.0000305175781,"y":344,"z":"1841639.fe7be9c","wires":[]},{"id":"22683275.dd97ce","type":"http in","name":"","url":"/hi","method":"get","x":99,"y":61,"z":"1841639.fe7be9c","wires":[["58d1936d.a72e6c","5945e42b.a6ba1c"]]},{"id":"58d1936d.a72e6c","type":"http response","name":"hi","x":307,"y":20,"z":"1841639.fe7be9c","wires":[]},{"id":"5945e42b.a6ba1c","type":"cloudant out","service":"Streetlights-cloudantNoSQLDB","cloudant":"","name":"","database":"ivalues3","payonly":true,"operation":"insert","x":316,"y":42,"z":"1841639.fe7be9c","wires":[]},{"id":"81599ea7.7ea66","type":"cloudant in","service":"streetlights-cloudantNoSQLDB","cloudant":"","name":"led Database","database":"leds","search":"_id_","design":"","index":"","x":486,"y":296,"z":"1841639.fe7be9c","wires":[["f0f29336.0f0d7"]]},{"id":"1c2351f.fe3dcae","type":"function","name":"","func":"var led = { payload: msg.payload.key };\nvar onstate={payload: msg.payload.on};\ncontext.global.http = msg;\nreturn [led,onstate];","outputs":"2","x":295,"y":318,"z":"1841639.fe7be9c","wires":[["81599ea7.7ea66"],[]]},{"id":"f0f29336.0f0d7","type":"function","name":"","func":"var key = { payload: msg.payload._id };\nvar on={payload: msg.payload.on};\n\nmsg = context.global.http;\n\nmsg.payload = \"{\\\"key\\\":\"+key.payload+\",\\\"on\\\":\\\"\"+on.payload+\"\\\"}\";\n//.payload = \"{key, on}\"\nmsg.statusCode=\"200\";\nreturn msg;","outputs":"1","x":663.0000305175781,"y":322,"z":"1841639.fe7be9c","wires":[["f8e0cf37.071f3"]]},{"id":"3a07ce3.fc5f832","type":"cloudant out","service":"streetlights-cloudantNoSQLDB","cloudant":"","name":"","database":"sensordata","payonly":false,"operation":"delete","x":858,"y":507,"z":"1841639.fe7be9c","wires":[]},{"id":"bbc50adf.443af8","type":"debug","name":"","active":false,"console":"false","complete":"true","x":842,"y":466,"z":"1841639.fe7be9c","wires":[]},{"id":"184f485b.e7b0b8","type":"http in","name":"","url":"/setleds","method":"get","x":88,"y":133,"z":"1841639.fe7be9c","wires":[["92b2bf13.6d4d4","866ec1f7.79914"]]},{"id":"92b2bf13.6d4d4","type":"http response","name":"hello","x":295,"y":84,"z":"1841639.fe7be9c","wires":[]},{"id":"74c81ee9.8b37e","type":"http in","name":"","url":"/sensorData","method":"post","x":112,"y":400,"z":"1841639.fe7be9c","wires":[["576b25ef.a894dc","a951525b.56aeb"]]},{"id":"521518cc.adeae8","type":"inject","name":"","topic":"","payload":"1bafe923f111b6956c930492c91af18b","payloadType":"string","repeat":"","crontab":"","once":false,"x":185,"y":561,"z":"1841639.fe7be9c","wires":[["ae9ba22f.51646"]]},{"id":"1b956c62.e46a94","type":"debug","name":"","active":false,"console":"false","complete":"payload","x":777,"y":553,"z":"1841639.fe7be9c","wires":[]},{"id":"ae9ba22f.51646","type":"cloudant in","service":"Streetlights-cloudantNoSQLDB","cloudant":"","name":"","database":"ivalues3","search":"_id_","design":"","index":"","x":385,"y":600,"z":"1841639.fe7be9c","wires":[["84a9a8f7.7b5658"]]},{"id":"84a9a8f7.7b5658","type":"function","name":"","func":"msg.payload = msg.payload.i\nreturn msg;","outputs":1,"x":566,"y":627,"z":"1841639.fe7be9c","wires":[["1b956c62.e46a94"]]},{"id":"557b59bf.aa84a8","type":"cloudant out","service":"streetlights-cloudantNoSQLDB","cloudant":"","name":"lightval","database":"sensordata","payonly":true,"operation":"insert","x":748,"y":402,"z":"1841639.fe7be9c","wires":[]},{"id":"b477df1d.4b882","type":"inject","name":"","topic":"","payload":"light","payloadType":"string","repeat":"","crontab":"","once":false,"x":138,"y":498,"z":"1841639.fe7be9c","wires":[[]]},{"id":"576b25ef.a894dc","type":"function","name":"f","func":"var tmpmsg = {};\n\ntmpmsg.payload = msg.payload;\nmsg.payload = \"light\";\nreturn [tmpmsg,msg];","outputs":"2","x":356,"y":411,"z":"1841639.fe7be9c","wires":[["9d830ce4.627cf"],["66cdfe81.9932","b3f28fa6.4c0d7"]]},{"id":"66cdfe81.9932","type":"cloudant in","service":"streetlights-cloudantNoSQLDB","cloudant":"","name":"","database":"sensordata","search":"_id_","design":"","index":"","x":537,"y":455,"z":"1841639.fe7be9c","wires":[["3b15395b.c4eac6"]]},{"id":"3b15395b.c4eac6","type":"function","name":"","func":"var rev = msg.payload._rev;\nvar hi = \"{\\\"_rev\\\":\\\"\"+rev+\"\\\",\\\"_id\\\":\\\"light\\\"}\";\nreturn hi;","outputs":1,"x":681,"y":483,"z":"1841639.fe7be9c","wires":[["bbc50adf.443af8","3a07ce3.fc5f832"]]},{"id":"9d830ce4.627cf","type":"delay","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":557,"y":404,"z":"1841639.fe7be9c","wires":[["557b59bf.aa84a8"]]},{"id":"b3f28fa6.4c0d7","type":"debug","name":"","active":false,"console":"false","complete":"payload","x":500,"y":527,"z":"1841639.fe7be9c","wires":[]},{"id":"a951525b.56aeb","type":"debug","name":"","active":false,"console":"false","complete":"false","x":294,"y":522,"z":"1841639.fe7be9c","wires":[]},{"id":"7cc2bc3d.833d44","type":"cloudant out","service":"streetlights-cloudantNoSQLDB","cloudant":"","name":"","database":"leds","payonly":false,"operation":"delete","x":758,"y":277,"z":"1841639.fe7be9c","wires":[]},{"id":"ccd6995d.332968","type":"debug","name":"","active":false,"console":"false","complete":"true","x":742,"y":236,"z":"1841639.fe7be9c","wires":[]},{"id":"aa46a154.55b96","type":"cloudant out","service":"streetlights-cloudantNoSQLDB","cloudant":"","name":"leds","database":"leds","payonly":true,"operation":"insert","x":648,"y":172,"z":"1841639.fe7be9c","wires":[]},{"id":"866ec1f7.79914","type":"function","name":"ff","func":"var tmpmsg = {};\n\ntmpmsg.payload = msg.payload;\nreturn [tmpmsg,msg];","outputs":"2","x":254,"y":169.99999809265137,"z":"1841639.fe7be9c","wires":[["bbd1792b.442e88"],["61cd950.f9e326c","734764e7.8cb89c"]]},{"id":"61cd950.f9e326c","type":"cloudant in","service":"streetlights-cloudantNoSQLDB","cloudant":"","name":"","database":"leds","search":"_id_","design":"","index":"","x":400,"y":218,"z":"1841639.fe7be9c","wires":[["6d048f3a.92fb7","5d4ea46c.a2b15c"]]},{"id":"6d048f3a.92fb7","type":"function","name":"","func":"var rev = msg.payload._rev;\nvar id = msg.payload._id;\nvar hi = \"{\\\"_rev\\\":\\\"\"+rev+\"\\\",\\\"_id\\\":\\\"\"+id+\"\\\"}\";\nreturn hi;","outputs":1,"x":584.0000305175781,"y":236,"z":"1841639.fe7be9c","wires":[["ccd6995d.332968","7cc2bc3d.833d44"]]},{"id":"bbd1792b.442e88","type":"delay","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":457,"y":174,"z":"1841639.fe7be9c","wires":[["aa46a154.55b96"]]},{"id":"5d4ea46c.a2b15c","type":"debug","name":"","active":true,"console":"true","complete":"payload","x":811.888916015625,"y":174.88888549804688,"z":"1841639.fe7be9c","wires":[]},{"id":"734764e7.8cb89c","type":"debug","name":"","active":false,"console":"true","complete":"payload","x":300.8888854980469,"y":255.88888549804688,"z":"1841639.fe7be9c","wires":[]}]