Hey Guys i have some questions about my programming skills. Please don´t delete my post i´m new to programming with java and node red.
Temp:
[{"id":"1fbb0938.77cf67","type":"function","z":"56d57d0c.f202b4","name":"Temperatur","func":"temp = (((msg.payload[0]&0x0f)<<8) + msg.payload[1]) * 0.0625;\n\nflow.set ('temperatur', temp);\n\nreturn msg;","outputs":1,"noerr":0,"x":610,"y":40,"wires":[["7138349d.c8c46c"]]}]
ChatId Reg.
[{"id":"3fb253ac.49436c","type":"function","z":"56d57d0c.f202b4","name":"chatId registrieren","func":"var registered_chatIDs = flow.get('registered_chatIDs','storeInFile') || [];\n\nmsg.registered_chatID = null;\n\nif (!registered_chatIDs.includes(msg.payload.chatId)){\n \n registered_chatIDs.push(msg.payload.chatId);\n \n msg.registered_chatID = msg.payload.chatId;\n \n flow.set('registered_chatIDs', registered_chatIDs, 'storeInFile');\n}\n\n\n\nreturn msg;","outputs":1,"noerr":0,"x":310,"y":200,"wires":[["8f1b2c8b.3983a"]]}]
ChatId lös.
[{"id":"86f98961.dbbc88","type":"function","z":"56d57d0c.f202b4","name":"chatId lös","func":"var registered_chatIDs = flow.get('registered_chatIDs','storeInFile') || [];\n\nfor( var i = 0; i < registered_chatIDs.length; i++){ \n if ( registered_chatIDs[i] === msg.payload.chatId) {\n registered_chatIDs.splice(i, 1); \n }\n msg.registered_chatID = msg.payload.chatId;\n flow.set('registered_chatIDs', registered_chatIDs, 'storeInFile');\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":280,"y":300,"wires":[["f6057c1b.42ad2"]]}]
Count+1
[{"id":"dee675ee.2eb7c8","type":"function","z":"7fdc0f6d.41cfc","name":"Plus1","func":"var count=global.get('count')||0;\n//var res = global.get(\"counter\");\n//count=res;\ncount+=1;\nglobal.set('count',count);\nmsg.count=count;\n//global.set(\"zahl\",count);\n\nreturn msg;","outputs":1,"noerr":0,"x":260,"y":180,"wires":[["6aa91812.76a308"]]}]
ResCount
[{"id":"c4ac4f73.499d1","type":"function","z":"7fdc0f6d.41cfc","name":"Reset","func":"var reset = global.get(\"count\");\nreset = 0;\nglobal.set(\"count\",reset);\nmsg.count = 0;\n\nreturn msg;","outputs":1,"noerr":0,"x":260,"y":260,"wires":[["6aa91812.76a308"]]}]
Count-1
[{"id":"dd1e9107.4444b","type":"function","z":"7fdc0f6d.41cfc","name":"Minus1","func":"var minus = global.get(\"count\");\nminus = minus -1;\nglobal.set(\"count\",minus);\nmsg.count = minus;\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":320,"wires":[["6aa91812.76a308"]]}]
JoinCOunt
[{"id":"dd285a93.d86cb8","type":"join","z":"1496f29f.83002d","name":"","mode":"custom","build":"array","property":"payload.content","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":690,"y":360,"wires":[["e48c6df4.888be"]]},{"id":"e48c6df4.888be","type":"function","z":"1496f29f.83002d","name":"","func":"var count=context.get('count')||0;\n\nif(msg.payload.content[0] ==\"LS1\" && msg.payload.content[1] ==\"LS2\" )\n{\n count++;\n}\nif(msg.payload.content[0] ==\"LS2\" && msg.payload.content[1] ==\"LS1\" )\n{\n count--;\n}\ncontext.set('count' ,count);\n\nmsg.count = count;\n\nreturn msg;","outputs":1,"noerr":0,"x":830,"y":360,"wires":[["7c322f41.db037","a115bb83.3525a8"]]}]
I have also some pages to help to understand.
Greets Hubertus