Open-source sonos apps
Out of personal interest I’ve build several apps to have better control your Sonos speakers. This page will give you a brief overview of these apps.
Sonos2mqtt
Sonos2mqtt is an application that let’s you control your sonos speakers from your mqtt server. This application is mostly used by people who were already using mqtt in there home automation system.
Key features:
- Quickly respond to changes to tracks (skip some artist in a “recommended songs”-playlist)
- Group & Un-group players with a simple command
- Players get removed from the group with your playbar in it (if you want), but they won’t re-group after you stopped watching tv. With this app you can.
- Truly lock volume of players (you immediately get volume updates and can instruct the player to turn down the volume).
- Play notifications and revert to original song afterwards.
- Play text to speak announce something in your house.
- All the obvious music controls off-course, like
Play
,Pause
,Next
,Previous
and a lot of other controls.
This is used alot, but because this is a local only app, without tracking inside, I can only see how often it’s downloaded. Counting 334k
pulls on docker and 24k
downloads on NPM in the last 3 years. I can say there seems to be a solid user base.
Sonos-ts
Control your sonos speaker from any node/typescript application. Some key features of this library are:
- Basic controls of the speakers
- Advanced device controls
- Total local control, no cloud needed.
- Listening to all events from the sonos speakers.
- Track changes
- Group changes
- Volume
- All other properties that emit events
- Playing notifications, play a doorbell sound and automatically revert to the original playlist.
- Text-to-speech generate an mp3 file for some text and play it as a notification. For instance to announce something or read a custom weather message
- Interact with third party music services, like Spotify.
This library is supporting 95% percent of the original sonos application. I’ve also build a generator to generate the code interacting with the services, see below.
This library is downloaded 61.5k
times in the last three year
Sonos API documentation and generator
I’ve also documented all the local endpoints of the sonos speakers. Actually the documentation is one of the products of the documentation generator.
The generator is used for the typescript library, but other could us it to generate strong typed classes for their own library.
The manual work laid in crafting this file. Containing all the documentation for a lot of services. PR’s are highly appreciated.
Home automation
What does your ultimate home automation system look like? I’m curious to your home automation hacks.
Open source
All these applications are open-source, and while I do have a github sponsor profile, it doesn’t make me a lot of money. So if anybody got suggestions on how to partially monetize these libraries, please send me a message.
It seems to be a rough world for open source maintainers. People think that there issue should always be solved with top priority. Recently I’ve put a new perk on my Github Sponsor profile for people that want me to quickly look at some issue. I will be referring to that when people harass me to fix an issue quickly.