My solution for doing this may be more complex than what you are looking to do, but this has worked for me to protect my garage.
I use a Raspberry Pi as an alarm server which I placed in the garage. My Pi connects to my WiFi network. I wrote a python program (let's call AlarmServer) that...