These instructions are for users who want access to the Azure TTS engine support in the upcoming Sonos plugin 2.0 release. Version 2.0 is currently a work in progress, so be aware that you are installing pre-release software that has been through considerable revision with minimal testing.
READ THESE INSTRUCTIONS THROUGH FIRST, THEN FOLLOW THEM TO THE LETTER. If you don’t run this procedure correctly, you risk destroying your existing Sonos devices, and if that happens, they will be recreated, but with new device numbers–your existing scenes, Lua, Reactor, PLEG, etc. will need to be updated. If you do this procedure correctly, it will preserve the existing devices and their numbering, no additional work required.
DO NOT INSTALL THIS VERSION FOR ANY REASON OTHER THAN ACCESS TO AZURE TTS AT THIS TIME
DO NOT INSTALL THIS VERSION IF YOU DO NOT WANT PRE-RELEASE LEVEL SOFTWARE ON YOUR VERA SYSTEM
- Run the following Lua in Apps > Develop apps > Test Luup code. This code will disconnect your existing Sonos devices from the installed plugin. The devices will not be deleted, and they will still operate normally. By decoupling them from the plugin here, when you later delete the plugin (step 2), the devices will not be automatically deleted with it–we’re preserving your existing devices (and thus preserving their device numbers).
for n,d in pairs( luup.devices ) do if d.device_type == "urn:schemas-micasaverde-com:device:Sonos:1" then luup.attr_set( "plugin", "", n ) end end luup.reload()
- When Luup finishes reloading, go to Apps > My apps and uninstall the existing Sonos plugin (if it’s not listed there, no problem, just move on).
- Reload luup. I usually just to go Apps > Develop apps > Test Luup code and run
- Open the Github develop branch repository: https://github.com/toggledbits/Sonos-Vera/tree/develop
- Click the green “Clone or download” button and choose “Download ZIP”
- Save the ZIP file.
- Unzip the ZIP file
- In the Vera UI, go to Apps > Develop apps > Luup files
- Multi-select the files (not folders–ignore any folders) you unzipped and drag them as a group to the “Upload” button. Also skip the
- When the upload completes, Luup will reload.
- If you are upgrading from a prior spin of 2.0, skip now to step 14. If and only if you are installing 2.0 for the first time, then when the reload completes, create the Sonos System master device:
a. Go to Apps > Develop apps > Create device
b. In the “Description” field, enter
c. In the “UPnP Device Filename” field, enter
d. In the “UPnP Implementation Filename” field, enter
e. You may choose a room assignment if you wish.
f. Click “Create device”
- Go to Apps > Develop apps > Test luup code and reload luup by running
- Wait about five minutes. Your Vera may reload several times during this time.
- Hard refresh your browser. Do not skip this step. You should now see your Sonos devices, and the Sonos System master device should report the number of zone players it is managing.
If anything appears out of whack and it doesn’t resolve in 5-10 minutes, repeat steps 12-14. Sometimes it takes a couple of reloads and hard refreshes to get everything sorted.
The new Sonos System master device will adopt your previous/existing Sonos devices as its children (with the same device number they’ve always had), and create new child devices for any other zone players discovered on the network. There is usually no need to run discovery manually in this version.
Install check: The “Settings” tab of the Sonos master device should show 20080.1005 (or higher)
Configuration of TTS is done on the Sonos System master device. You will need to register for an Azure account and set up a subscription and cognitive services. Create a subscription here: https://azure.microsoft.com/free/
TO CREATE THE COGNITIVE SERVICES RESOURCE (AFTER CREATING A SUBSCRIPTION):
- Go to: https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesAllInOne
- Enter a name for the resource. “Vera Sonos TTS” for example.
- Select the subscription (you’ll probably only have one to choose from)
- Location: choose the one that appears geographically nearest to you.
- Pricing tier, choose “S0” or whatever is available/cheapest.
- Resource group: choose an existing or create a new one. Doesn’t much matter what it is if this is all you’ll be using Azure for.
- Check the “OK/agree” box and then click “Create”.
- Wait for resource to be created. When it’s finished, click “Go to resource”.
- Enter the key shown into the Azure TTS config on the Sonos plugin.
- Look at the endpoint URL; it should be
<region>.api.cognitive.microsoft.com… choose the region in the Azure TTS config for the Sonos plugin that matches the region shown.