Hi, i stumbel with the Date and Time at any Node. I know how to get Date and Time with the Timestamp, but how can i get them out of the Node i just use.
e.g
I read 12 Temperatursensor and write them to a file. now it would be nice to have the Time with it. If possible out of the payload and not with a Timestamp, because i can not define the right read time on the Timestamp.
Thanks for any help
Regard AndSoOn
Hi welcome to the forum,
you haven't given enouth information for me to understand your problem. So let me ask some questions:
- what maching are you running Node-RED (NR) on? (rpi, windows, mac??)
- what version of node-red and node.js? (you can find them in the NR startup log)
- how are you attaching the sensors?
- what do you mean by "stumbel with the Date and Time at any Node'? what node are you talking about?
- can you provide your flow - export it and attach it to a reply AFTER reading this thread
If your sensor doesn't return a timestamp then simply add a change node with a set rule. One of the "To" options is timestamp.
If the sensor does return a timestamp but it seems wrong, it is probably a UNIX timestamp so you can simply multiply by 1000 or ignore it and use the option above.
Hi there, thanks for the response.
I hava a Rasperry
Nod Red V0.19.4
node.js V8.11.1
Linux 4.14.98
Google Translator...
Excuse me, but English is not my mother tongue.
I think it's better to explain my flow.
I want in the init.
Create a file that has the following structure:
Date, Time, S1, S2 ........ S15 = (header data)
Then I initialize an array with the delta values, which I later calculate with the read sensor data.
Now I read in the 15 sensor data and eagle this.
In the last section, I want to save all data in a CSV file so that it finally results in a table.
Date, Time, S1, S2 ........ S15
2019-11-10, 19:22:45 23.0, 22.3, 40.3
2019-11-10, 19:32:45 23.0, 22.3, 40.3
I can save the sensor data, but the date and the time I can not put in the column 1 and 2, but these come always after sensor 15.
I can not tell the join which input should be processed first.
Also, I can not determine when the Timestamp should be active.
Excuse me, but English is not my mother tongue.
I think it's better to explain my flow.
I want in the init.
Create a file that has the following structure:
Date, Time, S1, S2 ........ S15 = (header data)
Then I initialize an array with the delta values, which I later calculate with the read sensor data.
Now I read in the 15 sensor data and eagle this.
In the last section, I want to save all data in a CSV file so that it finally results in a table.
Date, Time, S1, S2 ........ S15
2019-11-10, 19:22:45 23.0, 22.3, 40.3
2019-11-10, 19:32:45 23.0, 22.3, 40.3
I can save the sensor data, but the date and the time I can not put in the column 1 and 2, but these come always after sensor 15.
I can not tell the join which input should be processed first.
Also, I can not determine when the Timestamp should be active.
But my program should go through from top to bottom and pass on the last sensor date and time.
Sorry.. they say new user are not allowed to upload attachement.
Without seeng your flow, I really can't help you. You do not need to attach your flow. you can paste it into a reply using three back tics ``` on the line before and after your flow.
Hello thanks for the answer. I just dident know if you got my response at all.
Now i send you my flow.
[{"id":"21bc21a9.eedbfe","type":"tab","label":"Collect Temp","disabled":true,"info":""},{"id":"2a4197f4.0b76b8","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S1","sensorid":"28-01143f9f14aa","timer":"0.5","x":190,"y":320,"wires":[["cd821c91.3c5d6"]]},{"id":"c70c443f.7d1178","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S2","sensorid":"28-01143c19feaa","timer":"0.5","x":190,"y":360,"wires":[["b18a560c.6acf18"]]},{"id":"8a60d3d9.77d86","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S3","sensorid":"28-01143c6b08aa","timer":"0.5","x":190,"y":400,"wires":[["84146fb6.092fd"]]},{"id":"51a506ad.300088","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S4","sensorid":"28-0114483b4baa","timer":"0.5","x":190,"y":446,"wires":[["a6351a84.e48e48"]]},{"id":"306ba0ac.cf271","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S5","sensorid":"28-0114484cd1aa","timer":"0.5","x":190,"y":486,"wires":[["7369dd69.d65c64"]]},{"id":"c5631519.80df78","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S6","sensorid":"28-011447cc4aaa","timer":"0.5","x":190,"y":526,"wires":[["66fc8982.443628"]]},{"id":"2762e4bd.10efdc","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S7","sensorid":"28-011448800aaa","timer":"0.5","x":190,"y":566,"wires":[["f86dde12.25a42"]]},{"id":"edb2a927.61c878","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S8","sensorid":"28-011447f28caa","timer":"0.5","x":190,"y":606,"wires":[["6321dc35.ebf7c4"]]},{"id":"b25101e8.d37c","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S9","sensorid":"28-011447bd65aa","timer":"0.5","x":190,"y":640,"wires":[["d0e99182.9a9a8"]]},{"id":"f2da99f.d682768","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S10","sensorid":"28-0114484380aa","timer":"0.5","x":190,"y":680,"wires":[["6a834506.3c36bc"]]},{"id":"3969b845.724378","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S11","sensorid":"28-0114480716aa","timer":"0.5","x":190,"y":720,"wires":[["83bd338a.acdf5"]]},{"id":"bce018e1.77d8d8","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S12","sensorid":"28-01144838dbaa","timer":"0.5","x":190,"y":760,"wires":[["64727b72.568d34"]]},{"id":"666c0e35.79b98","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S13","sensorid":"28-01144825d3aa","timer":"0.5","x":190,"y":800,"wires":[["483d2fb9.eb569"]]},{"id":"4b48ce8c.34366","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S14","sensorid":"28-0114483b67aa","timer":"0.5","x":190,"y":840,"wires":[["d79cd841.cb2488"]]},{"id":"340161a0.cc29be","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S15","sensorid":"28-01144895cbaa","timer":"0.5","x":190,"y":880,"wires":[["e308b8bc.f6e2a8","46f34f5e.07d4f"]]},{"id":"d7aad3cc.2ac9a","type":"function","z":"21bc21a9.eedbfe","name":"Init Array with SensorDeltas","func":"var aAll_Temp = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];\nvar aDeltaTemperatur = [];\naDeltaTemperatur[0] =0; // not used \naDeltaTemperatur[1] =0.3375; //Sensor 01\naDeltaTemperatur[2] =0.4625; //Sensor 02\naDeltaTemperatur[3] =0.4; //Sensor 03\naDeltaTemperatur[4] =0.0875; //Sensor 04 --> verry precise\naDeltaTemperatur[5] =0.4625; //Sensor 05\naDeltaTemperatur[6] =0.025; //Sensor 06\naDeltaTemperatur[7] =0.0875; //Sensor 07 --> verry precise\naDeltaTemperatur[8] =0.275; //Sensor 08\naDeltaTemperatur[9] =0.0875; //Sensor 09 --> verry precise\naDeltaTemperatur[10] =0.4; //Sensor 10\naDeltaTemperatur[11] =0.4; //Sensor 11\naDeltaTemperatur[12] =0.4; //Sensor 12\naDeltaTemperatur[13] =0.525; //Sensor 12\naDeltaTemperatur[14] =0.15; //Sensor 14\naDeltaTemperatur[15] =0.275; //Sensor 15\nflow.set ('aDeltaTemperatur',aDeltaTemperatur); // variable for the flow\nflow.set ('aAll_Temp',aAll_Temp); // variable for the flow\nmsg.payload = msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":540,"y":200,"wires":[[]]},{"id":"cd821c91.3c5d6","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 01","func":"var i=1;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":320,"wires":[[]],"inputLabels":["SensNr."]},{"id":"b18a560c.6acf18","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 02","func":"var i=2;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":360,"wires":[[]],"inputLabels":["SensNr."]},{"id":"84146fb6.092fd","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 03","func":"var i=3;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":400,"wires":[[]],"inputLabels":["SensNr."]},{"id":"a6351a84.e48e48","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 04","func":"var i=4;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":446,"wires":[[]],"inputLabels":["SensNr."]},{"id":"7369dd69.d65c64","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 05","func":"var i=5;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":486,"wires":[[]],"inputLabels":["SensNr."]},{"id":"66fc8982.443628","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 06","func":"var i=6;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":526,"wires":[[]],"inputLabels":["SensNr."]},{"id":"f86dde12.25a42","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 07","func":"var i=7;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":566,"wires":[[]],"inputLabels":["SensNr."]},{"id":"6321dc35.ebf7c4","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 08","func":"var i=8;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":606,"wires":[[]],"inputLabels":["SensNr."]},{"id":"d0e99182.9a9a8","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 09","func":"var i=9;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":640,"wires":[[]],"inputLabels":["SensNr."]},{"id":"6a834506.3c36bc","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 10","func":"var i=10;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":680,"wires":[[]],"inputLabels":["SensNr."]},{"id":"83bd338a.acdf5","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 11","func":"var i=11;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":720,"wires":[[]],"inputLabels":["SensNr."]},{"id":"64727b72.568d34","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 12","func":"var i=12;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":760,"wires":[[]],"inputLabels":["SensNr."]},{"id":"483d2fb9.eb569","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 13","func":"var i=13;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":800,"wires":[[]],"inputLabels":["SensNr."]},{"id":"d79cd841.cb2488","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 14","func":"var i=14;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":840,"wires":[[]],"inputLabels":["SensNr."]},{"id":"46f34f5e.07d4f","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 15","func":"var i=15;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":880,"wires":[[]],"inputLabels":["SensNr."]},{"id":"324788ed.9b3798","type":"inject","z":"21bc21a9.eedbfe","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":210,"y":200,"wires":[["d7aad3cc.2ac9a"]]},{"id":"2227535d.891d4c","type":"comment","z":"21bc21a9.eedbfe","name":"Init","info":"Daten im Array wurden durch Messungen mit einem kalibrierten Messgerat durchgeführt.\nEs wurde jeweils das Delta zum Messgerät ermittelt.\nJeder Sensor hat eine eindeutige Nummer. zur Zeit 1 bis 15. \nDie Nummer entspricht dm Array-Feld\n\n\nEnglish:\nData in the array were measured with a calibrated measuring instrument.\nThe delta to the measuring instrument was determined.\nEach sensor has a unique number. at present 1 to 15. \nThe number corresponds to the dm array field.","x":190,"y":40,"wires":[]},{"id":"7506b6a3.54dbe8","type":"comment","z":"21bc21a9.eedbfe","name":"Sensoren","info":"Data in the array were measured with a calibrated measuring instrument.\nThe delta to the measuring instrument was determined.\nEach sensor has a unique number. at present 1 to 15. \nThe number corresponds to the dm array field.","x":200,"y":260,"wires":[]},{"id":"cc43d918.c902d8","type":"comment","z":"21bc21a9.eedbfe","name":"Delta","info":"Hier wird der Wert vom Temperatursensor \nmit dem Delta vom entsprechenden Array-Feld \nverrechnet\n\n\n\nEnglish:\n\nHere, the value of the temperature sensor \nwith the delta from the corresponding array field \ncleared","x":350,"y":260,"wires":[]},{"id":"e308b8bc.f6e2a8","type":"function","z":"21bc21a9.eedbfe","name":"Concatinate Values","func":"var msgList = []; \nvar temp =\"\";\nvar i;\nvar NuToSt; // Number To String\nmsgList = flow.get('aAll_Temp');\nfor(i =1; i <16; i++)\n { \n NuToSt = msgList[i].toString();\n temp = temp += NuToSt +=\",\";\n }\nmsg.payload = temp;\nreturn msg;","outputs":1,"noerr":0,"x":190,"y":1160,"wires":[["4d5a685b.9992b8","bb533446.5a35c8"]]},{"id":"e45a68dd.c51378","type":"file","z":"21bc21a9.eedbfe","name":"","filename":"/home/pi/Desktop/all.CSV","appendNewline":true,"createDir":true,"overwriteFile":"false","x":1010,"y":120,"wires":[[]]},{"id":"f0e13b66.3b2898","type":"inject","z":"21bc21a9.eedbfe","name":"","topic":"","payload":"Date, Time, S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":210,"y":120,"wires":[["e45a68dd.c51378"]]},{"id":"bf02356f.03f138","type":"inject","z":"21bc21a9.eedbfe","name":"","topic":"","payload":"","payloadType":"date","repeat":"30","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":1040,"wires":[["389a7be5.50d6a4","c77d6694.732a08"]]},{"id":"389a7be5.50d6a4","type":"moment","z":"21bc21a9.eedbfe","name":"Date","topic":"","input":"payload","inputType":"msg","inTz":"Europe/Zurich","adjAmount":"0","adjType":"hours","adjDir":"add","format":"YYYY:MM:DD","locale":"en_GB","output":"payload","outputType":"msg","outTz":"Europe/Zurich","x":530,"y":1020,"wires":[["4d5a685b.9992b8"]]},{"id":"c77d6694.732a08","type":"moment","z":"21bc21a9.eedbfe","name":"Time","topic":"","input":"Payload","inputType":"msg","inTz":"Europe/Zurich","adjAmount":"0","adjType":"hours","adjDir":"add","format":"HH:mm:ss","locale":"en_GB","output":"payload","outputType":"msg","outTz":"Europe/Zurich","x":530,"y":1080,"wires":[["4d5a685b.9992b8"]]},{"id":"c2ba3da5.ae46f","type":"debug","z":"21bc21a9.eedbfe","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":970,"y":1040,"wires":[]},{"id":"4d5a685b.9992b8","type":"join","z":"21bc21a9.eedbfe","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":",","joinerType":"str","accumulate":false,"timeout":"10","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":710,"y":1040,"wires":[["c2ba3da5.ae46f","bb533446.5a35c8"]]},{"id":"2cf9234d.0d5bdc","type":"debug","z":"21bc21a9.eedbfe","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1090,"y":1220,"wires":[]},{"id":"979bb75f.fd1c58","type":"file","z":"21bc21a9.eedbfe","name":"","filename":"/home/pi/Desktop/Test.CSV","appendNewline":true,"createDir":true,"overwriteFile":"false","x":1080,"y":1120,"wires":[[]]},{"id":"bb533446.5a35c8","type":"join","z":"21bc21a9.eedbfe","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":",","joinerType":"str","accumulate":false,"timeout":"10","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":850,"y":1120,"wires":[["979bb75f.fd1c58","2cf9234d.0d5bdc"]]},{"id":"2a99a69.9500e5a","type":"change","z":"21bc21a9.eedbfe","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":1220,"wires":[[]]},{"id":"638fa55d.c8065c","type":"comment","z":"21bc21a9.eedbfe","name":"Init","info":"","x":410,"y":940,"wires":[]}]
Please export your flow again, read this post and edit your post.
Free tip, only show the problem in your flow not the irrelevant parts.
Several issues I see
- in the 'Concatinate Values' function, the loop starts at array location 1 - it should be 0 and end at 15
- there in no gaurentee that the function 'Calculate 15' will run before the 'Concatinate Values' function
- since it seems like you want the valuse stored based on the timestamp inject node, why not have the 'Concatinate Values' function after getting the time stamps and build the entire msg to be written to the csv there?
[{"id":"21bc21a9.eedbfe","type":"tab","label":"Collect Temp","disabled":true,"info":""},{"id":"2a4197f4.0b76b8","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S1","sensorid":"28-01143f9f14aa","timer":"0.5","x":190,"y":320,"wires":[["cd821c91.3c5d6"]]},{"id":"c70c443f.7d1178","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S2","sensorid":"28-01143c19feaa","timer":"0.5","x":190,"y":360,"wires":[["b18a560c.6acf18"]]},{"id":"8a60d3d9.77d86","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S3","sensorid":"28-01143c6b08aa","timer":"0.5","x":190,"y":400,"wires":[["84146fb6.092fd"]]},{"id":"51a506ad.300088","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S4","sensorid":"28-0114483b4baa","timer":"0.5","x":190,"y":446,"wires":[["a6351a84.e48e48"]]},{"id":"306ba0ac.cf271","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S5","sensorid":"28-0114484cd1aa","timer":"0.5","x":190,"y":486,"wires":[["7369dd69.d65c64"]]},{"id":"c5631519.80df78","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S6","sensorid":"28-011447cc4aaa","timer":"0.5","x":190,"y":526,"wires":[["66fc8982.443628"]]},{"id":"2762e4bd.10efdc","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S7","sensorid":"28-011448800aaa","timer":"0.5","x":190,"y":566,"wires":[["f86dde12.25a42"]]},{"id":"edb2a927.61c878","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S8","sensorid":"28-011447f28caa","timer":"0.5","x":190,"y":606,"wires":[["6321dc35.ebf7c4"]]},{"id":"b25101e8.d37c","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S9","sensorid":"28-011447bd65aa","timer":"0.5","x":190,"y":640,"wires":[["d0e99182.9a9a8"]]},{"id":"f2da99f.d682768","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S10","sensorid":"28-0114484380aa","timer":"0.5","x":190,"y":680,"wires":[["6a834506.3c36bc"]]},{"id":"3969b845.724378","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S11","sensorid":"28-0114480716aa","timer":"0.5","x":190,"y":720,"wires":[["83bd338a.acdf5"]]},{"id":"bce018e1.77d8d8","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S12","sensorid":"28-01144838dbaa","timer":"0.5","x":190,"y":760,"wires":[["64727b72.568d34"]]},{"id":"666c0e35.79b98","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S13","sensorid":"28-01144825d3aa","timer":"0.5","x":190,"y":800,"wires":[["483d2fb9.eb569"]]},{"id":"4b48ce8c.34366","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S14","sensorid":"28-0114483b67aa","timer":"0.5","x":190,"y":840,"wires":[["d79cd841.cb2488"]]},{"id":"340161a0.cc29be","type":"ds18b20","z":"21bc21a9.eedbfe","name":"S15","sensorid":"28-01144895cbaa","timer":"0.5","x":190,"y":880,"wires":[["e308b8bc.f6e2a8","46f34f5e.07d4f"]]},{"id":"d7aad3cc.2ac9a","type":"function","z":"21bc21a9.eedbfe","name":"Init Array with SensorDeltas","func":"var aAll_Temp = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];\nvar aDeltaTemperatur = [];\naDeltaTemperatur[0] =0; // not used \naDeltaTemperatur[1] =0.3375; //Sensor 01\naDeltaTemperatur[2] =0.4625; //Sensor 02\naDeltaTemperatur[3] =0.4; //Sensor 03\naDeltaTemperatur[4] =0.0875; //Sensor 04 --> verry precise\naDeltaTemperatur[5] =0.4625; //Sensor 05\naDeltaTemperatur[6] =0.025; //Sensor 06\naDeltaTemperatur[7] =0.0875; //Sensor 07 --> verry precise\naDeltaTemperatur[8] =0.275; //Sensor 08\naDeltaTemperatur[9] =0.0875; //Sensor 09 --> verry precise\naDeltaTemperatur[10] =0.4; //Sensor 10\naDeltaTemperatur[11] =0.4; //Sensor 11\naDeltaTemperatur[12] =0.4; //Sensor 12\naDeltaTemperatur[13] =0.525; //Sensor 12\naDeltaTemperatur[14] =0.15; //Sensor 14\naDeltaTemperatur[15] =0.275; //Sensor 15\nflow.set ('aDeltaTemperatur',aDeltaTemperatur); // variable for the flow\nflow.set ('aAll_Temp',aAll_Temp); // variable for the flow\nmsg.payload = msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":540,"y":200,"wires":[[]]},{"id":"cd821c91.3c5d6","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 01","func":"var i=1;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":320,"wires":[[]],"inputLabels":["SensNr."]},{"id":"b18a560c.6acf18","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 02","func":"var i=2;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":360,"wires":[[]],"inputLabels":["SensNr."]},{"id":"84146fb6.092fd","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 03","func":"var i=3;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":400,"wires":[[]],"inputLabels":["SensNr."]},{"id":"a6351a84.e48e48","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 04","func":"var i=4;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":446,"wires":[[]],"inputLabels":["SensNr."]},{"id":"7369dd69.d65c64","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 05","func":"var i=5;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":486,"wires":[[]],"inputLabels":["SensNr."]},{"id":"66fc8982.443628","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 06","func":"var i=6;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":526,"wires":[[]],"inputLabels":["SensNr."]},{"id":"f86dde12.25a42","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 07","func":"var i=7;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":566,"wires":[[]],"inputLabels":["SensNr."]},{"id":"6321dc35.ebf7c4","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 08","func":"var i=8;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":606,"wires":[[]],"inputLabels":["SensNr."]},{"id":"d0e99182.9a9a8","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 09","func":"var i=9;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":640,"wires":[[]],"inputLabels":["SensNr."]},{"id":"6a834506.3c36bc","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 10","func":"var i=10;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":680,"wires":[[]],"inputLabels":["SensNr."]},{"id":"83bd338a.acdf5","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 11","func":"var i=11;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":720,"wires":[[]],"inputLabels":["SensNr."]},{"id":"64727b72.568d34","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 12","func":"var i=12;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":760,"wires":[[]],"inputLabels":["SensNr."]},{"id":"483d2fb9.eb569","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 13","func":"var i=13;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":800,"wires":[[]],"inputLabels":["SensNr."]},{"id":"d79cd841.cb2488","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 14","func":"var i=14;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":840,"wires":[[]],"inputLabels":["SensNr."]},{"id":"46f34f5e.07d4f","type":"function","z":"21bc21a9.eedbfe","name":"Calculate 15","func":"var i=15;\nvar Temp_with_Delta;\nvar DeltaArray;\nvar Delta;\n\naAll_Temp = flow.get('aAll_Temp');\n\nDeltaArray = flow.get('aDeltaTemperatur'); // Deltas per Sensor\nDelta=DeltaArray[i];\nTemp_with_Delta= msg.payload + Delta;\n\naAll_Temp[i] = Temp_with_Delta;\nflow.set ('aAll_Temp',aAll_Temp);\nmsg.payload=flow.get('aAll_Temp');\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":880,"wires":[[]],"inputLabels":["SensNr."]},{"id":"324788ed.9b3798","type":"inject","z":"21bc21a9.eedbfe","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":210,"y":200,"wires":[["d7aad3cc.2ac9a"]]},{"id":"2227535d.891d4c","type":"comment","z":"21bc21a9.eedbfe","name":"Init","info":"Daten im Array wurden durch Messungen mit einem kalibrierten Messgerat durchgeführt.\nEs wurde jeweils das Delta zum Messgerät ermittelt.\nJeder Sensor hat eine eindeutige Nummer. zur Zeit 1 bis 15. \nDie Nummer entspricht dm Array-Feld\n\n\nEnglish:\nData in the array were measured with a calibrated measuring instrument.\nThe delta to the measuring instrument was determined.\nEach sensor has a unique number. at present 1 to 15. \nThe number corresponds to the dm array field.","x":190,"y":40,"wires":[]},{"id":"7506b6a3.54dbe8","type":"comment","z":"21bc21a9.eedbfe","name":"Sensoren","info":"Data in the array were measured with a calibrated measuring instrument.\nThe delta to the measuring instrument was determined.\nEach sensor has a unique number. at present 1 to 15. \nThe number corresponds to the dm array field.","x":200,"y":260,"wires":[]},{"id":"cc43d918.c902d8","type":"comment","z":"21bc21a9.eedbfe","name":"Delta","info":"Hier wird der Wert vom Temperatursensor \nmit dem Delta vom entsprechenden Array-Feld \nverrechnet\n\n\n\nEnglish:\n\nHere, the value of the temperature sensor \nwith the delta from the corresponding array field \ncleared","x":350,"y":260,"wires":[]},{"id":"e308b8bc.f6e2a8","type":"function","z":"21bc21a9.eedbfe","name":"Concatinate Values","func":"var msgList = []; \nvar temp =\"\";\nvar i;\nvar NuToSt; // Number To String\nmsgList = flow.get('aAll_Temp');\nfor(i =1; i <16; i++)\n { \n NuToSt = msgList[i].toString();\n temp = temp += NuToSt +=\",\";\n }\nmsg.payload = temp;\nreturn msg;","outputs":1,"noerr":0,"x":190,"y":1160,"wires":[["4d5a685b.9992b8","bb533446.5a35c8"]]},{"id":"e45a68dd.c51378","type":"file","z":"21bc21a9.eedbfe","name":"","filename":"/home/pi/Desktop/all.CSV","appendNewline":true,"createDir":true,"overwriteFile":"false","x":1010,"y":120,"wires":[[]]},{"id":"f0e13b66.3b2898","type":"inject","z":"21bc21a9.eedbfe","name":"","topic":"","payload":"Date, Time, S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":210,"y":120,"wires":[["e45a68dd.c51378"]]},{"id":"bf02356f.03f138","type":"inject","z":"21bc21a9.eedbfe","name":"","topic":"","payload":"","payloadType":"date","repeat":"30","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":1040,"wires":[["389a7be5.50d6a4","c77d6694.732a08"]]},{"id":"389a7be5.50d6a4","type":"moment","z":"21bc21a9.eedbfe","name":"Date","topic":"","input":"payload","inputType":"msg","inTz":"Europe/Zurich","adjAmount":"0","adjType":"hours","adjDir":"add","format":"YYYY:MM:DD","locale":"en_GB","output":"payload","outputType":"msg","outTz":"Europe/Zurich","x":530,"y":1020,"wires":[["4d5a685b.9992b8"]]},{"id":"c77d6694.732a08","type":"moment","z":"21bc21a9.eedbfe","name":"Time","topic":"","input":"Payload","inputType":"msg","inTz":"Europe/Zurich","adjAmount":"0","adjType":"hours","adjDir":"add","format":"HH:mm:ss","locale":"en_GB","output":"payload","outputType":"msg","outTz":"Europe/Zurich","x":530,"y":1080,"wires":[["4d5a685b.9992b8"]]},{"id":"c2ba3da5.ae46f","type":"debug","z":"21bc21a9.eedbfe","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":970,"y":1040,"wires":[]},{"id":"4d5a685b.9992b8","type":"join","z":"21bc21a9.eedbfe","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":",","joinerType":"str","accumulate":false,"timeout":"10","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":710,"y":1040,"wires":[["c2ba3da5.ae46f","bb533446.5a35c8"]]},{"id":"2cf9234d.0d5bdc","type":"debug","z":"21bc21a9.eedbfe","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1090,"y":1220,"wires":[]},{"id":"979bb75f.fd1c58","type":"file","z":"21bc21a9.eedbfe","name":"","filename":"/home/pi/Desktop/Test.CSV","appendNewline":true,"createDir":true,"overwriteFile":"false","x":1080,"y":1120,"wires":[[]]},{"id":"bb533446.5a35c8","type":"join","z":"21bc21a9.eedbfe","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":",","joinerType":"str","accumulate":false,"timeout":"10","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":850,"y":1120,"wires":[["979bb75f.fd1c58","2cf9234d.0d5bdc"]]},{"id":"2a99a69.9500e5a","type":"change","z":"21bc21a9.eedbfe","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":1220,"wires":[[]]},{"id":"638fa55d.c8065c","type":"comment","z":"21bc21a9.eedbfe","name":"Init","info":"","x":410,"y":940,"wires":[]}]
Hello, thank you for your clues.
I deliberately start at 1 and not at zero so that the sensor numbering is equal to the array entry.
What you suggested I've been trying for days. Put the timestamp and the sensor data together. My problem is, I haven't found out yet how to realize two inputs with function Node. The Join Node doesn't work the way I want it to.
What I haven't found yet is: How do I define the data flow, it seems to be arbitrary.
Thanks for your help
What way do you want it to work?
Hi Colin, i try to explain the main Problem:
I want to write the date (Node Date) and the time (Node Time) and the sensor data 1-15 (Node Concatiante Values) in one string. Each value is separated by a coma so I can create a csv file.
The date is in the format 2019:12:01
The time is in the format: 16:01:13
For Concatinate Values the format: value 1, value2,..value 15 (one string)
With the Node Join I get the correct string for date and time: = 2019:12:01,16:01:13
but if I now want to combine date, time and the values of the concatinate string, I can't do that. Here the output of join of date and time and the string of concatinate values doesn't work.
At the end I want the following string:
Date, Time, Value 1, Value2, Value3,...,Value15
AND: the whole thing should only be done after the last reading of the sensors. It doesn't matter in which order the sensors are read in, but the CSV string must be created at the end. I haven't found out how to control the data flow in NODE RED yet.
regard AndSoOn
Set the Join node to key/value pairs and make sure each input message has a separate topic, then you can get a single message out with all the data you need in the payload object properties, then you can build the string in, for example, a Function node.
Once you have joined them into one object the csv node can create the line for you.