We have moved at community.getvera.com

Author Topic: Getting Sonos working again  (Read 3013 times)

Offline melsman

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +2/-0
Getting Sonos working again
« on: January 25, 2018, 01:47:07 pm »
Unfortunately, this app no longer works without tweaking - and even then it doesn't work like it used to.  And apparently the app developer is no longer supporting it. So I'd like to use this thread to gather the steps necessary to get the app working properly again. Please add any suggestions you might have to help others get their Sonos devices working in UI7

I'll start...

When I downloaded the app into UI7 for the first time (firmware 1.7.3500), the app did nothing.  No discovery - nada.  So, after doing research here and figuring a few things out on my own, here are the steps I came up with to at least get the buttons to respond. Starting from the beginning:

1. Install the UPnP app
2. Install the Sonos app
3. Down the attached zip files and unzip the two files within. Then, upload these two files to your Vera via the Upload box in the Apps>Develop Apps>Luup files tab.  The discussion about why this is necessary is found here ->http://forum.micasaverde.com/index.php/topic,51432.0.html. Big thanks to amg0 for sharing his edited files!
4. Using your phone or PC Sonos app (or going into your router) find the Sonos' IP address.
5. Open the UI7 Sonos device and go to the Advanced menu. Enter the Sonos IP under the Advanced> Params> IP field.
6. I also entered the router IP in the Advanced>Variables>RouterIP field, but I'm not certain that was necessary.
7. Reboot Vera using the Settings>Net&WiFi - Reboot button
8. When Vera restarts, the Sonos device should be present and should work; at least for music playback. There are still many aspects of the device that don't work correctly, such as album art, currently playing, etc. But the buttons work...

One note - The mute button works, but there is no means to "un-mute".  At least none that I could find.

As for TTL and the voice functions, I've not found a way to get that to work.  If anyone has, please post the steps here.

Melsman

Offline dwighthenry61

  • Sr. Newbie
  • *
  • Posts: 23
  • Karma: +0/-0
Re: Getting Sonos working again
« Reply #1 on: February 02, 2018, 07:35:30 pm »
Had the same issue with TTS and contacted Vera, reply below

Hi
Thank you for contacting Vera Customer Care
We would like to let you know that we are aware of this issue and it is because a security concern that was added to latest version of the firmware, we already report this to our development team and they are working on it but we do not have an ETA for it.
We are awaiting that the plug-ins writers change some files on the API that work with the plug in on the port which it was blocked.
We suggest you to post this on our forum in order to see if there is a work around for it, but we are recommending to downgrade to 7.21 version of the firmware until we get the full fix for it.
Thank you for understanding
Regards
Regards,

Offline kellerman

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
Re: Getting Sonos working again
« Reply #2 on: April 18, 2018, 04:20:51 pm »
Regarding the TTS I have a (partly) working solution. I found someone that have implemented a TTS service using ResponsiveVoice (https://responsivevoice.com)

I had it working pushing the voice to all my Sonos speakers at some point...but now I only get it to work with my main Sonos device (that was added by default when adding the Sonos app). I'm still investigating what went wrong but haven't found the solution yet.
I'm also having issues with the group settings and the player status...but I can start/stop the music with the buttons.

So upload the files via the "Develop Apps/Luup files" and then go to your Sonos device and select TTS. I've set the default engine in the js-file to ResponsiveVoice and the language to Swedish. But you could of course switch to another language that better suits your needs. Enter some text in the box and hit "Say"...and you will hopefully hear the phrase in your Sonos speaker.

Hope it works for you!

Offline azvarga

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: Getting Sonos working again
« Reply #3 on: August 05, 2018, 12:56:56 am »
melsman : your posting on the two files that needed to be uploaded and the instructions were the ticket.  Not everything works (but basic functions do) and if Vera is working on native integration, this will do it for now.  Awesome.  Thanks.

Offline Spanners

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: +16/-5
Re: Getting Sonos working again
« Reply #4 on: September 04, 2018, 06:53:36 am »
My version attached. Incorporates some updates from amg0 and reneboer.

Buttons work, discovery works, album art/status info updates and responsive voice TTS works. (At least for me, your mileage may vary)

After updating the files and restarting luup, make sure to refresh your browser (may need to clear cache) so the Javascript gets reloaded.

« Last Edit: September 04, 2018, 06:56:58 am by Spanners »

Offline lakewoodjazz

  • Jr. Member
  • **
  • Posts: 53
  • Karma: +1/-0
Re: Getting Sonos working again
« Reply #5 on: September 04, 2018, 08:46:38 pm »
Great news Spanners.
I am not home to install your version yet but when I get back to Delaware I am looking forward to having Sonos work again completely. Does your version bring back the regrouping buttons?
Will report back.

Thanks!

Offline Spanners

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: +16/-5
Re: Getting Sonos working again
« Reply #6 on: September 04, 2018, 09:31:44 pm »
Grouping buttons work ok for me.

Good luck. :)

Offline Cheddah

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Getting Sonos working again
« Reply #7 on: September 08, 2018, 06:44:59 pm »
I gave it a shot - the Sonos is back to working, but TTS isn't.  If I have music playing on the Sonos, it will stop playing and go quiet for an amount of time that would equal what the TTS should say, and then resume playing music. 

I can't see anything obvious in the logs, so I'm not sure why the generated mp3 file isn't playing on the Sonos.  Any ideas?

Offline Kryckmeister

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +1/-1
Re: Getting Sonos working again
« Reply #8 on: December 16, 2018, 06:13:17 am »
Nice.
First syllable/word disappears due to some fade in though. You also have that?

Offline kyle.dawson

  • Full Member
  • ***
  • Posts: 153
  • Karma: +1/-1
Re: Getting Sonos working again
« Reply #9 on: December 16, 2018, 11:07:42 am »
I ended up uninstalling the original Sonos plugin after it stopped working.  I since move to the new ALTSonos plugin via ALTUI.  Its still in beta but for me it works great.  It supports TTS, Grouping, and via the UI you can see all the art for songs and control music via controls.  If you have not moved to ALTUI, this might be a great time to move.  Its really great.

VeraPlus(1), Sonos(3), GE Switch(30), GE Dimmer(5), GE Zwave Outlet(3), MimoLight Garage Door(1),Neo Motion(6), Door Sensors(3) Camera(9), Honeywell Thermostat(2), Google Home(4), Alexa(4), Google Chrome Cast(5)  - Driven via ALTUI

Offline mapa

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: Getting Sonos working again
« Reply #10 on: December 26, 2018, 05:26:45 am »
Thank you. the files sonos 1.4.2 is working for me!!!!

Offline Vera Plus user

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
Re: Getting Sonos working again
« Reply #11 on: January 08, 2019, 09:10:51 am »
My version attached. Incorporates some updates from amg0 and reneboer.

Buttons work, discovery works, album art/status info updates and responsive voice TTS works. (At least for me, your mileage may vary)

After updating the files and restarting luup, make sure to refresh your browser (may need to clear cache) so the Javascript gets reloaded.



I have used the variable "TransportState" in my LUA code and even "SonosOnline". SonosOnline works but TransportState didn?t change status when pushing PLAY, PAUSE and STOP, but if I reload the LUA code the status has changed in the variable.

Is there any possibilities to take a look at that.

Offline Spanners

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: +16/-5
Re: Getting Sonos working again
« Reply #12 on: January 15, 2019, 02:30:16 am »
Hi All,

If you can give me some detailed steps* on how to reproduce the issues you are still seeing, I'm happy to see if I can duplicate them and maybe resolve them.

At least if they can't be duplicated you know the problem may be somewhere else - I can't make guarantees about fixing anything as I didn't write the original code and for TTS I'm using the sonos-http-api docker container rather than the Vera plugin, so I can use Amazon Polly for the voice.





*really really detailed step by step with code snippets/scene examples if part of the scenario
« Last Edit: January 15, 2019, 02:32:43 am by Spanners »

Offline Vera Plus user

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
Re: Getting Sonos working again
« Reply #13 on: January 15, 2019, 06:24:59 am »
Hi,

I will try to explain.

I use some Variables in the Sonos app, see Attachment Variables.

The parameter SonosOnline change between 1 and 0 (1 when it is online and that one works alwright and will be updated automatic)

I also use the parameter TransportState and use it to check the state "STOPPED", "PAUSED_PLAYBACK" and "PLAYED" see attachment. TransportState dosen?t update automatic but by a coincidence I saw it had changed after I reload the LUA code so there must be something with updating the Varables.

I also use this LUA code    luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "PlayURI",
                 {URIToPlay="TR:17553", Volume=30},
                 sonos_kok_device)
and start playing a radiostation depending who comes home first and that dosen?t work either anymore.






Offline Spanners

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: +16/-5
Re: Getting Sonos working again
« Reply #14 on: January 15, 2019, 06:56:01 am »
Ok, I tried to reproduce your issue with the variable update - it works fine for me.

Change state of sonos (eg from iPhone App) and the TransportState variable updates. There is one important difference in my setup that might explain it.

ProxyUsed: proxy is not in use

I don't have the discovery patch installed and the UPnP Event Proxy is not installed.
« Last Edit: January 15, 2019, 07:05:36 am by Spanners »