thingsmobile/flows-nodered.json
2021-07-11 14:19:47 +00:00

1 line
12 KiB
JSON

[{"id":"c13b628d.15ca2","type":"tab","label":"Things Mobile","disabled":false,"info":""},{"id":"bb7f1af3.ad7df8","type":"function","z":"c13b628d.15ca2","name":"SIM Liste","func":"/* working curl...\ncurl -i -X POST -H “Content-Type: multipart/form-data” -F “upload=@/Users/al/artwork/pacman.gif” -F “upload-type=ANIMATED_GIF” -F “console=MAME” -F “displaynow=1”\n*/\nvar g_username = global.get('g_username') || 0;\nvar g_token = global.get('g_token') || 0;\n//set msg.headers to an {object} with property \"Content-Type\" set to \"multipart/form-data\"\nmsg.headers = {\n \"Content-Type\": \"multipart/form-data\" \n}\n \n//set payload to an {object} with properties and values\nmsg.payload = {\n \"username\": g_username,\n \"token\": g_token\n \n}; \n\n//set url\nmsg.url = \"https://api.thingsmobile.com/services/business-api/simListLite\"\n\n// return the msg to next node (the http request)\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":400,"y":240,"wires":[["2a16909e.64bbf"]]},{"id":"e2e9f5bb.79a668","type":"inject","z":"c13b628d.15ca2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"0 0 * * *","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":250,"y":240,"wires":[["bb7f1af3.ad7df8"]]},{"id":"2a16909e.64bbf","type":"http request","z":"c13b628d.15ca2","name":"","method":"POST","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":570,"y":240,"wires":[["e36102ed.6a8548"]]},{"id":"4209b9dd.0c7928","type":"debug","z":"c13b628d.15ca2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":970,"y":240,"wires":[]},{"id":"e36102ed.6a8548","type":"xml","z":"c13b628d.15ca2","name":"","property":"payload","attr":"","chr":"","x":750,"y":240,"wires":[["155f778b.420dc","4209b9dd.0c7928"]]},{"id":"486c2e92.063708","type":"function","z":"c13b628d.15ca2","name":"","func":"var load = msg.payload.result.sims[0].sim[2].balance[0];\nvar status = msg.payload.result.sims[0].sim[2].status[0];\nvar msisdn = msg.payload.result.sims[0].sim[2].msisdn[0];\nvar traffic = msg.payload.result.sims[0].sim[2].dailyTraffic[0];\nvar type = msg.payload.result.sims[0].sim[2].type[0];\n\nvar load1 = (load/1000000).toFixed(2);\nvar msg1 = { payload: load1 };\nvar msg2 = { payload: status };\nvar msg3 = { payload: msisdn };\nvar msg4 = { payload: traffic };\nvar msg5 = { payload: type };\nreturn [ msg1, msg2, msg3, msg4, msg5 ];","outputs":5,"noerr":0,"initialize":"","finalize":"","x":320,"y":360,"wires":[["49abbe2c.50b3b"],["1ba9d3f4.00bab4"],["5db9d024.6e7a68"],["fe41ff21.e1268"],["3e54be29.5cffda"]]},{"id":"155f778b.420dc","type":"link out","z":"c13b628d.15ca2","name":"","links":["12c3159f.45fcfa","da3ed9e5.74bfb8","43479429.e38404"],"x":855,"y":240,"wires":[]},{"id":"12c3159f.45fcfa","type":"link in","z":"c13b628d.15ca2","name":"","links":["155f778b.420dc","51706310.acb04c"],"x":195,"y":360,"wires":[["486c2e92.063708"]]},{"id":"49abbe2c.50b3b","type":"ui_text","z":"c13b628d.15ca2","group":"7f7a22fa.dbc0d4","order":3,"width":0,"height":0,"name":"Karte 3","label":"Rest Datenvolumen: ","format":"{{msg.payload}} MB","layout":"row-spread","x":510,"y":320,"wires":[]},{"id":"7545ec08.3b9ae4","type":"function","z":"c13b628d.15ca2","name":"","func":"var load = msg.payload.result.sims[0].sim[0].balance[0];\nvar status = msg.payload.result.sims[0].sim[0].status[0];\nvar msisdn = msg.payload.result.sims[0].sim[0].msisdn[0];\nvar traffic = msg.payload.result.sims[0].sim[0].dailyTraffic[0];\nvar type = msg.payload.result.sims[0].sim[0].type[0];\n\nvar load1 = (load/1000000).toFixed(2);\nvar msg1 = { payload: load1 };\nvar msg2 = { payload: status };\nvar msg3 = { payload: msisdn };\nvar msg4 = { payload: traffic };\nvar msg5 = { payload: type };\nreturn [ msg1, msg2, msg3, msg4, msg5 ];","outputs":5,"noerr":0,"initialize":"","finalize":"","x":320,"y":620,"wires":[["6809b17f.868c9"],["e1597f4e.c17128"],["466f4dab.271e34"],["3ddbe2be.a9385e"],["27f96db2.f35eda"]]},{"id":"da3ed9e5.74bfb8","type":"link in","z":"c13b628d.15ca2","name":"","links":["155f778b.420dc","51706310.acb04c"],"x":175,"y":620,"wires":[["7545ec08.3b9ae4"]]},{"id":"6809b17f.868c9","type":"ui_text","z":"c13b628d.15ca2","group":"8bcc8038.ee0c68","order":3,"width":0,"height":0,"name":"Karte 1","label":"Rest Datenvolumen: ","format":"{{msg.payload}} MB","layout":"row-spread","x":480,"y":600,"wires":[]},{"id":"42ead522.81b33c","type":"function","z":"c13b628d.15ca2","name":"","func":"var load = msg.payload.result.sims[0].sim[1].balance[0];\nvar status = msg.payload.result.sims[0].sim[1].status[0];\nvar msisdn = msg.payload.result.sims[0].sim[1].msisdn[0];\nvar traffic = msg.payload.result.sims[0].sim[1].dailyTraffic[0];\nvar type = msg.payload.result.sims[0].sim[1].type[0];\n\nvar load1 = (load/1000000).toFixed(2);\nvar msg1 = { payload: load1 };\nvar msg2 = { payload: status };\nvar msg3 = { payload: msisdn };\nvar msg4 = { payload: traffic };\nvar msg5 = { payload: type };\nreturn [ msg1, msg2, msg3, msg4, msg5 ];\n","outputs":5,"noerr":0,"initialize":"","finalize":"","x":840,"y":340,"wires":[["725ac2ab.819efc"],["4a9c8cd3.caee6c"],["6015a1be.f3e3b"],["e5886e2a.ca7448"],["6d7ef015.6e673"]]},{"id":"43479429.e38404","type":"link in","z":"c13b628d.15ca2","name":"","links":["155f778b.420dc","51706310.acb04c"],"x":715,"y":340,"wires":[["42ead522.81b33c"]]},{"id":"725ac2ab.819efc","type":"ui_text","z":"c13b628d.15ca2","group":"cef37d6d.7ffcc","order":3,"width":0,"height":0,"name":"Karte 2","label":"Rest Datenvolumen: ","format":"{{msg.payload}} MB","layout":"row-spread","x":1000,"y":320,"wires":[]},{"id":"4a9c8cd3.caee6c","type":"ui_text","z":"c13b628d.15ca2","group":"cef37d6d.7ffcc","order":5,"width":0,"height":0,"name":"","label":"Status: ","format":"{{msg.payload}}","layout":"row-spread","x":1000,"y":360,"wires":[]},{"id":"e1597f4e.c17128","type":"ui_text","z":"c13b628d.15ca2","group":"8bcc8038.ee0c68","order":5,"width":0,"height":0,"name":"","label":"Status: ","format":"{{msg.payload}}","layout":"row-spread","x":480,"y":640,"wires":[]},{"id":"1ba9d3f4.00bab4","type":"ui_text","z":"c13b628d.15ca2","group":"7f7a22fa.dbc0d4","order":5,"width":0,"height":0,"name":"","label":"Status: ","format":"{{msg.payload}}","layout":"row-spread","x":520,"y":360,"wires":[]},{"id":"5db9d024.6e7a68","type":"ui_text","z":"c13b628d.15ca2","group":"7f7a22fa.dbc0d4","order":1,"width":0,"height":0,"name":"","label":"Nummer: ","format":"{{msg.payload}}","layout":"row-spread","x":520,"y":400,"wires":[]},{"id":"6015a1be.f3e3b","type":"ui_text","z":"c13b628d.15ca2","group":"cef37d6d.7ffcc","order":1,"width":0,"height":0,"name":"","label":"Nummer: ","format":"{{msg.payload}}","layout":"row-spread","x":1000,"y":400,"wires":[]},{"id":"466f4dab.271e34","type":"ui_text","z":"c13b628d.15ca2","group":"8bcc8038.ee0c68","order":1,"width":0,"height":0,"name":"","label":"Nummer: ","format":"{{msg.payload}}","layout":"row-spread","x":480,"y":680,"wires":[]},{"id":"fe41ff21.e1268","type":"ui_text","z":"c13b628d.15ca2","group":"7f7a22fa.dbc0d4","order":2,"width":0,"height":0,"name":"","label":"Traffic: ","format":"{{msg.payload}}","layout":"row-spread","x":510,"y":440,"wires":[]},{"id":"e5886e2a.ca7448","type":"ui_text","z":"c13b628d.15ca2","group":"cef37d6d.7ffcc","order":2,"width":0,"height":0,"name":"","label":"Traffic: ","format":"{{msg.payload}}","layout":"row-left","x":990,"y":440,"wires":[]},{"id":"3ddbe2be.a9385e","type":"ui_text","z":"c13b628d.15ca2","group":"8bcc8038.ee0c68","order":2,"width":0,"height":0,"name":"","label":"Traffic: ","format":"{{msg.payload}}","layout":"row-spread","x":470,"y":720,"wires":[]},{"id":"eeaad8fd.4d2f78","type":"comment","z":"c13b628d.15ca2","name":"Things Mobile API - Klicke hier für mehr Infos","info":"Auf [https://www.thingsmobile.com/de/ ](https://ThingsMobile.com)gibt es SIM-Karten für IOT und M2M.\n\n\n","x":440,"y":100,"wires":[]},{"id":"27f96db2.f35eda","type":"ui_text","z":"c13b628d.15ca2","group":"8bcc8038.ee0c68","order":4,"width":0,"height":0,"name":"","label":"Type: ","format":"{{msg.payload}}","layout":"row-spread","x":470,"y":760,"wires":[]},{"id":"3e54be29.5cffda","type":"ui_text","z":"c13b628d.15ca2","group":"7f7a22fa.dbc0d4","order":4,"width":0,"height":0,"name":"","label":"Type:","format":"{{msg.payload}}","layout":"row-spread","x":490,"y":480,"wires":[]},{"id":"6d7ef015.6e673","type":"ui_text","z":"c13b628d.15ca2","group":"cef37d6d.7ffcc","order":4,"width":0,"height":0,"name":"","label":"Type:","format":"{{msg.payload}}","layout":"row-spread","x":990,"y":480,"wires":[]},{"id":"4c5ad9d9.08fdc","type":"inject","z":"c13b628d.15ca2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"0 0 * * *","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":210,"y":160,"wires":[["bc5ec590.f01ef"]]},{"id":"bc5ec590.f01ef","type":"function","z":"c13b628d.15ca2","name":"Credit Abfrage","func":"/* working curl...\ncurl -i -X POST -H “Content-Type: multipart/form-data” -F “upload=@/Users/al/artwork/pacman.gif” -F “upload-type=ANIMATED_GIF” -F “console=MAME” -F “displaynow=1”\n*/\nvar g_username = global.get('g_username') || 0;\nvar g_token = global.get('g_token') || 0;\n//set msg.headers to an {object} with property \"Content-Type\" set to \"multipart/form-data\"\nmsg.headers = {\n \"Content-Type\": \"multipart/form-data\" \n}\n \n//set payload to an {object} with properties and values\nmsg.payload = {\n \"username\": g_username,\n \"token\": g_token\n \n}; \n\n//set url\nmsg.url = \"https://api.thingsmobile.com/services/business-api/credit\"\n\n// return the msg to next node (the http request)\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":380,"y":160,"wires":[["7a3bae4a.06852"]]},{"id":"7a3bae4a.06852","type":"http request","z":"c13b628d.15ca2","name":"","method":"POST","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":590,"y":160,"wires":[["f6c5bfbf.a7e1b"]]},{"id":"f6c5bfbf.a7e1b","type":"xml","z":"c13b628d.15ca2","name":"","property":"payload","attr":"","chr":"","x":770,"y":160,"wires":[["98c9554b.7b16b","c1b84ad6.784e68"]]},{"id":"98c9554b.7b16b","type":"link out","z":"c13b628d.15ca2","name":"Credit","links":["ca67112f.5f10a"],"x":875,"y":160,"wires":[]},{"id":"c1b84ad6.784e68","type":"debug","z":"c13b628d.15ca2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1010,"y":160,"wires":[]},{"id":"2fb97297.934246","type":"function","z":"c13b628d.15ca2","name":"","func":"var credit = msg.payload.result.amount[0];\n\n\nvar msg1 = { payload: credit };\n//var msg2 = { payload: status };\n//var msg3 = { payload: msisdn };\n//var msg4 = { payload: traffic };\n//var msg5 = { payload: type };\n//return [ msg1, msg2, msg3, msg4, msg5 ];\nreturn msg1;","outputs":5,"noerr":0,"initialize":"","finalize":"","x":840,"y":620,"wires":[["a120a720.a11858","59ea4849.a2c908"],[],[],[],[]]},{"id":"ca67112f.5f10a","type":"link in","z":"c13b628d.15ca2","name":"","links":["98c9554b.7b16b"],"x":655,"y":620,"wires":[["2fb97297.934246"]]},{"id":"a120a720.a11858","type":"ui_text","z":"c13b628d.15ca2","group":"f06b2c48.d95178","order":3,"width":0,"height":0,"name":"Guthaben","label":"Guthaben: ","format":"{{msg.payload}} EURO","layout":"row-spread","x":1020,"y":600,"wires":[]},{"id":"59ea4849.a2c908","type":"debug","z":"c13b628d.15ca2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1040,"y":540,"wires":[]},{"id":"7f7a22fa.dbc0d4","type":"ui_group","name":"Karte 3","tab":"ed63539d.facb58","order":3,"disp":true,"width":"6","collapse":false},{"id":"8bcc8038.ee0c68","type":"ui_group","name":"Karte 1","tab":"ed63539d.facb58","order":1,"disp":true,"width":"6","collapse":false},{"id":"cef37d6d.7ffcc","type":"ui_group","name":"Karte 2","tab":"ed63539d.facb58","order":2,"disp":true,"width":"6","collapse":false},{"id":"f06b2c48.d95178","type":"ui_group","name":"Übersicht","tab":"ed63539d.facb58","order":4,"disp":true,"width":"6","collapse":false},{"id":"ed63539d.facb58","type":"ui_tab","name":"Things Mobile","icon":"dashboard","order":6,"disabled":false,"hidden":false}]