https://github.com/bytedev/bytedev.sonos
Set of classes and tools to help control Sonos devices.
https://github.com/bytedev/bytedev.sonos
csharp sonos upnp
Last synced: 7 months ago
JSON representation
Set of classes and tools to help control Sonos devices.
- Host: GitHub
- URL: https://github.com/bytedev/bytedev.sonos
- Owner: ByteDev
- License: mit
- Created: 2019-01-27T17:06:21.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-01T23:46:49.000Z (about 3 years ago)
- Last Synced: 2025-06-21T03:40:10.939Z (7 months ago)
- Topics: csharp, sonos, upnp
- Language: C#
- Size: 1.98 MB
- Stars: 20
- Watchers: 5
- Forks: 5
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://ci.appveyor.com/project/bytedev/ByteDev-Sonos/branch/master)
[](https://www.nuget.org/packages/ByteDev.Sonos)
[](https://github.com/ByteDev/ByteDev.Sonos/blob/master/LICENSE)
# ByteDev.Sonos
Set of classes and tools to help control Sonos devices.
## Installation
ByteDev.Sonos has been written as a .NET Standard 2.0 library, so you can consume it from a .NET Core or .NET Framework 4.6.1 (or greater) application.
ByteDev.Sonos is hosted as a package on nuget.org. To install from the Package Manager Console in Visual Studio run:
`Install-Package ByteDev.Sonos`
Further details can be found on the [nuget page](https://www.nuget.org/packages/ByteDev.Sonos/).
## Release Notes
Releases follow semantic versioning.
Full details of the release notes can be viewed on [GitHub](https://github.com/ByteDev/ByteDev.Sonos/blob/master/docs/RELEASE-NOTES.md).
## Usage
At the highest level there are two main classes in the ByteDev.Sonos assembly: `SonosController` and `SonosDeviceService`.
### SonosController
SonosController allows you to control the speaker, aspects of it's queue, and operations on it's current track.
```csharp
SonosController controller = new SonosControllerFactory().Create("192.168.1.100");
SonosVolume volume = await controller.GetVolumeAsync();
volume.Increase(10);
await controller.SetVolumeAsync(volume);
```
### SonosDeviceService
SonosDeviceService allows you to get details about a particular Sonos device and even restart the device.
```csharp
var service = new SonosDeviceService();
var sonosDevice = await service.GetDeviceAsync("192.168.1.100");
var httpResponseMessage = await service.RebootAsync("192.168.1.100");
```