This app was mentioned in 15 comments, with an average of 2.00 upvotes
You can do this using Tasker in combination with Macronos. Macronos isn't free, but IMO it's easily powerful enough to justify spending $3.99 on it (I'm not the author, just a fan of it). There's more info about setting it up with Tasker here.
Edit: Upon further inspection, you can use wifi as a trigger within Macronos itself, so no need for Tasker at all. One of the features they list on the Play Store description: "Wi-Fi play - Starts playback when arriving home."
Or for Android users, can do PA mode with Macronos, which has a couple of other cool features like lowering volume automatically when you make or receive a phonecall, automatic play when connecting to your wifi network, etc.
I use Macronos to turn on music automatically when my phone connects to my home wireless. It also reduces the volume when the phone rings, which is nice.
Turning it off when you leave is a harder problem, I've got a script watching a log on my router for my phone's MAC address leaving the wireless network and using SoCo to stop whatever's playing.
Actually it looks like this app has Tasker plugins too so you could probably get this and do the rest of what I described wsith Tasker but pass it through this app to talk to the Sonos.
https://play.google.com/store/apps/details?id=dk.youtec.android.macronos&hl=en
On Android there is an app called Macronos that helps with grouping.
You can add shortcuts to your home screen to allow quick grouping, for instance: upstairs, downstairs, everywhere. https://play.google.com/store/apps/details?id=dk.youtec.android.macronos
This app will let you talk into your phone and play it through a Sonos speaker (amongst other features). Little bit of lag, possibility of horrible feedback if you're in the same room, and no two way audio, but might work in a pinch (or for your amusement).
https://play.google.com/store/apps/details?id=dk.youtec.android.macronos
Actually for the wifi trigger, you don't even need Tasker...Macronos itself has that option.
One of a bunch of features in this app.
https://play.google.com/store/apps/details?id=dk.youtec.android.macronos
It's obviously not a zero lag solution but works well enough.
I use this app (Android), it's got a PA mode.
I do to - it's the first piece of hardware I've backed on Kickstarter, it's been delayed once so far but it looks like they're on track now. The videos they've posted of device setup and the like are looking promising.
I've been using Macronos, which automatically drops the volume on the speakers when I get a call, then restores it afterward. Also has some nice features like auto-starting music when I walk into WiFi range that have been useful.
Frankly, most voice control products' understanding of my accent is so profoundly useless that I feel no need to purchase one, maybe in a few years.
I think you're probably onto something by building it yourself - maybe try an ESP8266 if you need something a bit smaller/lower-power than a Pi.
Otherwise, quick Google search - for things that resemble keypads as that iPort does, rather than universal remote type things like the Logitech Hamony, etc found these:
The major theme seems to be they're remotes that just use some kind of wireless to talk to some kind of hub. Most also appear to be generic smart home control devices, but that seems fine. If I were forced to choose from those (and I did find others, but I excluded the Bluetooth-to-your-phone kind of products) I'd say the Nuimo looks like the nicest option. Don't know how easily you'd get your hands on one though.
You should check out Macronos
https://play.google.com/store/apps/details?id=dk.youtec.android.macronos&hl=en