The first player listed in the example, "room1", will become the coordinator. It will loose it's queue when ungrouped but eventually that will be fixed in the future. Playmodes are the ones defined in UPnP, which are: NORMAL, REPEAT_ALL, SHUFFLE_NOREPEAT, SHUFFLEFavorite will have precedence over a uri. Playmode requires 0.4.2 of sonos-discovery to work.pauseOthers will pause all zones before applying the preset, effectively muting your system. sleep is an optional value that enables the sleep timer and supports the 'HH:MM:SS' format.

presets.json

You can create a file with pre made presets, called presets.json. Example content:

Sayall will group all players, set 40% volume and then try and restore everything as the way it where. Please try it out, it will probably contain glitches but please report detailed descriptions on what the problem is (starting state, error that occurs, and the final state of your system).

It only handles a single spotify account currently. It will probably use the first account added on your system. Experiment with it and leave feedback!

Docker

A docker file is included, make sure that if you use this that you start up your container with "--net=host" example:

docker run --net=host --restart=always -d <your container/image name>

The restart always is to keep it running after a reboot and to keep it alive it if crashes.More information for docker https://docs.docker.com

Webhook

NOTE! This is experimental and might change in the future! Please leave your feedback as github issues if you feel like it doesn't suit your need, since I don't know what kind of restrictions you will be facing.

Since 0.17.x there is now support for a web hook. If you add a setting in settings.json like this:

{
"webhook": "http://localhost:5007/"
}

Every state change and topology change will be posted (method POST) to that URL, as JSON. The following data structure will be sent:

{
"type": "transport-state",
"data": { (snapshot of player) }
}

or

{
"type": "topology-change",
"data": { (snapshot of zones) }
}

"data" property will be equal to the same data as you would get from /RoomName/state or /zones. There is an example endpoint in the root if this project called test_endpoint.js which you may fire up to get an understanding of what is posted, just invoke it with "node test_endpoint.js" in a terminal, and then start the http-api in another terminal.