Physical wiring

I am new to homeassistant and I have a question about physical wiring in a new house.

I did not decide for KNX, because I wanted to have classic wiring at first. Physical wires go from every light, switch to the electrical cabinet (each 3 wires). I wanted to use a touch switch and a bipolar relay to operate every light. Later I wanted to add home assistant functionality. Is this making sense?
I do not know how to physically connect homeassistant (raspbery) to the relays in electrical cabinet. So what is the best to do now, so I can upgrade later to home automation?

Every information appreciated.

I use MCP23017 connected on one side to RPi by I2C, and in other hardwired to some relay board. There’s some custom component that’s made everything easy:

Unfortunately, it is no longer supported

any solution to use MCP23017 with home-assistant?

@douglasfl check this page out Custom Components for Microchip MCP3424 A/D converters and MCP23017 16-bit I/O expander chips