Hello,
I'm new to node-red, generating CSV LOG from device to display in dashboard.
Can someone help me and show the process?
thanks for your help.
Hello,
I'm new to node-red, generating CSV LOG from device to display in dashboard.
Can someone help me and show the process?
thanks for your help.
Try lookiing at these threads, plenty of examples of how to load csv and send to dashboard table or chart or gauge, etc
https://discourse.nodered.org/search?expanded=true&q=csv%20to%20dashboard
If you get stuck post what you have tried, and people will point you in the right direction.
[edit]
form data in the thread you tacked onto Create a graph from csv with time and 6 columns - #5 by king
[{"id":"d3bbd1c0.07cec","type":"inject","z":"76163776.1d52b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"start","payloadType":"date","x":330,"y":120,"wires":[["b1edd399.9488e8"]]},{"id":"b1edd399.9488e8","type":"template","z":"76163776.1d52b","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"AGVName,Date,Time,B1C1,B1C2,B1Temp,Current,SOC\n107102,2022/2/8,00:04.8,3.427,3.477,33,192.7,61\n107102,2022/2/8,00:11.7,8.449,3.503,33,193.2,61\n107102,2022/2/8,00:18.5,3.466,3.524,33,192.9,62\n107102,2022/2/8,00:25.3,3.474,3.536,33,192.7,62\n107102,2022/2/8,00:32.2,3.481,3.545,33,193,62\n107102,2022/2/8,00:39.0,3.361,3.384,33,-20.9,63\n107102,2022/2/8,00:45.9,3.341,3.365,33,-13.8,63\n107102,2022/2/8,00:52.7,3.326,3.343,33,-14.2,63\n107102,2022/2/8,00:59.6,3.312,3.326,33,-14.7,63\n107102,2022/2/8,01:06.5,3.306,3.313,33,-13.8,63\n107102,2022/2/8,01:13.3,3.299,3.305,33,-15.9,63\n107102,2022/2/8,01:20.2,3.291,3.291,33,-18.9,63\n107102,2022/2/8,01:27.0,3.286,3.283,33,-15.7,63\n107102,2022/2/8,01:33.9,3.288,3.284,33,-13.4,63\n107102,2022/2/8,01:40.7,3.288,3.283,33,-12.4,63\n107102,2022/2/8,01:47.6,3.281,3.27,33,-19.9,63\n107102,2022/2/8,01:54.5,3.279,3.267,33,-17.1,63\n107102,2022/2/8,02:01.3,3.278,3.265,33,-17.7,63\n107102,2022/2/8,02:08.1,3.276,3.262,33,-19.1,63\n107102,2022/2/8,02:15.0,3.276,3.262,33,-16.3,63\n107102,2022/2/8,02:22.6,3.279,3.267,33,-13.2,63\n107102,2022/2/8,02:29.4,3.278,3.265,33,-13.8,63\n107102,2022/2/8,02:36.3,3.278,3.267,33,-12.8,63\n107102,2022/2/8,02:43.1,3.277,3.264,33,-14,63\n107102,2022/2/8,02:50.0,3.277,3.264,33,-14,63\n107102,2022/2/8,02:56.8,3.276,3.263,33,-12.2,63\n107102,2022/2/8,03:03.7,3.279,3.267,33,-11.4,63\n107102,2022/2/8,03:10.5,3.267,3.248,33,-10.2,63\n107102,2022/2/8,03:17.3,3.277,3.265,33,-10.4,63\n107102,2022/2/8,03:24.2,3.277,3.265,33,-10,63\n107102,2022/2/8,03:31.0,3.269,3.254,33,-20.9,63\n107102,2022/2/8,03:37.8,3.272,3.257,33,-16.9,63\n107102,2022/2/8,03:44.6,3.273,3.259,33,-14.2,63\n107102,2022/2/8,03:51.5,3.268,3.252,33,-22.4,63\n","output":"str","x":400,"y":180,"wires":[["bc6a4158.0d8508"]]},{"id":"bc6a4158.0d8508","type":"csv","z":"76163776.1d52b","name":"csv","sep":",","hdrin":true,"hdrout":"all","multi":"mult","ret":"\\n","temp":"AGV,Date,Time,B1C1,B1C2,B1Temp, Current,SOC","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":550,"y":180,"wires":[["c0ba397e.0b979","d37e1783.2a496"]]},{"id":"c0ba397e.0b979","type":"debug","z":"76163776.1d52b","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":140,"wires":[]},{"id":"d37e1783.2a496","type":"function","z":"76163776.1d52b","name":"graph generate","func":"let payload=msg.payload;\n\nlet data = [[],[],[],[],[]];\nfor(let i=0;i<payload.length;i++){\n let date = payload[i].Date.split(\"/\");\n date[1] = date[1].padStart(2,\"0\");\n date[2] = date[2].padStart(2,\"0\");\n date = date.join(\"-\")\n let time = payload[i].Time.split(\".\");\n time[1] =time[1].padStart(2,\"0\");\n time = time.join(\":\");\n time = new Date(date+\"T\"+time);\n data[0].push({\"x\": time, \"y\": payload[i].B1C1});\n data[1].push({\"x\": time, \"y\": payload[i].B1C2});\n data[2].push({\"x\": time, \"y\": payload[i].B1Temp});\n data[3].push({\"x\": time, \"y\": payload[i].Current});\n data[4].push({\"x\": time, \"y\": payload[i].SOC});\n}\nlet labels = msg.columns.split(\",\").slice(3);\nmsg.soc=data[4][data[4].length-1].y\nnode.warn(msg.soc)\nmsg.payload=[{\n\"series\": labels,\n\"data\":data,\n\"labels\": labels\n}];\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":730,"y":180,"wires":[["1f0031ad.1f2e0e","8c626d16.8159c8"]]},{"id":"1f0031ad.1f2e0e","type":"ui_chart","z":"76163776.1d52b","name":"","group":"2ac8e3fa.8b8584","order":5,"width":0,"height":0,"label":"Time Graph Test","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#400000","#ff8000","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":960,"y":180,"wires":[["c1e06cd1.e2299"]]},{"id":"8c626d16.8159c8","type":"debug","z":"76163776.1d52b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":930,"y":300,"wires":[]},{"id":"c1e06cd1.e2299","type":"ui_gauge","z":"76163776.1d52b","name":"","group":"2ac8e3fa.8b8584","order":2,"width":0,"height":0,"gtype":"wave","title":"SOC","label":"units","format":"{{msg.soc}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":1150,"y":180,"wires":[]},{"id":"2ac8e3fa.8b8584","type":"ui_group","name":"Default","tab":"ebb1ed1c.5ebe2","order":1,"disp":true,"width":"12","collapse":false,"className":""},{"id":"ebb1ed1c.5ebe2","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.