Always wanted to control sonos speakers right from your dotnet application? I've created this library for you to do just that.
Warning This library is far from complete at the moment, it's just an experiment for now check features for more details.
Currently this library is not at version one, these are the planned features that need to be build before this can be called a version one.
- All sonos services generated from service discovery
- Event subscriptions
- Dynamic metadata generation based on these docs
- SonosManager class that keeps track of speaker groups
- Device discovery, though it hardly works
As an experiment I've created (mostly generated) an api and a blazor web interface to control sonos speakers.
Endpoints:
- Scalar API documentation at
/scalar - API endpoints at
/api - Album proxy at
/getaa - Blazor web interface at
/
Want to try it out? Deploy the following docker compose file:
services:
web:
image: ghcr.io/svrooij/sonos-net:0.3.0-beta
restart: unless-stopped
ports:
- "8080:8080" # Web interface
- "6329:6329" # Sonos event listener
environment:
"SONOS_EVENT_HOST": "192.168.y.y" # Change to the IP of the machine running this container, so the sonos speakers know where to send the events
"SONOS_EVENT_PORT": 6329 # Change to the port you want to listen on, make sure it's the same as the one in the ports section
"SONOS_HOST": "http://192.168.x.x:1400/" # Change to the IP of one of your sonos speakersThis project uses CodeTour in Visual Studio Code to describe how stuff works. If you want to contribute to this library, I suggest you to take a look at the code tour just to get started.
We welcome all contributions to this project, to get started be sure to checkout the CodeTour which will explain how some files get generated.
If you see a file with the .g.cs suffix it means that it is generated. Manual changes to these files will not be accepted because they will get lost upon next generation.
This library is licensed under GPL v3 and all contributions are considered to be publishable under that same license.
