That's certainly a fine way to do that, and easy enough to install a relay for this purpose.