falls das Thema noch wen interessiert:
ich hab das mit Node-Red relativ einfach gelöst. zusätzliches npm package node-red-node-serialport installiert Node-Red-Flow [ { "id": "7f40fabab7ea23c0", "type": "serial in", "z": "c241f527b52bd10a", "name": "GMC-320", "serial": "15ad7491d36bd43d", "x": 220, "y": 100, "wires": [ [ "222a8e8215c110c6" ] ] }, { "id": "222a8e8215c110c6", "type": "function", "z": "c241f527b52bd10a", "name": "function 4", "func": "//@superflip - 2025-03-25\n\nif (msg.payload && Buffer.isBuffer(msg.payload) && msg.payload.length > 0) {\n //read Buffer and write to local variable\n let buffer = msg.payload;\n let cpm = buffer.readUInt8(0);\n\n // check, if counter already exists\n if (!context.counterCPM) {\n context.counterCPM = 0; // Initialisiere den Zähler\n //first buffer is sometimes set to 128\n if (cpm == 128) {\n cpm=0;\n }\n }\n\n // calculate time since last reset\n let currentTime = new Date().getTime();\n if (!context.lastResetTime) {\n context.lastResetTime = currentTime;\n }\n\n //add new value to counter\n context.counterCPM += cpm;\n\n // if 60s are over\n if (currentTime - context.lastResetTime >= 60000) {\n // write msg.payload.total for further processing\n msg.payload = { total: context.counterCPM};\n // reset counter\n context.counterCPM = 0;\n context.lastResetTime = currentTime;\n }\n\n} \n\nreturn msg;\n", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 400, "y": 100, "wires": [ [ "72e83dc1246866b4" ] ] }, { "id": "72e83dc1246866b4", "type": "switch", "z": "c241f527b52bd10a", "name": "", "property": "payload.total", "propertyType": "msg", "rules": [ { "t": "nnull" } ], "checkall": "true", "repair": false, "outputs": 1, "x": 550, "y": 100, "wires": [ [ "755b9544f295d10a" ] ] }, { "id": "427bfe4a2025d94e", "type": "ioBroker out", "z": "c241f527b52bd10a", "name": "CPM schreiben", "topic": "0_userdata.0.test.radioactivity", "ack": "true", "autoCreate": "false", "stateName": "", "role": "", "payloadType": "", "readonly": "", "stateUnit": "", "stateMin": "", "stateMax": "", "x": 940, "y": 100, "wires": [] }, { "id": "755b9544f295d10a", "type": "change", "z": "c241f527b52bd10a", "name": "", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "payload.total", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 730, "y": 100, "wires": [ [ "427bfe4a2025d94e" ] ] }, { "id": "15ad7491d36bd43d", "type": "serial-port", "name": "", "serialport": "/dev/ttyUSB0", "serialbaud": "115200", "databits": "8", "parity": "none", "stopbits": "1", "waitfor": "", "dtr": "none", "rts": "none", "cts": "none", "dsr": "none", "newline": "0x80", "bin": "bin", "out": "char", "addchar": "", "responsetimeout": "10000" } ]