Connect Wyze Hub to old alarm system sensor loops

I think I can wire a small electromagnet into an existing NC alarm loop from previous alarm system and use that to close V2 sensor. Any opening of alarm loop would turn off electromagnet and activate V2 sensor, setting off alarm. Loop and magnet would be powered by low voltage wall wart, possibly attached to Wyze switch to energize only after Sense Hub changes from Disarmed to either Home or Away. Getting supplies to test. Any comments about this possible approach?