What do people use SoCo for?

1,174 views
Skip to first unread message

Rob

unread,
May 30, 2014, 6:33:04 AM5/30/14
to pytho...@googlegroups.com

Hi All,

I just wondered what other people are using the SoCo scripts for - are they using them as a tool in other open-source projects - just local scripts?

This is what I used some of the early Rahim's scripts for, recently updated to the 0.7 release.

http://wiki.xbmc.org/index.php?title=Add-on:Sonos

Just wondered what everyone else was doing with them?

Rob

Kenneth Nielsen

unread,
May 30, 2014, 8:57:27 AM5/30/14
to pytho...@googlegroups.com
Hi Rob

I don't have any side projects based on SoCo yet, except the command line client socos that we work on in the same group.

On the (minimal) homepage: http://python-soco.com/ are also a copule of examples at the bottom.

\Kenneth

DPH

unread,
May 31, 2014, 3:46:52 AM5/31/14
to pytho...@googlegroups.com

Rob

unread,
May 31, 2014, 3:54:44 AM5/31/14
to pytho...@googlegroups.com
Hi DHP - Is that your way of saying you don't use it for anything? :-)

DPH

unread,
May 31, 2014, 4:03:58 AM5/31/14
to pytho...@googlegroups.com
 Hi Rob, Great question. 

I used the original Rahim project to automate my doorbell. When the doorbell is pressed what ever is playing is stopped and a "doorbell tune" played on all zones. When finished it restarts what was playing on each zone. I run it on a Raspberry Pi (which supports Python 2.7 out of the box), and has been very stable. I develop on Windows.

I am currently modulizing it, moving to the latest SoCo, and making it parameter driven. I will then add additional sensors (e.g. phone ringing).
Also adding fast short-cuts so with one press I can turn on various scenes eg a favourite radio station  or playlist on pre-specified zones at pre-specified volumes. Probably as a web page to a server running on the Pi that triggers the action on Sonos. 

Also created a basic Text to speech feature: https://github.com/DPH/say

Will not have much time in the next few weeks but will finish all this and put it on GitHub over the summer

Very interested in others work to learn and get ideas.
Cheers David

 

DPH

unread,
May 31, 2014, 4:05:20 AM5/31/14
to pytho...@googlegroups.com
Sorry - pressed the wrong button and couldn;t see how to undo it!

Rob

unread,
Jun 1, 2014, 10:24:10 AM6/1/14
to pytho...@googlegroups.com

Hi David,

I like the speech idea! - You never know - I may steal the idea for something else in the future! :-)

Rob

Murali Allada

unread,
Jun 2, 2014, 12:03:56 AM6/2/14
to pytho...@googlegroups.com
I made a simple raspberry pi based RFID controller for my sonos speakers.

Basically, I can play music by scanning an RFID card. I was toying with the idea of giving music a physical aspect, like when we would collect records or audio tapes.

My code is up on github if you'd like to use it. https://github.com/murali44/Sonos_RFID_Controller

Right now, I have an RFID card on my keychain. When I get back home from work, I place my keychain next to the RFID reader and it starts playing all the songs I have favorited on soundcloud that day.

-Murali

Rolf

unread,
Jun 2, 2014, 11:44:08 AM6/2/14
to pytho...@googlegroups.com
Hi Rob,

I am currently building something similar to this:
http://wallbox.weebly.com/

-Rolf

Rob

unread,
Jun 4, 2014, 4:25:06 AM6/4/14
to pytho...@googlegroups.com
Sounds like most people are using SoCo for "personal" projects rather than generic open-source project?

Thanks

Rob

Amir Khan

unread,
Jun 5, 2014, 3:30:12 AM6/5/14
to pytho...@googlegroups.com
Not very cool or trendy, but I am working on a script that pulls Muslim prayer times for the day off of an XML feed and then plays the call to prayer for each of the 5 prayers per day. I would have preferred to have set up the 5 alarms on the sonos system each morning with the script but it seems far easier to just set up 5 cron jobs each day instead.

On Friday, 30 May 2014 11:33:04 UTC+1, Rob wrote:

Kenneth Nielsen

unread,
Jun 5, 2014, 5:52:05 AM6/5/14
to pytho...@googlegroups.com
Well, I certainly hope to at some point a full blown desktop client for Linux at some point, which was sort of the reason I got involved in the first point. But I haven't started anything up yet, for two reasons 1) We need the lib in place first anyway and I had never tried to contribute to a lib and 2) I'm hopeful that someone else will do it ;) since GUI programming tends to be considered the more "sexy" subjects anyway

Regards Kenneth

Rob

unread,
Aug 27, 2014, 12:50:39 AM8/27/14
to pytho...@googlegroups.com

Just to update this thread - I've now actually put some documentation together (with screenshots)  to show what the XBMC Addon does, and how it looks:

http://wiki.xbmc.org/index.php?title=Add-on:Sonos

Thanks

Rob


Peter N.

unread,
May 7, 2016, 7:05:17 AM5/7/16
to SoCo - Sonos Controller
Hi Rob,

i use SoCo for personal use too. I bought my sonos speakers and was both very pleased and disappointed. Some features are so great other things are handled so bad.
Soco came in as a soultion to make my sonos so much more fun. In total i have 5 Sonos speakers.
i installed soco on a raspberry and have created some scripts that run in the background or are activated with hot-keys from a wireless keyboard connected to the raspberry.
With this i don't need a pc, mobile, laptop to activate playing the Sonos. I created buttons for Change Sonos box, load favorit playlist, load my favorite radio station, start, stop, next, volume up/down.
Another fun thing that me laugh a lot, was the implementation of text to speach of titles and artists. When a hot key is pressed, track information are read, with text to speach transfered as a mp3 file.
This file is then played on the Sonos box. With the snapshot the previos settings are then restored.
It's far from perfect but fun.

the other part is the script running in the background. I am one of the persons who shut down the Sonos systems when not used. The script in background looks if a System is powered back on.
On some i like that they start playing internet radio, on some others i preload a random playlist waiting to be played.

i am no programmer and it took me like forever to set this up, scripts are badly done but they work :)

i wanted to say thank you to all who are working on SoCo, you have done a great job.

of course i see so much potential in this library with all the limitations of the Sonos Controller Software and Sonos Systems.
Like to have in the future a player/library without the 65K limit.

Peter



Tim Stollery

unread,
Jul 7, 2017, 4:26:40 PM7/7/17
to SoCo - Sonos Controller
Hi DPH (or anyone that can help)

I'm really interested in a doorbell solution. Not really a python developer but I'll give it a good go!
My 6 year old daughter has recently been diagnosed with a Brain Tumour which has subsequently and sadly taken her eye sight from her.
Feel free to search #eleanorsvoice

We have now installed Sonos everywhere, as audio has now become so important to her.
Of course, and for example, with Audiobooks playing in several rooms and music in other rooms it is impossible to hear someone at the door!!

I've managed to install soco in to Python 3.6 on my Mac for testing. It appears to be running the example commands OK, listing zones etc.
I've installed a suitable 'chime.mp3' in to my shared music library (which is on the network and accessed by the Sonos)

What I really would like to achieve is getting various zones to pause, play the chime twice and then resume.
That part is currently beyond me!

I was planning on writing a small FileMaker Database with a simple button which fires an Appescript to run the Terminal commands on OSX (if this is possible)!!!
Then I run the FileMaker DB on an old iOS device and stick it to the front door!!!

Does that sound like a plan?

Can you or anyone help??

Best regards, Tim

DPH

unread,
Jul 9, 2017, 4:56:58 PM7/9/17
to SoCo - Sonos Controller
Hi Tim, have replied to you directly.
Will post here to help others looking for a similar answer. 

To play a doorbell sound  or make an announcement SoCo has a snapshot function that captures the current state of a player, allows you to play something else, and then restore the previous captured sate. 
There are two examples in the SoCo GitHub repository https://github.com/SoCo/SoCo/tree/master/examples/snapshot

Regards Daivd

Jim Bretschneider

unread,
Mar 11, 2018, 9:19:08 PM3/11/18
to SoCo - Sonos Controller
I am using it for a couple of things:

1) One of my zones is a home theater so I have a script that checks if the particular zone is turn on and automatically turns on the receiver and changes to the the right source
2) I Have Flic buttons around the house to turn on/off music and go to next track https://flic.io/
3) Controlling Sonos from a Bang & Olufsen Remote control 

Grzegorz Wierzowiecki

unread,
May 2, 2018, 8:40:56 AM5/2/18
to SoCo - Sonos Controller
TL;DR- run http server in my music collection, use python-soco script to add desired albums to Sonos playlist by URI !

Story and motivation:
I didn't want to setup Samba just for Sonos.

Not all my music is on Spotify or Google Play Music.
More importantly, I have ripped my origianal CDs to FLAC,
so keeping it on a phone and playing from phone is far from convenient.

Solution:
So I was happy, when I found out that SoCo (python-soco and socos) can help me solve my problems!

I run on device hosting all my FLAC files simple `python3 -m http.server 1234` server, to share music in local network,
then I can easily add by URI desired albums:

import soco
s=soco.SoCo('1.2.3.4')
s.clear_queue()
with open('playlist.m3u', 'r') as f:
  for l in f:
s.play _from_queue(0)

I have access to this directory from another computer, so to m3u files and flac files itself, plus I know under which prefix they are serverd on machine serving as http server. Therefore I can easily add files from one machine that are hosted by another machine! Later navigate from phones to play/pause/next/previous.

Twitter thread:
https://twitter.com/GWierzowiecki/status/991453357234585601

Github Gist:
Reply all
Reply to author
Forward
0 new messages