Sonos Command Line Controller Available (Python soco-cli)



Show first post

55 replies

Userlevel 7
Badge +20

SoCo-CLI v0.3.31 introduces additional control over Sonos alarms.

In addition to being able to list alarms, it’s now possible to create alarms, delete alarms, and enable or disable alarms, using their alarm IDs. The new actions are: ‘create_alarm’, ‘remove_alarm’, and ‘enable_alarm’.

As always, feedback is welcome.

Userlevel 7
Badge +20

FYI: Plenty of new features added over the last few days:

https://github.com/avantrec/soco-cli/blob/master/CHANGELOG.txt

Here’s a little automation usage example: my wife wants the speakers in our bedroom to revert to a specific radio channel after use, so she can just walk in and press the speaker button to start playback. Here’s the script I run:

sonos Bedroom wait_start : Bedroom wait_stopped_for 2m : Bedroom mute on : Bedroom play_fav "Radio 4" : Bedroom stop : Bedroom mute off : loop

I just leave this running on one of my Raspberry Pis. It detects when playback has stopped for a couple of minutes, tees up the default radio station, then loops back.

Userlevel 4
Badge +2

I like this very much.  Now just need to whack a web server on it and a few web pages to call the python.  There goes my weekend....

Userlevel 7
Badge +20

I like this very much.  Now just need to whack a web server on it and a few web pages to call the python.  There goes my weekend....

Great. Please let me know of any issues, and any extra features you’d like to see.

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