I automated 10 of my interior doors. When I built my house, I had it pre-wired at all the interior doors for door contacts. I have been holding off on wiring them because of the cost per input for my Security/Automation panel (HAI).
Following the lead of @sipvoip I purchased a Pokeys57E that has 57 digital input/outputs on it that can be read with modbus. The device costs about $55 - really hard to beat on a dollar per input basis.
I installed contacts in many of the closets and some of the bedroom doors. The contacts drive automated lighting.
One thing that I struggled with was how to get a combined ground for use across the digital inputs. @sipvoip used a wirenut - I was really worried about connections coming loose with wire nuts. I ended up buying some screw terminals with barrier strips. At first, I was going to use one screw terminal per ground, but I can get 3 or 4 securely.