With the two switches in place, you’ll now need to run the wire across the ceiling. I secured the wire to the ceiling using staples, but I was extremely careful not to damage the wire, It might be wise to use cable clips.
Now that the wires are run to the Pi, we’ll need to connect them. I prefer to use jumper cables to connect to the Pi, so I’m going cut two female to female jumper cables in half, then strip and solder them to the switch wires. Now I can easily connect them to the correct pins.
This next part is somewhat important. We need to know which wires belong to the “fully open” switch and which wires belong to the “fully closed” switch. For both switches, we’ll connect one of the wires to a ground (it doesn’t matter which wire); you can use pins 20 and 14 on the Pi. Now connect the “fully open” wire to pin 19 and the “fully closed” wire to pin 13.
It’s important that you use these pins if possible, because the software we’ll use later is configured to read from these pins. If you feel that you must use different pins, we can specify the correct pins at run time.