This is a simple working Node-Red example for a Raspberry PI with an GPIO Port extender MCP23017. It is easy possible to control the MCP23017 with Node-RED.
Here a screenshots from the devices. The description on developer page is not really good. We needed 2 days for the right settings. It is really simple.
The overview Example Node-RED MCP23017

Here the screenshot from the Raspberry PI mcp23017

The Status Node (To see which pin is off or on)

The Pin 7 OFF

Pin 7 ON

All ON

All OFF

A switch for the Website (Dashboard) for all GPIOs

The msg.payload is only for debug to see the commands. You don’t need it.

So now you can extend your program and try some solutions.
Here is the complete code from this Flow to import in your system Node-RED MCP23017.
[ { "id": "ed2d8f08.a0c38", "type": "tab", "label": "Flow 1" }, { "id": "ed29ea8a.fe4058", "type": "mcp23017", "z": "ed2d8f08.a0c38", "name": "MCP23017 Node", "topic": "", "address": "0x20", "device": "/dev/i2c-1", "x": 391, "y": 264, "wires": [ [ "7d7f7a50.181eb4" ] ] }, { "id": "9051c299.39168", "type": "inject", "z": "ed2d8f08.a0c38", "name": "Get Status", "topic": "home/sprinklers/status", "payload": "", "payloadType": "str", "repeat": "", "crontab": "", "once": false, "x": 183, "y": 116, "wires": [ [ "ed29ea8a.fe4058" ] ] }, { "id": "5daeb3b2.2b1e9c", "type": "inject", "z": "ed2d8f08.a0c38", "name": "pin7 ON", "topic": "devices/sprinklers/7", "payload": "ON", "payloadType": "str", "repeat": "", "crontab": "", "once": false, "x": 132, "y": 275, "wires": [ [ "ed29ea8a.fe4058" ] ] }, { "id": "f839911c.dd3338", "type": "inject", "z": "ed2d8f08.a0c38", "name": "pin7 OFF", "topic": "devices/sprinklers/7", "payload": "OFF", "payloadType": "str", "repeat": "", "crontab": "", "once": false, "x": 138, "y": 217, "wires": [ [ "ed29ea8a.fe4058" ] ] }, { "id": "594acb2c.00199c", "type": "inject", "z": "ed2d8f08.a0c38", "name": "all", "topic": "home/sprinklers/ALL", "payload": "ON", "payloadType": "str", "repeat": "", "crontab": "", "once": false, "x": 117, "y": 342, "wires": [ [ "ed29ea8a.fe4058" ] ] }, { "id": "7d7f7a50.181eb4", "type": "debug", "z": "ed2d8f08.a0c38", "name": "", "active": true, "console": "false", "complete": "payload", "x": 434, "y": 126, "wires": [] }, { "id": "15134f70.7a7aa1", "type": "inject", "z": "ed2d8f08.a0c38", "name": "all", "topic": "home/sprinklers/ALL", "payload": "OFF", "payloadType": "str", "repeat": "", "crontab": "", "once": false, "x": 119, "y": 449, "wires": [ [ "ed29ea8a.fe4058" ] ] }, { "id": "4197d82b.22a208", "type": "ui_switch", "z": "ed2d8f08.a0c38", "name": "ALL Switch", "label": "switch", "group": "a1871db5.cff14", "order": 0, "width": 0, "height": 0, "passthru": true, "topic": "ALL", "style": "", "onvalue": "OFF", "onvalueType": "str", "onicon": "", "oncolor": "", "offvalue": "ON", "offvalueType": "str", "officon": "", "offcolor": "", "x": 143, "y": 554, "wires": [ [ "ed29ea8a.fe4058" ] ] }, { "id": "a1871db5.cff14", "type": "ui_group", "z": "", "name": "Default", "tab": "eb7d3ee9.f2da28", "disp": true, "width": "6" }, { "id": "eb7d3ee9.f2da28", "type": "ui_tab", "z": "", "name": "Home", "icon": "dashboard" } ]
Only the flow
[ { "id": "ed29ea8a.fe4058", "type": "mcp23017", "z": "ed2d8f08.a0c38", "name": "MCP23017 Node", "topic": "", "address": "0x20", "device": "/dev/i2c-1", "x": 391, "y": 264, "wires": [ [ "7d7f7a50.181eb4" ] ] }, { "id": "9051c299.39168", "type": "inject", "z": "ed2d8f08.a0c38", "name": "Get Status", "topic": "home/sprinklers/status", "payload": "", "payloadType": "str", "repeat": "", "crontab": "", "once": false, "x": 183, "y": 116, "wires": [ [ "ed29ea8a.fe4058" ] ] }, { "id": "5daeb3b2.2b1e9c", "type": "inject", "z": "ed2d8f08.a0c38", "name": "pin7 ON", "topic": "devices/sprinklers/7", "payload": "ON", "payloadType": "str", "repeat": "", "crontab": "", "once": false, "x": 132, "y": 275, "wires": [ [ "ed29ea8a.fe4058" ] ] }, { "id": "f839911c.dd3338", "type": "inject", "z": "ed2d8f08.a0c38", "name": "pin7 OFF", "topic": "devices/sprinklers/7", "payload": "OFF", "payloadType": "str", "repeat": "", "crontab": "", "once": false, "x": 138, "y": 217, "wires": [ [ "ed29ea8a.fe4058" ] ] }, { "id": "594acb2c.00199c", "type": "inject", "z": "ed2d8f08.a0c38", "name": "all", "topic": "home/sprinklers/ALL", "payload": "ON", "payloadType": "str", "repeat": "", "crontab": "", "once": false, "x": 117, "y": 342, "wires": [ [ "ed29ea8a.fe4058" ] ] }, { "id": "7d7f7a50.181eb4", "type": "debug", "z": "ed2d8f08.a0c38", "name": "", "active": true, "console": "false", "complete": "payload", "x": 434, "y": 126, "wires": [] }, { "id": "15134f70.7a7aa1", "type": "inject", "z": "ed2d8f08.a0c38", "name": "all", "topic": "home/sprinklers/ALL", "payload": "OFF", "payloadType": "str", "repeat": "", "crontab": "", "once": false, "x": 119, "y": 449, "wires": [ [ "ed29ea8a.fe4058" ] ] }, { "id": "4197d82b.22a208", "type": "ui_switch", "z": "ed2d8f08.a0c38", "name": "ALL Switch", "label": "switch", "group": "a1871db5.cff14", "order": 0, "width": 0, "height": 0, "passthru": true, "topic": "ALL", "style": "", "onvalue": "OFF", "onvalueType": "str", "onicon": "", "oncolor": "", "offvalue": "ON", "offvalueType": "str", "officon": "", "offcolor": "", "x": 143, "y": 554, "wires": [ [ "ed29ea8a.fe4058" ] ] }, { "id": "a1871db5.cff14", "type": "ui_group", "z": "", "name": "Default", "tab": "eb7d3ee9.f2da28", "disp": true, "width": "6" }, { "id": "eb7d3ee9.f2da28", "type": "ui_tab", "z": "", "name": "Home", "icon": "dashboard" } ]
Hi, do you have this node still in use?
I’m not able to install the required type “MCP23017”.
Maybe you can assist me?
Hi Chris
I am also struggling to get it to install.
Have you had any luck?