@Controlwiz This is what I created for our use. I am not allowing end-users manage the system though, I assume you’ll want to make some changes to this flow, but I hope it gives you a good starting point.
[ { "id": "9f80a9ba6f93914d", "type": "inject", "z": "bd0d0f5f3bdcae7d", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 200, "y": 340, "wires": [ [ "f345f9742a9f75eb" ] ] }, { "id": "2b6bd82fafb1da3c", "type": "group", "z": "bd0d0f5f3bdcae7d", "style": { "stroke": "#999999", "stroke-opacity": "1", "fill": "none", "fill-opacity": "1", "label": true, "label-position": "nw", "color": "#a4a4a4" }, "nodes": [ "4e4943ea0df5c326", "a7fd77e723a2cc7b", "ea79b225fea62c08", "0db5093301817c23", "5865fd44bd88c99b", "b985da91e6bd7f7b", "021f7e05d71a67ce" ], "x": 814, "y": 159, "w": 912, "h": 182 }, { "id": "4e4943ea0df5c326", "type": "http request", "z": "bd0d0f5f3bdcae7d", "g": "2b6bd82fafb1da3c", "name": "DEVICE", "method": "POST", "ret": "txt", "paytoqs": "ignore", "url": "http://CHIRPSTACK IP:8090/api/devices", "tls": "", "persist": true, "proxy": "", "insecureHTTPParser": false, "authType": "bearer", "senderr": false, "headers": [], "x": 1480, "y": 300, "wires": [ [ "a7fd77e723a2cc7b" ] ] }, { "id": "a7fd77e723a2cc7b", "type": "debug", "z": "bd0d0f5f3bdcae7d", "g": "2b6bd82fafb1da3c", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1630, "y": 300, "wires": [] }, { "id": "ea79b225fea62c08", "type": "function", "z": "bd0d0f5f3bdcae7d", "g": "2b6bd82fafb1da3c", "name": "createHeaders", "func": "msg.headers = {};\nmsg.headers['Content-Type'] = 'application/json';\nmsg.headers['Accept'] = 'application/json';\nmsg.headers['Grpc-Metadata-Authorization'] = 'Bearer Token Here'\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1320, "y": 300, "wires": [ [ "4e4943ea0df5c326" ] ] }, { "id": "0db5093301817c23", "type": "template", "z": "bd0d0f5f3bdcae7d", "g": "2b6bd82fafb1da3c", "name": "", "field": "payload", "fieldType": "msg", "format": "handlebars", "syntax": "mustache", "template": "{\n \"device\": {\n \"applicationId\": \"Insert Application ID Here\",\n \"description\": \"Installed at PWC\",\n \"devEui\": \"{{deveui}}\",\n \"deviceProfileId\": \"Insert Device Profile ID Here\",\n \"isDisabled\": false,\n \"joinEui\": \"{{join}}\",\n \"name\": \"{{name}}\",\n \"skipFcntCheck\": false,\n \"tags\": {},\n \"variables\": {}\n }\n}\n\n", "output": "str", "x": 1160, "y": 300, "wires": [ [ "ea79b225fea62c08" ] ] }, { "id": "5865fd44bd88c99b", "type": "csv", "z": "bd0d0f5f3bdcae7d", "g": "2b6bd82fafb1da3c", "name": "", "sep": ",", "hdrin": true, "hdrout": "", "multi": "one", "ret": "\\n", "temp": "brand,sensor_name,serial_number,dev_eui,app_eui,app_key,dev_address,nets_key,apps_key", "skip": "0", "strings": true, "include_empty_strings": false, "include_null_values": false, "x": 890, "y": 300, "wires": [ [ "b985da91e6bd7f7b" ] ] }, { "id": "b985da91e6bd7f7b", "type": "function", "z": "bd0d0f5f3bdcae7d", "g": "2b6bd82fafb1da3c", "name": "", "func": "msg.name = msg.payload.sensor_name\nmsg.deveui = msg.payload.dev_eui\nmsg.desc = msg.payload.serial_number\nmsg.join = msg.payload.app_eui\nmsg.key = msg.payload.app_key\nreturn msg;\n", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1020, "y": 300, "wires": [ [ "0db5093301817c23" ] ] }, { "id": "021f7e05d71a67ce", "type": "comment", "z": "bd0d0f5f3bdcae7d", "g": "2b6bd82fafb1da3c", "name": "Device Import - DO 1st", "info": "", "x": 940, "y": 200, "wires": [] }, { "id": "1c67b18e94a90c4e", "type": "group", "z": "bd0d0f5f3bdcae7d", "style": { "stroke": "#999999", "stroke-opacity": "1", "fill": "none", "fill-opacity": "1", "label": true, "label-position": "nw", "color": "#a4a4a4" }, "nodes": [ "f345f9742a9f75eb", "15ecef12af68c479", "d0356427e030d206" ], "x": 274, "y": 159, "w": 532, "h": 382 }, { "id": "f345f9742a9f75eb", "type": "file in", "z": "bd0d0f5f3bdcae7d", "g": "1c67b18e94a90c4e", "name": "IMPORT", "filename": "/home/nodered/30034.csv", "filenameType": "str", "format": "utf8", "chunk": false, "sendError": false, "encoding": "none", "allProps": false, "x": 540, "y": 320, "wires": [ [ "5865fd44bd88c99b" ] ] }, { "id": "15ecef12af68c479", "type": "file in", "z": "bd0d0f5f3bdcae7d", "g": "1c67b18e94a90c4e", "name": "TEST", "filename": "/home/nodered/test.csv", "filenameType": "str", "format": "utf8", "chunk": false, "sendError": false, "encoding": "none", "allProps": false, "x": 530, "y": 500, "wires": [ [] ] }, { "id": "d0356427e030d206", "type": "comment", "z": "bd0d0f5f3bdcae7d", "g": "1c67b18e94a90c4e", "name": ".CSV Files - Change output between Device import and Key Import", "info": "", "x": 540, "y": 200, "wires": [] }, { "id": "cbb3a545926cac28", "type": "group", "z": "bd0d0f5f3bdcae7d", "style": { "stroke": "#999999", "stroke-opacity": "1", "fill": "none", "fill-opacity": "1", "label": true, "label-position": "nw", "color": "#a4a4a4" }, "nodes": [ "d86e5dd8c85262b1", "aa0fb1bd8d66d2cf", "3eb12c622bb02984", "b64de9927dfefa6d", "46cdf4deb874e794", "644108beb588d055", "7fab542dca98c43d" ], "x": 814, "y": 359, "w": 912, "h": 182 }, { "id": "d86e5dd8c85262b1", "type": "template", "z": "bd0d0f5f3bdcae7d", "g": "cbb3a545926cac28", "name": "", "field": "payload", "fieldType": "msg", "format": "handlebars", "syntax": "mustache", "template": "{\n \"deviceKeys\": {\n \"nwkKey\": \"{{key}}\"\n }\n}", "output": "str", "x": 1160, "y": 500, "wires": [ [ "aa0fb1bd8d66d2cf" ] ] }, { "id": "aa0fb1bd8d66d2cf", "type": "function", "z": "bd0d0f5f3bdcae7d", "g": "cbb3a545926cac28", "name": "createHeaders", "func": "msg.headers = {};\nmsg.headers['Content-Type'] = 'application/json';\nmsg.headers['Accept'] = 'application/json';\nmsg.headers['Grpc-Metadata-Authorization'] = 'Bearer Token Here'\n\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1320, "y": 500, "wires": [ [ "3eb12c622bb02984" ] ] }, { "id": "3eb12c622bb02984", "type": "http request", "z": "bd0d0f5f3bdcae7d", "g": "cbb3a545926cac28", "name": "OTAA KEY", "method": "POST", "ret": "txt", "paytoqs": "ignore", "url": "http://CHIRPSTACK IP:8090/api/devices/{{{deveui}}}/keys", "tls": "", "persist": true, "proxy": "", "insecureHTTPParser": false, "authType": "bearer", "senderr": false, "headers": [], "x": 1490, "y": 500, "wires": [ [ "b64de9927dfefa6d" ] ] }, { "id": "b64de9927dfefa6d", "type": "debug", "z": "bd0d0f5f3bdcae7d", "g": "cbb3a545926cac28", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1630, "y": 500, "wires": [] }, { "id": "46cdf4deb874e794", "type": "csv", "z": "bd0d0f5f3bdcae7d", "g": "cbb3a545926cac28", "name": "", "sep": ",", "hdrin": true, "hdrout": "", "multi": "one", "ret": "\\n", "temp": "brand,sensor_name,serial_number,dev_eui,app_eui,app_key,dev_address,nets_key,apps_key", "skip": "0", "strings": true, "include_empty_strings": false, "include_null_values": false, "x": 890, "y": 500, "wires": [ [ "644108beb588d055" ] ] }, { "id": "644108beb588d055", "type": "function", "z": "bd0d0f5f3bdcae7d", "g": "cbb3a545926cac28", "name": "", "func": "msg.name = msg.payload.sensor_name\nmsg.deveui = msg.payload.dev_eui\nmsg.desc = msg.payload.serial_number\nmsg.join = msg.payload.app_eui\nmsg.key = msg.payload.app_key\nmsg.devaddr = msg.payload.dev_address\nmsg.nets = msg.payload.nets_key\nmsg.apps = msg.payload.apps_key\nreturn msg;\n", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1020, "y": 500, "wires": [ [ "d86e5dd8c85262b1" ] ] }, { "id": "7fab542dca98c43d", "type": "comment", "z": "bd0d0f5f3bdcae7d", "g": "cbb3a545926cac28", "name": "OTAA Key Import - DO 2nd", "info": "", "x": 950, "y": 400, "wires": [] } ]