Hello I have made a flow where it saves the temperatur/number with date. The thing is that I only want it to save the last temperatur but it saves every temperatur when I click on the save button. example: I input number and click save. It saves that number/temperatur and the time. I then type a new number and hit enter. Before I save log I enter a new number and hit enter. Then it saves the 2 last temperatures/numbers and the date but I want the date for each number and in this case it saves two numbers and the date for when I clicked save(10, 45 + date).
New user so I can only copy/past code: [{"id":"9e5f1775.c74128","type":"tab","label":"Test","disabled":false,"info":""},{"id":"92b7338a.064498","type":"function","z":"9e5f1775.c74128","name":"temp conversion","func":"var number = msg.payload;\nvar temp1 = Math.log(number/1024)/-0.028;\nvar temp2 = temp1.toFixed(2);\nmsg.payload = temp2;\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":120,"wires":[["33d13e44.cb906a","4f9a9db0.12a314"]]},{"id":"33d13e44.cb906a","type":"ui_gauge","z":"9e5f1775.c74128","name":"","group":"92b49ed9.d3728","order":3,"width":0,"height":0,"gtype":"gage","title":"Temperatur","label":"units","format":"{{msg.payload}}","min":"0","max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":710,"y":120,"wires":},{"id":"6630890e.a75d18","type":"simpletime","z":"9e5f1775.c74128","name":"","x":410,"y":300,"wires":[["4f9a9db0.12a314"]]},{"id":"4f9a9db0.12a314","type":"template","z":"9e5f1775.c74128","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload}} {{mytime}} {{mydate}}","output":"str","x":660,"y":280,"wires":[["c0965be1.9f0f4"]]},{"id":"c0965be1.9f0f4","type":"file","z":"9e5f1775.c74128","name":"Logfil","filename":"C:\Users\benja\.node-red\saveit.txt","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":890,"y":280,"wires":[]},{"id":"9a23d316.9d47a8","type":"ui_button","z":"9e5f1775.c74128","name":"Gem log","group":"92b49ed9.d3728","order":1,"width":0,"height":0,"passthru":false,"label":"Gem log","tooltip":"","color":"","bgcolor":"","icon":"","payload":" ","payloadType":"str","topic":"","x":140,"y":320,"wires":[["6630890e.a75d18"]]},{"id":"69462a0a.8b8cc4","type":"ui_text_input","z":"9e5f1775.c74128","name":"","label":"","tooltip":"","group":"92b49ed9.d3728","order":11,"width":0,"height":0,"passthru":true,"mode":"number","delay":"0","topic":"","x":130,"y":120,"wires":[["92b7338a.064498"]]},{"id":"92b49ed9.d3728","type":"ui_group","z":"","name":"Default","tab":"d5e92c99.dcad28","disp":true,"width":"6","collapse":false},{"id":"d5e92c99.dcad28","type":"ui_tab","z":"","name":"Default","icon":"dashboard","disabled":false,"hidden":false}]