sonos-api is a easy and simple http api gatway to control the Sonos devices in the network.
- Github repo: https://github.com/richarddeweerd/sonos-api/
- Docker Hub: https://hub.docker.com/r/rdweerd/sonos-api
The code is based on:
For compatibility it mimics the API of node-sonos-http-api by jishi
Sonos API is available as a Docker image, install with the following Docker command:
docker pull rdweerd/sonos-api
After installation the service is running on port 80
Swagger file http://<sonos-api>/docs
/
/zones
/playall
/pauseall
/resumeall
/{zone_name}
/{zone_name}/{action}/{parameter}
Any call to http://:80/ and http://:80/zones will rescan the network for new Sonos devices and return all the zone information
Returns the info of a specific zone
Next item in the queue
Pauses playout
Starts playout
Previous item in the queue
Changes the volume of the zone. The parameter is absolute or relative. If the volume is prefixed with +/- it will be treated as a relative volume change
Examples:
/<zone_name>/volume/10 Sets the volume to 10 percent
/<zone_name>/volume/+10 Increases the volume with 10 percent
/<zone_name>/volume/-10 Decreases the volume with 10 percent
Changes the volume of the group where this zone is part of. The parameter is absolute or relative. If the volume is prefixed with +/- it will be treated as a relative volume change
Examples:
/<zone_name>/groupVolume/10 Sets the volume to 10 percent
/<zone_name>/groupVolume/+10 Increases the volume with 10 percent
/<zone_name>/groupVolume/-10 Decreases the volume with 10 percent
Available values : on, off, toggle
Available values : on, off, toggle
Joins the zone into the zone_master
/<zone_name>/join/<zone_master>
Leaves the group
list the favorites
Returns the player queue
Available values : on, off, toggle
Available values : on, off, toggle, one
Available values : normal, shuffle_norepeat, shuffle, repeat_all, shuffle_repeat_one, repeat_one
Selects and playes a favorite. Currently tested with Spotify playlists, TuneIn stations and deezer playlists
Plays uri (very experimental)