Sonos Command Line Controller Available (Python soco-cli)


Userlevel 7
Badge +20
  • Virtuoso
  • 1873 replies

I’ve created a simple command line control program for Sonos, implemented in Python. I find it very useful for creating a variety of Sonos control scripts (e.g., using cron to run scripts at specific times), and sometimes just for quickly controlling my Sonos systems when I don’t want to start the app.

It works with S1, S2, and split Sonos systems, and it should run on any OS that supports Python 3.

If you’re comfortable using Python and the command line, you may find it useful, too. It’s quite powerful, with a wide range of control actions, yet simple to install and use.

GitHubhttps://github.com/avantrec/soco-cli

PyPihttps://pypi.org/project/soco-cli

This is an early release, so expect some bugs and limitations. I’d welcome your feedback and suggestions.


55 replies

Awesome PWT!  This is great.  Thank you.

Userlevel 7
Badge +20

For anyone using SoCo-CLI’s HTTP API server feature, I’ve now added the ability to parameterise macros. This is quite a powerful feature and is available in v0.4.38 and later. The details are in the documentation at:

https://github.com/avantrec/soco-cli/blob/master/README.md#macro-arguments

Any questions or problems, just let me know ...

@pwt Very nice piece of software!

When using the http-api-server, I am not able to add a sharelink (e.g. the one you provided in the docs: https://music.apple.com/dk/album/black-velvet/217502930?i=217503142)

http://api.example.com:8000/Dachgeschoss/sharelink/https%3A%2F%2Fmusic.apple.com%2Fdk%2Falbum%2Fblack-velvet%2F217502930%3Fi%3D217503142

Always returns { "detail": "Not Found" }

What am I doing wrong? Do I need to encode the link or somehow escape it?

Regards
Christian

 

Userlevel 7
Badge +20

@pwt Very nice piece of software!

When using the http-api-server, I am not able to add a sharelink (e.g. the one you provided in the docs: https://music.apple.com/dk/album/black-velvet/217502930?i=217503142)

http://api.example.com:8000/Dachgeschoss/sharelink/https%3A%2F%2Fmusic.apple.com%2Fdk%2Falbum%2Fblack-velvet%2F217502930%3Fi%3D217503142

Always returns { "detail": "Not Found" }

Defect raised at: https://github.com/avantrec/soco-cli/issues/38

Userlevel 7
Badge +20

@pwt Very nice piece of software!

When using the http-api-server, I am not able to add a sharelink (e.g. the one you provided in the docs: https://music.apple.com/dk/album/black-velvet/217502930?i=217503142)

http://api.example.com:8000/Dachgeschoss/sharelink/https%3A%2F%2Fmusic.apple.com%2Fdk%2Falbum%2Fblack-velvet%2F217502930%3Fi%3D217503142

Always returns { "detail": "Not Found" }

Defect raised at: https://github.com/avantrec/soco-cli/issues/38

Fixed in v0.4.51.

Reply