Home Assistant with wired serial gateway Mysensors

Hello.
Does anyone make a home automation with HA and mysensors wired gateway on Arduino Mega connected to RPI?

I have new flat and is time to do wired installation for automation
I want use a 32 digital pins to add 32 relays for lights and add 16 buttons to work with lights.

I search arduino sketch for that many things connected