TTS not working for pair of Play:1s

Hi, first I’d like to say thanks for the incredible work of this community. I’m a newbie at home automation but it’s a lot of fun to integrate the Nest thermostat and Sonos. I’ve already gotten the sound to play through VLC on the PC.

So, I can’t seem to get TTS to work for Sonos. I have a pair of Play:1s.

From the device widget, I tried the “Player” tab, then entering some strings in the “Text To Speech” box. When I check the veralite’s /www directory, I don’t see a say.x.mp3. BTW, is X a variable (i.e. the play:X number) or it just represents the string to say?

Then I tried it via a scene, using the following code, and no sound.

luup.call_action(“urn:micasaverde-com:serviceId:Sonos1”, “Say”,
{Text = “Hello World”}, 16)

where 16 is my sonos device id (I assume that’s what goes there).

What else should I check?

BTW, where should the Sonos_silence.mp3 file go? in /etc/cmh-ludl or in /www? There’s conflicting instructions between:

http://code.mios.com/trac/mios_sonos-wireless-music-systems/wiki

and

Thanks again!

I had some problems as well initially with the Sonos. My main issue was the ip address of the Sonos - I made it static and made sure that the ip address was reflected in the advanced tab of the device in Vera. The TTS should work in the player tab of the device - make sure to put in a volume level too for the test. I followed the wiki for the MP3 file so it’s in the directory /etc/cmh-ludl/.

The silence file has to go in one of the two directories.

In the action, specifying the volume is not required. If not, the message will be said at the current volume.

x is the device number, meaning 16 in your case.

Remember that pairing of Sonos devices is not correctly handled by the plugin. This work is in progress but really not easy to reverse-engineered without nothing to test.

TTS is working with Play:1, it was mentioned by at least one user in the forum.

I can confirm that TTS works with Play:1.

Tank you.

It would be interesting if @ww73 could confirm that the problem is only relative to the pair, I mean that it is working for him when a Play:1 is stand alone.

Here is the subject to discuss pair of Sonos units: http://forum.micasaverde.com/index.php/topic,20891.0.html

Thanks guys. I can play the music through a set of Play:1s.

The biggest mystery I think is why the say.x.mp3 file is not getting written to /www.

I even tried copying a mp3 over, naming it say.x.mp3. Whether x = [ x, 1, 3, 5], it doesn’t get played.

I also tried reinstalling a new device. So far TTS is still not working.

[quote=“ww73, post:6, topic:178803”]Thanks guys. I can play the music through a set of Play:1s.

The biggest mystery I think is why the say.x.mp3 file is not getting written to /www.

I even tried copying a mp3 over, naming it say.x.mp3. Whether x = [ x, 1, 3, 5], it doesn’t get played.

I also tried reinstalling a new device. So far TTS is still not working.[/quote]

The file is written, then played, and finally deleted. Maybe that’s why you don’t see it.

You have to check that you have not secured the local access of the Vera. I don’t know exactly what is the result in this case but several users said that TTS is not working in this case. That could make sense if this Vera setting is protecting the Vera WEB access.

Copying a MP3 file in /www and testing it is a good idea if the problem is not relative to the production of the file in /www. For a file named “toto.mp3”, you will have to test with URI “x-rincon-mp3radio:toto.mp3”.

Here’s the error in the log file. Looks like I’m getting UPnPError errorCode 714 and 1023. I’ll google to see what they are.

#1 - Trying to play /www/say.1.mp3

08 01/19/14 13:26:18.857 JobHandler_LuaUPnP::HandleActionRequest device: 20 service: urn:micasaverde-com:serviceId:Sonos1 action: e[36;1mPlayURIe[0m <0x2dbb7680>
08 01/19/14 13:26:18.858 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=20 <0x2dbb7680>
08 01/19/14 13:26:18.858 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:micasaverde-com:serviceId:Sonos1 <0x2dbb7680>
08 01/19/14 13:26:18.858 JobHandler_LuaUPnP::HandleActionRequest argument action=PlayURI <0x2dbb7680>
08 01/19/14 13:26:18.858 JobHandler_LuaUPnP::HandleActionRequest argument URIToPlay=x-rincon-mp3radio:say.1.mp3 <0x2dbb7680>
01 01/19/14 13:26:19.262 e[31;1mluup_log:20: Sonos: error UPnP_request (SetAVTransportURI, urn:schemas-upnp-org:service:AVTransport:1): status=1 statusMsg=500 result=[<s:Envelope xmlns:s=“http://schemas.xmlsoap.org/soap/envelope/” s:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”><s:Body><s:Fault>s:ClientUPnPError714</s:Fault></s:Body></s:Envelope>]e[0m <0x2dbb7680>

#2 - trying to use luup via a scene

“scenes”: {
“scenes_22”: {
“name”: “Test Sonos Say”,
“groups”: [
{
“delay”: 0,
“actions”: [

      ]
    }
  ],
  "lua": "luup.call_action(\"urn:micasaverde-com:serviceId:Sonos1\", \"Say\",
             {Text = \"Hello world from luup\"}, 20)",
  "id": 22,
  "Timestamp": 1389851893,
  "room": 0
}

},

08 01/19/14 13:41:35.491 Scene::RunScene running 22 Test Sonos Say <0x2e6d1680>
08 01/19/14 13:41:35.491 JobHandler_LuaUPnP::HandleActionRequest device: 20 service: urn:micasaverde-com:serviceId:Sonos1 action: e[36;1mSaye[0m <0x2e6d1680>
08 01/19/14 13:41:35.492 JobHandler_LuaUPnP::HandleActionRequest argument Text=Hello world from luup <0x2e6d1680>
06 01/19/14 13:41:35.990 Device_Variable::m_szValue_set device: 20 service: urn:upnp-org:serviceId:AVTransport variable: e[35;1mTransportPlaySpeede[0m was: NOT_IMPLEMENTED now: 1 #hooks: 0 upnp: 0 v:0xcc6488/NONE duplicate:0 <0x2e6d1680>
06 01/19/14 13:41:36.080 Device_Variable::m_szValue_set device: 20 service: urn:upnp-org:serviceId:AVTransport variable: e[35;1mCurrentTrackDuratione[0m was: now: NOT_IMPLEMENTED #hooks: 0 upnp: 0 v:0xc31f50/NONE duplicate:0 <0x2e6d1680>
06 01/19/14 13:41:36.081 Device_Variable::m_szValue_set device: 20 service: urn:upnp-org:serviceId:AVTransport variable: e[35;1mCurrentTrackMetaDatae[0m was: now: NOT_IMPLEMENTED #hooks: 0 upnp: 0 v:0xbf8b40/NONE duplicate:0 <0x2e6d1680>
06 01/19/14 13:41:36.140 Device_Variable::m_szValue_set device: 20 service: urn:micasaverde-com:serviceId:HaDevice1 variable: e[35;1mLastUpdatee[0m was: 1390167694 now: 1390167696 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2e6d1680>
01 01/19/14 13:41:36.165 e[31;1mluup_log:20: Sonos: error UPnP_request (SetAVTransportURI, urn:schemas-upnp-org:service:AVTransport:1): status=1 statusMsg=500 result=[<s:Envelope xmlns:s=“http://schemas.xmlsoap.org/soap/envelope/” s:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”><s:Body><s:Fault>s:ClientUPnPError1023</s:Fault></s:Body></s:Envelope>]e[0m <0x2e6d1680>

#3 - TTS from the Player tab

08 01/19/14 13:39:43.371 JobHandler_LuaUPnP::HandleActionRequest device: 20 service: urn:micasaverde-com:serviceId:Sonos1 action: e[36;1mSaye[0m <0x2e0b5680>
08 01/19/14 13:39:43.372 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=20 <0x2e0b5680>
08 01/19/14 13:39:43.372 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:micasaverde-com:serviceId:Sonos1 <0x2e0b5680>
08 01/19/14 13:39:43.372 JobHandler_LuaUPnP::HandleActionRequest argument action=Say <0x2e0b5680>
08 01/19/14 13:39:43.372 JobHandler_LuaUPnP::HandleActionRequest argument Text=test from player tab <0x2e0b5680>
08 01/19/14 13:39:43.372 JobHandler_LuaUPnP::HandleActionRequest argument Language=en <0x2e0b5680>
06 01/19/14 13:39:43.729 Device_Variable::m_szValue_set device: 20 service: urn:upnp-org:serviceId:AVTransport variable: e[35;1mTransportPlaySpeede[0m was: NOT_IMPLEMENTED now: 1 #hooks: 0 upnp: 0 v:0xcef460/NONE duplicate:0 <0x2e0b5680>
06 01/19/14 13:39:43.832 Device_Variable::m_szValue_set device: 20 service: urn:upnp-org:serviceId:AVTransport variable: e[35;1mCurrentTrackDuratione[0m was: now: NOT_IMPLEMENTED #hooks: 0 upnp: 0 v:0xc5b280/NONE duplicate:0 <0x2e0b5680>
06 01/19/14 13:39:43.833 Device_Variable::m_szValue_set device: 20 service: urn:upnp-org:serviceId:AVTransport variable: e[35;1mCurrentTrackMetaDatae[0m was: now: NOT_IMPLEMENTED #hooks: 0 upnp: 0 v:0xc33120/NONE duplicate:0 <0x2e0b5680>
06 01/19/14 13:39:43.923 Device_Variable::m_szValue_set device: 20 service: urn:micasaverde-com:serviceId:HaDevice1 variable: e[35;1mLastUpdatee[0m was: 1390166951 now: 1390167583 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2e0b5680>
01 01/19/14 13:39:43.949 e[31;1mluup_log:20: Sonos: error UPnP_request (SetAVTransportURI, urn:schemas-upnp-org:service:AVTransport:1): status=1 statusMsg=500 result=[<s:Envelope xmlns:s=“http://schemas.xmlsoap.org/soap/envelope/” s:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”><s:Body><s:Fault>s:ClientUPnPError1023</s:Fault></s:Body></s:Envelope>]e[0m <0x2e0b5680>
08 01/19/14 13:39:46.342 JobHandler_LuaUPnP::HandleActionRequest device: 20 service: urn:micasaverde-com:serviceId:Sonos1 action: e[36;1mNotifyAVTransportChangee[0m <0x2e6f8680>
08 01/19/14 13:39:46.342 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=20 <0x2e6f8680>

http://upnp.org/specs/av/UPnP-av-AVTransport-v3-Service.pdf

Error 714 is Illegal MIME-type: The specified resource has a MIME-type which is not supported by the AVTransport service.

Got it to work. So I have a pair of Play:1s, one at 10.0.1.3 and another at 10.0.1.4. In the Sonos Plugin Settings tab, I have 10.0.1.3 selected.

I found this blog

which led me to the Device Spy

While looking at the AVTransport.GetTransportInfo, I noticed that when the music was paused, the GetTransportInfo on 10.0.1.3 said playing while on 10.0.1.4 said paused.

So I wondered if 10.0.1.4 was the “master” of the pair. Once I switched the Settings tab to 10.0.1.4, TTS worked from the Player tab as well as from luup code within a scene.

This is really cool because now my house can talk to me and opens up all kinds of possibilities.

If anyone else gets tripped by this issue, hopefully this will help.

I am correcting myself: URI should be “x-rincon-mp3radio://VERA_IP:80/toto.mp3”. It certainly explains why your first test failed.