Release - Sonos Addon

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
mcd55 Offline
Junior Member
Posts: 2
Joined: Nov 2014
Reputation: 0
Post: #151
Hi,
I am a novice with a new XMBC box and planning a Sonos install. My music lies on a NAS, with a playlist set up and runnung; however how do I connect to the Sonos?
I thought an output bridge would suffice, but I was told I need a new zone in the theater room. Presently my theater system is self contained with media box, amp and speakers, the sonos will go to other parts of the house. I just want to tap into / stream the other parts through the NAS / media box. Any thoughts?
Also - I woyuld greatly appreciate the link to the most recent applicaton.
Best regards
Michael
find quote
rob_webset Offline
Posting Freak
Posts: 814
Joined: Sep 2013
Reputation: 21
Post: #152
(2014-11-17 06:11)mcd55 Wrote:  Hi,
I am a novice with a new XMBC box and planning a Sonos install. My music lies on a NAS, with a playlist set up and runnung; however how do I connect to the Sonos?
I thought an output bridge would suffice, but I was told I need a new zone in the theater room. Presently my theater system is self contained with media box, amp and speakers, the sonos will go to other parts of the house. I just want to tap into / stream the other parts through the NAS / media box. Any thoughts?
Also - I woyuld greatly appreciate the link to the most recent applicaton.
Best regards
Michael

Hi Michael,

The Sonos addon is installed like any other addon in XBMC, it is in the official repository, so no need to add any custom repositories.

The Sonos addon will work as a controller for your existing Sonos Zones (or just single Speaker) - use the settings screen for the addon to select your Zone/Speaker.

For more info of specific features, please take a look at the wiki:

http://kodi.wiki/view/Add-on:Sonos

Rob

Addons: VideoExtras, TvTunes, Sonos & ***NEW *** VideoScreensaver ***NEW ***
find quote
mcd55 Offline
Junior Member
Posts: 2
Joined: Nov 2014
Reputation: 0
Post: #153
HI,
Thanks for the reply.
My concern is in the Wiki article, it states only control for one zone - can the add-on handle multiple zones, and if so, could you send a link to the add-on?
Regards,
Mihcael
find quote
rob_webset Offline
Posting Freak
Posts: 814
Joined: Sep 2013
Reputation: 21
Post: #154
(2014-11-18 05:50)mcd55 Wrote:  HI,
Thanks for the reply.
My concern is in the Wiki article, it states only control for one zone - can the add-on handle multiple zones, and if so, could you send a link to the add-on?
Regards,
Mihcael

Yes, only one zone at a time, so if you want to change zone, you need to go into settings and select a different zone.

The addon is in the official Repo, so you can install it directly from XBMC

Rob

Addons: VideoExtras, TvTunes, Sonos & ***NEW *** VideoScreensaver ***NEW ***
find quote
olarf Offline
Junior Member
Posts: 24
Joined: Jan 2014
Reputation: 0
Post: #155
(2014-11-17 06:11)mcd55 Wrote:  Hi,
I am a novice with a new XMBC box and planning a Sonos install. My music lies on a NAS, with a playlist set up and runnung; however how do I connect to the Sonos?
I thought an output bridge would suffice, but I was told I need a new zone in the theater room. Presently my theater system is self contained with media box, amp and speakers, the sonos will go to other parts of the house. I just want to tap into / stream the other parts through the NAS / media box. Any thoughts?
Also - I woyuld greatly appreciate the link to the most recent applicaton.
Best regards
Michael

As Rob already state, his plugin is a player and beside this it provide additional information to the music you actually run on your sonos system. To add your music livery on your NAS to Sonos, sonospy seems to be the best solution so far.

XBMC Gotham Beta 1
IntelĀ® DZ87KLT-75K with I5 4670 Haswell CPU
DD Cine S2 6.5
Silverstone SST-LC16B-M
Music Pump XBMC Remot on S2
find quote
janbar Offline
Fan
Posts: 437
Joined: Sep 2012
Reputation: 26
Location: France
Post: #156
Hi Rob,

I have this error trying Radio stations:

23:41:35 T:2437139264 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.UnicodeEncodeError'>
Error Contents: 'ascii' codec can't encode character u'\xe7' in position 18: ordinal not in range(128)
Traceback (most recent call last):
File "/home/mythtv/.kodi/addons/script.sonos/plugin.py", line 755, in <module>
menuNav.populateRadioStations()
File "/home/mythtv/.kodi/addons/script.sonos/plugin.py", line 347, in populateRadioStations
url = self._build_url({'mode': 'action', 'action': ActionManager.ACTION_RADIO_PLAY, 'itemId': item['uri'], 'title': item['title']})
File "/home/mythtv/.kodi/addons/script.sonos/plugin.py", line 82, in _build_url
return self.base_url + '?' + urllib.urlencode(query)
File "/usr/lib/python2.7/urllib.py", line 1332, in urlencode
v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe7' in position 18: ordinal not in range(128)

I made crapy fix at line 346 from plugin.py:

# Add the radio station to the list
query = {'mode': 'action', 'action': ActionManager.ACTION_RADIO_PLAY, 'itemId': item['uri'], 'title': item['title']}
for k, v in query.iteritems():
query[k] = unicode(v).encode('utf-8')
url = self._build_url(query)

Could help
find quote
rob_webset Offline
Posting Freak
Posts: 814
Joined: Sep 2013
Reputation: 21
Post: #157
(2014-11-28 01:49)janbar Wrote:  Hi Rob,

I have this error trying Radio stations:

23:41:35 T:2437139264 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.UnicodeEncodeError'>
Error Contents: 'ascii' codec can't encode character u'\xe7' in position 18: ordinal not in range(128)
Traceback (most recent call last):
File "/home/mythtv/.kodi/addons/script.sonos/plugin.py", line 755, in <module>
menuNav.populateRadioStations()
File "/home/mythtv/.kodi/addons/script.sonos/plugin.py", line 347, in populateRadioStations
url = self._build_url({'mode': 'action', 'action': ActionManager.ACTION_RADIO_PLAY, 'itemId': item['uri'], 'title': item['title']})
File "/home/mythtv/.kodi/addons/script.sonos/plugin.py", line 82, in _build_url
return self.base_url + '?' + urllib.urlencode(query)
File "/usr/lib/python2.7/urllib.py", line 1332, in urlencode
v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe7' in position 18: ordinal not in range(128)

I made crapy fix at line 346 from plugin.py:

# Add the radio station to the list
query = {'mode': 'action', 'action': ActionManager.ACTION_RADIO_PLAY, 'itemId': item['uri'], 'title': item['title']}
for k, v in query.iteritems():
query[k] = unicode(v).encode('utf-8')
url = self._build_url(query)

Could help

Hi Janbar,

Thank you for reporting the problem (and the fix!) - I have made a similar change - but hopefully (if I've got it right) in a bit more of a global manner. Please would you be able to give the following patch a go and see if it resolves the issue:

https://code.google.com/p/robwebset/source/detail?r=554

Thanks

Rob

Addons: VideoExtras, TvTunes, Sonos & ***NEW *** VideoScreensaver ***NEW ***
find quote
malcolmbarr Offline
Member
Posts: 64
Joined: Dec 2012
Reputation: 0
Post: #158
Would love to try this add on but I can't install it.

I have tried with both a Gotham and a Kodi installation on Windows (and one on Android), but having found it in the XBMC repo it will not download and install. I don't know if there is a problem with the XBMC.org repo in general or just with this plug in.

Is there anywhere to download the plug-in as a zip file?
find quote
rob_webset Offline
Posting Freak
Posts: 814
Joined: Sep 2013
Reputation: 21
Post: #159
(2014-12-08 22:51)malcolmbarr Wrote:  Would love to try this add on but I can't install it.

I have tried with both a Gotham and a Kodi installation on Windows (and one on Android), but having found it in the XBMC repo it will not download and install. I don't know if there is a problem with the XBMC.org repo in general or just with this plug in.

Is there anywhere to download the plug-in as a zip file?

I guess you can download it directly from:

http://mirrors.xbmc.org/addons/frodo/scr...-1.2.1.zip

Have fun!

Rob

Addons: VideoExtras, TvTunes, Sonos & ***NEW *** VideoScreensaver ***NEW ***
find quote
malcolmbarr Offline
Member
Posts: 64
Joined: Dec 2012
Reputation: 0
Post: #160
Rob - thanks a lot - installing now.
find quote
malcolmbarr Offline
Member
Posts: 64
Joined: Dec 2012
Reputation: 0
Post: #161
Rob - well done and thank you for with this, it works really well.

Can I make a couple of completely self-centred suggestions (some of which I am sure are ideas you have had yourself).

1. It is a bit cumbersome having to go into the settings for the add-on if you want to change speaker/player each time. Is there any chance you could set up multiple players/speakers in the add-on settings, and then be able to switch between them in the controller?

2. Would it be possible to implement the imported playlists function from the Sonos library. I use that a lot (I create my playlists outside of Sonos and then bring them in).

3. Would it be possible to implement a full screen version of the controller which gets rid off the blue background you have used and looks a bit like the full screen "now playing" view on the Sonos app for Ipad/Android? That uses a de-focussed view of the cover art as the background, and then the cover art taking up most of the real estate in the centre. Would be great to have that with the next song details, song position bar, and playback controls.

Thanks again for a great piece of work.
find quote
rob_webset Offline
Posting Freak
Posts: 814
Joined: Sep 2013
Reputation: 21
Post: #162
(2014-12-09 00:09)malcolmbarr Wrote:  Rob - well done and thank you for with this, it works really well.

Can I make a couple of completely self-centred suggestions (some of which I am sure are ideas you have had yourself).

Thanks for the compliment - I believe most requests are self-centered - they have to be, otherwise people never get what they want! Big Grin

(2014-12-09 00:09)malcolmbarr Wrote:  1. It is a bit cumbersome having to go into the settings for the add-on if you want to change speaker/player each time. Is there any chance you could set up multiple players/speakers in the add-on settings, and then be able to switch between them in the controller?

I did think of this for an option, but haven't done this for 2 reasons:
a) I thought that you would only really ever connect to the Sonos Group in the same room as the TV/XBMC is in
b) How to show it and allow it to be configured in the settings?

If you have any thoughts on how this could be accomodated into the settings screens, then it may be an option.

(2014-12-09 00:09)malcolmbarr Wrote:  2. Would it be possible to implement the imported playlists function from the Sonos library. I use that a lot (I create my playlists outside of Sonos and then bring them in).

Not something I really thought about - wouldn't playlists on the XBMC box be specific to the files on the XBMC machine? (Not on the server where SOnos is reading data from) My assumption was that most operations would be performed on the Sonos official apps (iPhone/iPad/Android) and then only "Tweaked" on XBMC. I guess if you could let me have a step by step guide of what you would do (From creating the playlist to importing it/playing the tracks) then it may be something I can look at.

The thing to note, is that mapped network drives on XBMC will not be the same as Sonos I believe.

(2014-12-09 00:09)malcolmbarr Wrote:  3. Would it be possible to implement a full screen version of the controller which gets rid off the blue background you have used and looks a bit like the full screen "now playing" view on the Sonos app for Ipad/Android? That uses a de-focussed view of the cover art as the background, and then the cover art taking up most of the real estate in the centre. Would be great to have that with the next song details, song position bar, and playback controls.

Not completely sure I follow every fine detail, I'm not sure we could make the album art too big as it is from the embedded image inside the flac/mps file - so will most likely be small and of a low resolution. I tried to give several options via the settings, most using the Artist Slideshow. If you can scribble a diagram of what you are looking for, then I might be able to put something together.

Thanks

Rob

Addons: VideoExtras, TvTunes, Sonos & ***NEW *** VideoScreensaver ***NEW ***
find quote
malcolmbarr Offline
Member
Posts: 64
Joined: Dec 2012
Reputation: 0
Post: #163
Rob - thanks for taking the time to reply and taking my suggestions seriously.

On the first idea, (multiple zones) maybe the way to set up multiple players would be to have a number of "slots" where the IP address and name for each player/zone would be entered in the settings menu. Effectively you can think of the settings page now as only having one "slot", and you could add others. Then when you launch the sonos controller, it would have a field (box) with the zone name which if you selected and pressed okay, would allow you to chnage to one of the other zones.
BTW I don't think this is at all important, just a nice to have. I think you are right that by and large you are going to be using XBMC in the same room as the player you are controlling.

On the second (imported playlists), I create my playlists using Winamp as M3U files. The directory containing these playlists is then scanned by Sonos as part of my music library and the playlists then appear under "imported playlists" in the Sonos library (and they play fine). In the Ipad/android/Windows Sonos apps this appears just as another node in the library after "tracks". Sonos already knows all about these playlists having imported them into the library - they don't come from XBMC.

On the third idea, I am thinking about something that is close to the "now playing" screen you see if you tap on the cover art when a track is playing using the IOS or Android Sonons apps. That shows a blurred version of the cover art as a background, then the cover art in the middle of the screen occupying maybe a third of the total screen area, and then playback controls underneath. If that isn't clear, let me know and I will try and send you a screenshot from the android app.

Thanks again for thinking about this.
(This post was last modified: 2014-12-09 23:22 by malcolmbarr.)
find quote
rob_webset Offline
Posting Freak
Posts: 814
Joined: Sep 2013
Reputation: 21
Post: #164
Hi malcolmbarr,

I have done the code changes to be able to support imported playlist (I have never used them before - so hadn't really spotted they were even there!). It is nested under the Music Library (Like the official app).

I have requested another publish to the official XBMC Repo - so your addon should update automatically when it works its way onto the official servers. (I had to change a bit too much to just do a patch).

When I next get a minute I will look at the multi-zone functionality (But will need to ensure it doesn't make the setup more complicated than it already is!).

I can see what you mean about the different player display now - I'm not very good at the skinning stuff, but will take a look to see if something like this is possible if I get the time.

Note: I have seen an error with the latest Sonos firmware when the addon tries to update the "Currently Playing" details in the controller - Hopefully it's something that can be solved fairly soon. (You just can't predict the impact official firmware changes will have!)


Thanks

Rob

Addons: VideoExtras, TvTunes, Sonos & ***NEW *** VideoScreensaver ***NEW ***
find quote
tipperjones Offline
Junior Member
Posts: 3
Joined: Dec 2014
Reputation: 0
Post: #165
Hi Rob

Sorry for the daft question but is the SONOS addon the only way of interacting with a set of SONOS speakers?

If I wanted to use the PAPlayer, I assume that SONOS cannot be used either via Wi-Fi or Ethernet as just a set of speakers?

Thanks

Richard
(This post was last modified: 2014-12-19 12:57 by tipperjones.)
find quote
Post Reply