One way to compactly use the inputs / outputs of the ESP8266-12E is to connect the inputs / outputs of the components via I / O port expanders, so-called GPIO extenders, connected to the controller by means of a serial interface, commonly known as a bus. I2C .
Read about these devices in the publication How to connect a large number of components to the ESP8266-12 module or NodeMCU board