Sonos stops responding (showing offline) to Veralite UI7 with Sonos Plugin

I currently have a Veralite running the latest UI7 release and lately randomly my sonos Play 5 will stop responding to Veralite. When this happens, none of my TTS announcements such as Driveway Alert, Garage Door Alert, Entry Alerts do anything. I previously had setup my Sonos Play 5 in my kitchen manually before a Plugin existed. When I upgrade to UI7 I chose to use the plugin method and all has been fine except for this problem. My Sonos is still online and accessible because I can ping it and also use my Sonos app on my phone to play songs on it right now. If I go to the Veralite UI7 devices tab right now my Sonos Kitchen shows Offline as the status. Normally it will show the last song that was played on it. The only way I could get it working again was to go to the Sonos device and then settings and discover it again. But even now it is acting strange as I can play a song through it but the TTS has stopped working. It is frustrating when this happens because all my alerts stop announcing.

Has anyone else had this happen, or have any ideas? It was working so well before. :frowning:

Make sure you have assigned the Sonos a reserved IP address in your home router so it isn’t changing IP addresses, mine was doing the caused the same problem.

Also installing the UPnP plugin might help if you can’t give the Sonos a reserved address, but I have found the reserved IP address solved my problems.

[quote=“shallowearth, post:2, topic:187693”]Make sure you have assigned the Sonos a reserved IP address in your home router so it isn’t changing IP addresses, mine was doing the caused the same problem.

Also installing the UPnP plugin might help if you can’t give the Sonos a reserved address, but I have found the reserved IP address solved my problems.[/quote]

Thanks for the reply, however I do have this Sonos Play 5 and my other 3 sonos players with reserved IP address through my router. Also before I installed the plugin I had never had this issue before. So it is strange.

Yes I had tons of problems with the Sonos plugin and UI7. I have a very similar setup, using both TTS notifications, and also controlling music from an enerwave 7 button wall switch. After banging my head against the wall countless times… Here is what I did, and so far, it’s working perfect (about 3 weeks). I’ll give you my code, then my settings, and then my (somewhat cynical) reasoning.

First the code:
–Make sure the Sonos device State is “ON”
luup.call_action(“urn:micasaverde-com:serviceId:Sonos1”, “SetCheckStateRate”, {rate=“30”}, 4)
–Now add a very short delay of 150ms to make sure the call has made it over your network to the Sonos device
luup.sleep(150)
–Now run your Sonos command. It can be TTS or play music, or adjust volume, etc… Here is an example to play a favorite Pandora station
luup.call_action(“urn:micasaverde-com:serviceId:Sonos1”, “PlayURI”, {URIToPlay=“SF:Contemporary Jazz Radio”}, 4)
–Now that it is working, turn the AutoCheckStatus function back OFF
luup.call_action(“urn:micasaverde-com:serviceId:Sonos1”, “SetCheckStateRate”, {rate=“0”}, 4)

Now the settings

  1. Remove UPnP Event Proxy: remove the plugin completely from your system. It is not helping one bit
  2. in my example, I am using a sonos playbar listed as device 4, set everything to off on this device:
  • No discovery patch, uninstall it if you have it
  • use a reserved IP address (assigned by your router to the Sonos device) and put that in under new IP
  • Set State auto check to OFF, Frequency will default to 0 Minutes
  • Set Debug logs to OFF
  • Set Read queue to OFF
    That’s it, now your ready to Rock!

Finally my (somewhat cynical) reasoning:
Vera processing power seems whimpy to me. It does not seem to have the umph to continuously check the status of devices on your Ethernet. So instead I turn everything off, and then only check status, right before I execute a command. Doing this has been night and day on my system. Even other stuff, like motion sensors triggering lights seem to work better when sonos is OFF. You do have to check the status, because if it has gone offline (say overnight) it will not run the play command. Also the 150mS sleep is a terrible method to use… But in my testing, I found that occasionally the ethernet needs a few milliSeconds to get the status check, and thus the only way I could find to solve that was to insert a 150mS sleep. If you don’t use the luup.sleep(150) code, it still works about 99% of the time. But for me the luup.sleep(150) seems to give it 100% functionality, and I haven’t experienced any other issues.

I’m curious to see your thoughts. Anyone have better suggestions?

Thanks WillPower11 for that suggestion. Mine had been working for over 2 months all the sudden since I last commented here so I figured it had just fixed itself, but then a few days ago all of my TTS scenes stopped making announcements again. The strange thing is right now none of the TTS is working but if I go to the Vera UI7 Settings it shows State as ON. If I go to the Sonos app on my iphone and try and play a song on this Sonos it will play just fine and even under Player and Control under Vera it does report that the song is playing. So it is very strange. Vera knows the Sonos is there and can seem to report some of the information like when a song is playing but TTS doesn’t work. If I go to the TTS tab right now and type something into the text box for it to say and then click SAY nothing happens. Which is why my scenes that are meant to play a TTS command aren’t working. I have also tried rebooting my Veralite and also this Sonos Play 5 that I have setup and after doing that still no TTS working.

I will try your suggestions and see if that works. I will report back. Might be a few days before I can try it.

Ok so I am thinking I am actually having a different problem this time as the Sonos is not showing offline and I can start and stop songs on it just fine from the main screen. It just seems that TTS has stopped working completely. I should be able to go to the TTS tab of my Sonos on UI7 and then in the text box type something to say and then click SAY button and it will say it. That is not happening no matter what I do. I haven’t changed any of the TTS settings but it just stopped working. Does anyone have any ideas here? Ready to pull my hair out! :frowning:

Google changed the API few days ago. I provided a fix. Go to the section relative to the Sonos plugin for more information.

Ah! That would explain it! Ok I will go there and check that out. Thanks so much for the quick response, and for the great work on this… Much appreciated…