Might work, you have to lift it up off the steel. See the following discussion (this is a clickable link)
Just as significantly, though, people use accelerometers because then you have a tilt sensor, which let you distinguish between “open” and “opening.” The contact sensor can only give you end state.