Hey guys,
I wanna write some mqtt messages to a txt-file for troubleshooting purposes of an IOT device.
So, I achieved the goal to write these messages to a file.
But now I need some kind of function which is adding a timestamp to each mqtt payload at the moment I append it to the txt file.
Can anybody help me? I am not good in programming
All I have is this flow without a function.
[{"id":"f4addc3f5fae43b9","type":"tab","label":"Imported mqtt logger","disabled":false,"info":"","env":[]},{"id":"dc010139.a13ea","type":"mqtt in","z":"f4addc3f5fae43b9","name":"","topic":"test/feeder","qos":"0","datatype":"auto","broker":"f839540e.7b7858","nl":false,"rap":false,"inputs":0,"x":240,"y":200,"wires":[["49d9bb43f0e8e692"]]},{"id":"d86a58b1c2b33f4d","type":"debug","z":"f4addc3f5fae43b9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","statusVal":"","statusType":"auto","x":730,"y":200,"wires":[]},{"id":"49d9bb43f0e8e692","type":"file","z":"f4addc3f5fae43b9","name":"","filename":"/data/logs/feederdebug.txt","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":490,"y":200,"wires":[["d86a58b1c2b33f4d"]]},{"id":"f839540e.7b7858","type":"mqtt-broker","name":"","broker":"192.168.178.44","port":"1883","clientid":"clientid","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]