Public Repository

Last pushed: a year ago
Short Description
node-sonos-http-api built to run in Docker on Synology NAS. See full description for details.
Full Description

This is a node-sonos-http-api built to run on Synology NAS and built from https://github.com/jishi/node-sonos-http-api. Refer to https://github.com/jishi/node-sonos-http-api for descriptions and links to config file examples.

I am running a Synology 1815+ and DSM 6.0-7321.

On the Synology NAS, create a folder on your shared volume called "docker/sonos". Copy settings.json and presets.json in the folder. Create a subfolder "docker/sonos/cache". This folder will be used to store cached tts files and they will persist when the container is stopped, removed and restarted.

You can start the container from command line by entering

sudo docker run --name=sonos --net=host --restart=always --volume /volume1/docker/sonos/presets.json:/opt/app/presets.json --volume /volume1/docker/sonos/settings.json:/opt/app/settings.json --volume /volume1/docker/sonos/cache:/opt/app/static/tts -d psmith/synology-docker-node-sonos-http-api

You can also create a script that can be used to kill, remove and restart the container at boot up and also if you want to restart the container on a schedule. I have mine restart every night at 1:45am.

That script would look like this:

#!/bin/bash
docker kill sonos
docker rm sonos
docker run --name=sonos --net=host --restart=always --volume /volume1/docker/sonos/presets.json:/opt/app/presets.json --volume /volume1/docker/sonos/settings.json:/opt/app/settings.json --volume /volume1/docker/sonos/cache:/opt/app/static/tts -d psmith/synology-docker-node-sonos-http-api

You can create a task on the Synology Task Scheduler in the Control Panel that references this script.

Docker Pull Command
Owner
psmith

Comments (3)
marcbroe
6 hours ago

Hello, I need your help once. What do I have to adjust exactly in Synology. I have the folder docker and in it a Sonos order and also in the settings.json and the presets.json but the Sonos Api from you the settings.json not? Here is a cut out from the log. Thank you ever

info: discovering all IPs from eth0

info: relevant IPs 192.168.178.100=null

{ [Error: Cannot find module './settings.json'] code: 'MODULE_NOT_FOUND' }

info: notification server listening on port 3500

http server listening on port 5005

no preset file, ignoring...

info: scanning for players in ip 192.168.178.100

info: subscribing to topology 192.168.178.25

info: using local endpoint 192.168.178.100

Initializing player Kinderzimmer

Initializing player Wohnzimmer

Initializing player Büro

egrigson
9 months ago

Thanks for this, will try out later today hopefully. One question - why do you restart it every night? Stability issues?

cheetahgear
10 months ago

It would be nice to have an automated build since there have been quite a few changes in the past weeks (and I expect more in the coming months).

Also, if you could share your dockerfile, it would be much appreciated.