Yeah I did, but that code was not working as i would like to the output wasn't correct (clean enough)
For who is interested.
The Flow
[{"id":"6ed11da6.caf884","type":"debug","z":"87abf50b.a415a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":710,"y":460,"wires":[]},{"id":"7131b02f.f4b62","type":"rpi-gpio in","z":"87abf50b.a415a8","name":"","pin":"11","intype":"up","debounce":"1","read":true,"x":140,"y":400,"wires":[["19231a0e.6e4db6"]]},{"id":"19231a0e.6e4db6","type":"switch","z":"87abf50b.a415a8","name":"Send onliy low","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"}],"checkall":"false","repair":false,"outputs":1,"x":300,"y":400,"wires":[["a29d7d95.7d29f"]]},{"id":"a29d7d95.7d29f","type":"i2c scan","z":"87abf50b.a415a8","name":"","x":120,"y":460,"wires":[[],["593b15c5.b1243c"]]},{"id":"593b15c5.b1243c","type":"i2c in","z":"87abf50b.a415a8","name":"","address":"","command":"255","count":"1","x":270,"y":460,"wires":[["74ae86fd.7508c8"]]},{"id":"f7b67c59.4433b","type":"rbe","z":"87abf50b.a415a8","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":415,"y":460,"wires":[["a06687a0.254868"]],"l":false},{"id":"74ae86fd.7508c8","type":"change","z":"87abf50b.a415a8","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"address","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":355,"y":460,"wires":[["f7b67c59.4433b"]],"l":false},{"id":"a06687a0.254868","type":"change","z":"87abf50b.a415a8","name":"","rules":[{"t":"delete","p":"topic","pt":"msg"},{"t":"delete","p":"command","pt":"msg"},{"t":"delete","p":"size","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":475,"y":460,"wires":[["9398d728.f73838"]],"l":false},{"id":"9398d728.f73838","type":"function","z":"87abf50b.a415a8","name":"","func":"var Pin=context.get('Pin');\nif (Pin===undefined){ // this check cos var Pin=context.get('Pin') || 0; fails for me\n Pin = context.get('Pin');\n var _obj = \"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\";\n context.set(\"Pin\", _obj);\n}\nvar obj = context.get(\"Pin\");\nvar arr= obj.split(\",\");//Array.from(obj);\n for (var i = 0; i < arr.length; i++) {\n arr[i] = parseInt(arr[i]);\n }\n\nvar _byte = msg.payload ^ (1 << 8) - 1; //inputs are High, so flip bit\nvar pcf8574 = (msg.address-32); //The addresses of the PCF in dec, so we have 0 for the first 1 for...etc.\nvar state, bit, pinNr;\n\nfor (i =0;i<8;i++) { \n bit = ((_byte & (1 << i)) !== 0) ? 1 : 0; // set bit to 1, if bit !== 0 \n pinNr = (pcf8574*8)+i; //pinNr 0 to 47\n if (arr[pinNr] === bit )\n {\n continue;\n } else \n msg.payload = pinNr + 1 + \",\" + bit; //pinNr 1 to 48, High or Low\n arr[pinNr] = bit;\n node.send(msg);\n } \n\ncontext.set(\"Pin\", (arr.toString()));\n\nreturn ;\n","outputs":1,"noerr":0,"x":535,"y":460,"wires":[["c5d878c3.d20d88"]],"l":false},{"id":"c5d878c3.d20d88","type":"change","z":"87abf50b.a415a8","name":"","rules":[{"t":"delete","p":"address","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":595,"y":460,"wires":[["6ed11da6.caf884"]],"l":false}]