How to: GPIO integration of old Alarm system contact sensors

This thread might provide you what you’re looking for.