Hi! Sweet project You can definitely use platformio to build your firmware for an ESP8266, or ESP32, in fact that’s what I’d do myself.
You could use the arduino framework (within platformio) to do this, as this might ease any programming you need to do, and for example, you could use MQTT libraries available for arduino to send data to home assistant.
As for the port expander that looks quite nice for 16 channels, per expander. It uses I2C which is nice and simple for connecting it, and there is a module available, if you haven’t come across this already on PiHut.
You can connect multiple of these to the same I2C bus for your 30 channels input and output.
May I suggest an alternative, if you would like to control these LEDs, but with individual brightness (for extra fanciness)? If this sounds interesting, the PCA9635 is a nice chip and available very cheaply on easy-to-connect modules, too. Basically the same as the MCP23017, but you get brightness control, too, although you’d still need to handle the inputs to read the fuses, for which the MCP would be a good option.
As far as baby steps go, to start your platformio project, you can make a folder, run platformio init inside the folder, and edit platformio.ini with the following, to get you started for ESP development, for example with a D1 mini board, for example:
This question doesn’t depend on PlatformIO. It’s just the build system that gives you a development enviornment for the ESP32 and e.g. the Arduino framework. It’s all about the capabilities of the ESP32. The same could be done in other build environments, like the Arduino IDE.