I didn’t like having to turn my speakers off when I left my apartment. I had already figured out how to turn all my lights off with IFTTT so why not make this work with Sonos. Using a Raspberry Pi and a Sonos command-line interface I hooked up a very basic home REST API where I could detect my phone leaving a location using a geofence.
Raspberry Pi model B plugged into an Airport router via Eithernet. This puppy is always on and has a port mapped to the outside world for external access.
Now when I leave it makes a request to my home and the music turns off.