Getting Sonos working again

Hi Spanners
I cant find the Functions you mentioned. Restore Playback Context or
Save Playback Contest
IS TGR luup.call_action(“urn:micasaverde-com:serviceId:Sonos1”, “Say”,
{Text=“Door Open. Apartment Front Door Open”, Language=“en-CA”, GroupZones=“House Music,Garage,Basement”
Volume=60, SameVolumeForAll=“true”},
298)

I tried version 1.4.2 but it doesn’t find anything. Says scanning and nothing. Tried to enter the ip of the sonos manually - saves it and nothing - doesn’t work. What am I doing wrong? Is it supposed to work with Sonos Beam?

Ok, spent hours trying to get this working today. Make sure in Users > Security, you’ve enabled “Enable potentially unsafe Lua code” in order for the recent security changes to be overriden and allow this plugin to make wget calls.

Hi Melsman,
I’m new in Vera community. Can you please tell me how can I download the files you talk about in your post?
Thks

Unfortunately, I have no idea. This thread was ported from the old website to this site, and the file links apparently didn’t get ported with them.

Sorry I can’t be of more help.

Melsman

The old forums are still running for archive purposes.
Here is a link - http://forum.micasaverde.com/index.php
Hopefully the files are still there.

Is there any update on this at all? This response was from early 2018 and we are in late 2019 now. Is vera falling behind the times?

The Sonos plugin has a new maintainer (yours truly). Sorry, I didn’t see the earlier posts…

To get the latest version of the plugin (not yet published in the app marketplace, but soon)…

  1. Go to the plugin’s Github repository stable branch: GitHub - toggledbits/Sonos-Vera at stable
  2. Click the green “Clone or download” button on that page, above the file listing. Choose “Download ZIP” and save the archive file somewhere on your local hard disk.
  3. Unzip the downloaded archive (zip) file.
  4. Open the Luup uploader at Apps > Develop Apps > Luup files
  5. Select all of the files you unzipped (the files–not the folder; you can skip the .md files) and drag them as a group to the “Upload” button.
  6. When the upload completes, Luup will reload. While that’s happening, hard refresh your browser

It’s also a good idea to install the “UPnP Proxy” plugin. This is highly recommended, as it makes the refreshes of the UI much quicker with a lot less load on the Vera. The load is not exorbitant if you choose not to use the proxy, but the display refresh response to changes made by mobile apps will take longer.

Device discovery is on the “Settings” tab of the Sonos device.

I have the old Sonos Controller Current Version:1.4

@rigpapa - Can I use your steps in installing version 1.5 without uninstalling 1.4?

I had some scenes in 1.4 that used TTS and will I need to delete them and re-create the scenes again or will I be good to go once I install 1.5.

I attempted to install 1.5 via your instructions and did a hard reset (ctrl + F5) and TTS still does not work.

Reinstalling 1.5 is the preferred way. Before you go down that route, though, we can try a few things.

Versions before 1.5 would store default config values as hard values rather than blank/nothing, so you’ve likely got some state variables with old default values that no longer apply/don’t work (e.g. RV changed its URL). Copy-past this code into the Run Lua tool (Apps > Develop apps > Test Luup Code (Lua)):

sonosSID = "urn:micasaverde-com:serviceId:Sonos1"
for k,v in pairs(luup.devices) do
    if v.device_type == "urn:schemas-micasaverde-com:device:Sonos:1" then
        luup.variable_set(sonosSID, "DefaultLanguageTTS", "", k)
        luup.variable_set(sonosSID, "DefaultEngineTTS", "", k)
        luup.variable_set(sonosSID, "GoogleTTSServerURL", "", k)
        luup.variable_set(sonosSID, "OSXTTSServerURL", "", k)
        luup.variable_set(sonosSID, "MaryTTSServerURL", "", k)
        luup.variable_set(sonosSID, "ResponsiveVoiceTTSServerURL", "", k)
    end
end

Then reset your TTS defaults/setup on the TTS tab of the Sonos device. If it still doesn’t work, check your LuaUPnP log for errors. Find the “Say” actions using a text search for “Say” (with capital S), and then examine the log entries that follow. If it’s not clear what’s going on, post the log snippet here. Also describe which TTS engine you are using.

@rigpapa - so i decided to do a clean install of 1.5. I installed the previous version of Sonos and followed the steps you provided.

After I upload the files, not including the folders. I then wait for it to reload and do a (ctrl+F5) and I then go under My Apps and I do not see Sonos Controller.

I look under devices and I do not see Sonos devices.
Did I miss a step?

No–I did. I’ve amended the installation instructions to include creating the first device, which is an additional step required if you install from scratch.

Ok. I will try the steps again.

@rigpapa - Your new steps worked and I can see the Sonos Controller but I have 3 Sonos speakers and I do not see them in my devices.

The UPnP Event Proxy is running and I was waiting for it to discover the devices but to no luck.
Any other ideas ?

You need to create a device for each one. Just repeat the process two more times. The plugin does not automatically create additional devices on discovery.

Thank you.
I have all 3 devices working now.

1 Like

So I know each new Sonos device created will have it’s own url. My question is does each newly created Sonos device also get assigned a new device number? When I program scenes that use lua code for Say commands do I list each device number at the end of the code?
I currently have 7 Sonos Speakes.
Here is a sample lua code:
luup.call_action(“urn:micasaverde-com:serviceId:Sonos1”, “Say”,
{Text=“Door Open. Studio Door Open”, Language=“en-CA”, GroupZones=“ALL”,
Volume=55, SameVolumeForAll=“true”},
298)
As you can see I use “All” for group.
What if I only want to use 5 of the 7 speakers?Do I list each device number at end of code?
298,299,300,301,302)
Thanks
Wilbur

No, you only address one device at a time in the action. If you want to speak at a subset of units, you have to make a group for that subset.