That won’t work on a real safe. The soleniod is inside the safe behind the steel door whick blocks the magnet.
https://www.youtube.com/watch?v=ZohdXRYaWWY
It’s not like I made this up...