Hello Simon
I was expecting something was implemented already however seems not to be.
You need first to install I2C on your rasberry by doing on a console: sudo apt-get install -y i2c-tools
Then you need to enable I2C bus on raspberry by writting on a console: sudo raspi-config go to option 5 intfacing and enable I2C bus.
I recomend to reboot just in case at this point
Then you need to scan in order to find the address of your plugged device: i2cdetect -y 1
You will have something line:
pi@raspberrypi:~ $ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
In this case it means your device will be address 20 so 0x20
In order to read the status of the inputs type: i2cget -y 1 0x20, this will return you the status of your 8 bits in hexdecimal so all to 0 is 0x00 and all to one is 0xFF.
If you want to use it as an output will have to do exactly the same but with i2cset.
For what I investigated seems to be all, any other advice is wellcome.
At this point on node red seems not to be any specific, at list I don't find the wat to do it.
Just inject on a exec node with the corresponding comand and get the output of the exec if required to read status, as example:
[{"id":"db48c4bd.87f6d8","type":"inject","z":"5e06df2b.eecce","name":"","topic":"","payload":"","payloadType":"date","repeat":"0.200","crontab":"","once":true,"x":120,"y":1500,"wires":[["8e270273.7cd55"]]},{"id":"8e270273.7cd55","type":"exec","z":"5e06df2b.eecce","command":"i2cget -y 1 0x20 ","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":310,"y":1500,"wires":[["4ca0f517.6d367c"],[],[]]},{"id":"4ca0f517.6d367c","type":"debug","z":"5e06df2b.eecce","name":"","active":true,"console":"false","complete":"false","x":600,"y":1500,"wires":[]}]
This will read the status of the 8 bits each 200 miliseconds and will show you the value on a debug node.
I'm going to try to make some function with multiple outputs/inputs to make it much easier to work with, however again, if someone has already something or some advice is really wekkcome.
Regards