Convert node.js api to add-on

I’ve been using a node.js Sonos API (https://github.com/jishi/node-sonos-http-api) and I’d really like to run it as a Hassio add-on. Any guidance on how I would do that? I followed the “Hello World” tutorial for creating an add-on but that doesn’t really help me a lot.

I found a docker image of the API here (https://hub.docker.com/r/chrisns/docker-node-sonos-http-api/). I created a new add-on directory and copied the Dockerfile to my new add-on Dockerfile but it doesn’t do anything that I can see when I try and install it. It’s not showing up under my installed add-ons. I don’t see anything in the home-assistant.log.

There is a part to the instructions that reads:

Then run the docker image

docker run \
  --net=host \
  --name sonos \
  --restart=always \
  -d \
  -v `pwd`/settings:/app/settings \
  -v `pwd`/clips:/app/static/clips \
  -v `pwd`/cache:/app/cache \
  -v `pwd`/presets:/app/presets \
  chrisns/docker-node-sonos-http-api 

I have no idea how to do this. On a whim I tried adding the above to the run.sh file but that didn’t seem to do anything.

Any help would be appreciated!

2 Likes

Any news on this? Did you try this? Should someone else try?

I didn’t. I have so many projects that I lost track. I spun up a Docker instance and called it a day. I’d like to get back to it eventually.

Hi @Jay_Heavner, have you got anywhere with this by any chance? thanks