I did some searching and found a few topics related to this, but most seemed pretty old and I didn't get a clear answer. My hardware/circuits knowledge is pretty basic, so please bare with me.

I have a Pi 2 B. I would like to receive input from a magnetic reed switch attached to my garage door as well as send output signals to a relay to open my garage door. The problem is, I do not want to move my Pi out to the garage for this. I would like to keep it here in my office and route a wire through the wall/attic. My guess is this would be about 50ft of wiring.

If any, what are the challenges/problems with trying to do this? If so, what are the solutions? How long of a wire can I run from a GPIO pin without causing problems for receiving input and sending output? Thanks!