Hacking Sonos

How I replaced the Sonos app and created a better music experience.

In my spare time I’ve been writing an app that replaces the Sonos app used to control multiple speakers in one’s home. It’s been a little challenging so I thought I’d share how I got where I am. You can check out most of the code on Github. I’ll be pushing more stuff when it’s ready.

Finding an API

First off I needed to understand how the existing app was communicating with speakers. Sonos doesn’t really have an official API so I had to do some digging. Wireshark is the perfect tool.

A Wireshark session where I’m trying to figure out what data Sonos is sending to pair speakers with other speakers.

Wireshark lets you watch all the traffic on a network, allowing you to see what requests are being passed between the speakers and the app. This established a base understanding of what was needed to build a new app.