I run into a problem generating a CSV file, maybe someone can help me.
The TTN Uplink Node gets the data, the Change Node generates the array and the Edit CSV Node generates a comma separated CSV file which is saved with a File Node.
[{"id":"cc7221f7.8586c","type":"tab","label":"Lucht","disabled":false,"info":""},{"id":"a8e73786.bcdee8","type":"ttn uplink","z":"cc7221f7.8586c","name":"Vocht en temperatuur","app":"320ca0e6.622ee","dev_id":"humitemp-achtertuin","field":"","x":120,"y":220,"wires":[["7967c7f0.a265f8"]]},{"id":"7967c7f0.a265f8","type":"change","z":"cc7221f7.8586c","name":"Generate Array","rules":[{"t":"set","p":"payload","pt":"msg","to":"[\t { \"Temperatuur\":payload.tempachtertuin,\"Luchtvochtigheid\":payload.humiachtertuin,\"Accu\":payload.voltachtertuin }\t]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":220,"wires":[["9a19774e.5c37c8"]]},{"id":"9a19774e.5c37c8","type":"csv","z":"cc7221f7.8586c","name":"Build CSV","sep":",","hdrin":true,"hdrout":true,"multi":"mult","ret":"\\n","temp":"Temperatuur, Luchtvochtigheid,Accu","skip":"0","strings":true,"x":630,"y":220,"wires":[["93dd4592.4cbb68"]]},{"id":"93dd4592.4cbb68","type":"file","z":"cc7221f7.8586c","name":"Save CSV","filename":"CSV/lucht.csv","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":830,"y":220,"wires":[[]]},{"id":"320ca0e6.622ee","type":"ttn app","z":"","appId":"humtitemp-achtertuin","accessKey":"ttn-account-v2.Lfk6s7XgacQe7GjCCCC2DkviRu_gF3_DNPjNx9BUtv0","discovery":"discovery.thethingsnetwork.org:1900"}]
This works but the CSV file is not correct, as you can see empty lines are added and the labels are repeated. That should be like the one on the right in the picture:
I have searched and tried solutions but I still can't get a good CSV output. What do I need to change?