If you end up doing this (or something similar) you might be interested in being able to test it from the command line:
Code:
# cd /sys/class/gpio
# echo 57 > export
# cat gpio57/value
0
# cat gpio57/value
1
# echo 57 > unexport
A value of 1 is when a magnet is present.
gpio57 is correct for Poke3, no guarantee for anything else.