Author Topic: Can VC Announcements be Forwarded to SONOS  (Read 14502 times)

0 Members and 1 Guest are viewing this topic.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Can VC Announcements be Forwarded to SONOS
« Reply #15 on: October 07, 2014, 07:06:19 PM »
you can try using the en-gb translation language:
Code: [Select]
URIToPlay=x-rincon-mp3radio://translate.google.com/translate_tts?tl=en-gb&q=[YOUR TTS MSG GOES HERE]
instead of
Code: [Select]
URIToPlay=x-rincon-mp3radio://translate.google.com/translate_tts?tl=en&q=[YOUR TTS MSG GOES HERE]
Sounds slightly better

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Can VC Announcements be Forwarded to SONOS
« Reply #16 on: October 07, 2014, 07:08:36 PM »
Quote from nime5ter
I did all of these steps and I was able to get Sonos to play both mp3 and wav files from a folder on my PC. I got the proper path from my Sonos PC controller and used that path in the command string from VC. Good news, I'm not getting the access denied error but still no playing of the file thru Sonos.  Is there a log file I can review that might help me do a trace? Obviously inching closer to a solution but I'll experiment some more.
You can enable logging in VC but I don't think it will show you anything useful in this case.

crawfofd

  • Jr. Member
  • **
  • Posts: 29
  • Karma: 3
    • View Profile
Re: Can VC Announcements be Forwarded to SONOS
« Reply #17 on: October 07, 2014, 10:19:34 PM »
http://code.mios.com/trac/mios_sonos-wireless-music-systems

The above link will give some info on the vera side set up. I was not able to do the write up today, to busy. I will get to it tonight and should have it by tomarrow. Sorry for delay.

lemrock

  • Jr. Member
  • **
  • Posts: 21
  • Karma: 1
    • View Profile
Re: Can VC Announcements be Forwarded to SONOS
« Reply #18 on: October 08, 2014, 12:57:31 AM »
@nime5ter

Could you tell me why I'm getting this "ERROR: Invalid service/action/device". I'm using the code you gave me a few days ago and didn't ever see this before and my Vera 3 is behaving badly. Everything reads exactly the way you gave it.

lemrock

  • Jr. Member
  • **
  • Posts: 21
  • Karma: 1
    • View Profile
Re: Can VC Announcements be Forwarded to SONOS
« Reply #19 on: October 08, 2014, 01:09:43 AM »
Here is the corresponding error I get from the Vera 3 log after it receives the requests from VC.

Thanks for whatever help you can offer in my troubleshooting.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Can VC Announcements be Forwarded to SONOS
« Reply #20 on: October 08, 2014, 09:00:32 AM »
It's a mystery.  Maybe there is a problem with your Sonos plugin on your Vera.

I do notice that your wav file path does not include the drive letter.  That might be OK depending on how you have created your network share though.

The service id you are using appears to be correct, assuming that you have the Sonos plugin for Vera correctly installed and up to date.

Although Vera appears to be complaining about the service id, maybe you should double check the device id you are using, and the path to the wav.
« Last Edit: October 08, 2014, 09:20:01 AM by jitterjames »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Can VC Announcements be Forwarded to SONOS
« Reply #21 on: October 08, 2014, 09:12:25 AM »
http://code.mios.com/trac/mios_sonos-wireless-music-systems

The above link will give some info on the vera side set up. I was not able to do the write up today, to busy. I will get to it tonight and should have it by tomarrow. Sorry for delay.

The main challenge Lemrock has is getting the Vera.Raw syntax right in his VC command. Would you have time to just post the xml for one of your VC commands that is sending the TTS message?

Or did you create a scene in Vera that plays the TTS file, and then you're just calling the scene from VC?

thx
« Last Edit: October 08, 2014, 09:15:15 AM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Can VC Announcements be Forwarded to SONOS
« Reply #22 on: October 08, 2014, 09:18:23 AM »
Quote from nime5ter
I did all of these steps and I was able to get Sonos to play both mp3 and wav files from a folder on my PC. I got the proper path from my Sonos PC controller and used that path in the command string from VC. Good news, I'm not getting the access denied error but still no playing of the file thru Sonos.  Is there a log file I can review that might help me do a trace? Obviously inching closer to a solution but I'll experiment some more.

I am confused by this, and your subsequent posts.  It sounds like you succeeded in playing a wav file.  So how did you do that?

From what I can tell, you first need to figure out how to get Vera talking to Sonos.  Then the VC part is child's play.  Maybe you need to take a second look at the Vera forum for this.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Can VC Announcements be Forwarded to SONOS
« Reply #23 on: October 08, 2014, 11:27:30 AM »
@Lemrock -- I don't know if this will help or not, but I found a post on the Vera form explaining that one should use "PlayURI" to play a media file. "SetURItoPlay" apparently only loads a file, but doesn't play it.

http://forum.micasaverde.com/index.php/topic,13738.msg103378.html#msg103378

In general, maybe that thread will help. Or just post your problem to that thread so that the plugin developer can help you.

If the only thing that needs changing is "PlayURI" then it would be:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.0.3-->
<command id="140" name="Send your tts to Sonos" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="data_request?id=action&amp;DeviceNum=[YourSONOSDEVICENUMBER]&amp;serviceId=urn:micasaverde-com:serviceId:Sonos1&amp;action=PlayURI&amp;URIToPlay=x-file-cifs://[FILE PATH TO THE WAV FILE]&#xD;&#xA;&#xD;&#xA;May need to experiment or get help at Vera for file path syntax. or syntax overall.&#xD;&#xA;">
  <action>
    <cmdType>TTS.Speak2Wav</cmdType>
    <params>
      <param>This is the TTS announcement</param>
      <param>D:\tts.wav</param>
      <param>False</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Vera.Raw</cmdType>
    <params>
      <param>data_request?id=action&amp;DeviceNum=184&amp;serviceId=urn:micasaverde-com:serviceId:Sonos1&amp;action=PlayURI&amp;URIToPlay=x-file-cifs://192.168.81.191/VoxCommando/tts.wav</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Send your tts to Sonos</phrase>
</command>

However, in your error message, the bit about device: 0 and device -1 looks odd. So maybe double-check your Sonos device ID. Or if there's more than one, try the other ...

(Really, the best place to get support for these problems would be the Vera forum.)
« Last Edit: October 08, 2014, 11:34:55 AM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

crawfofd

  • Jr. Member
  • **
  • Posts: 29
  • Karma: 3
    • View Profile
Re: Can VC Announcements be Forwarded to SONOS
« Reply #24 on: October 08, 2014, 02:16:13 PM »
Okay here is the way I set up VC to talk to Vera to output to Sonos devices.

Refer to this Web site: http://code.mios.com/trac/mios_sonos-wireless-music-systems#

Pull up your Vera web site to access your Vera setup. I'm using UI5
1. Go to 'APPS' and install 'UPnP Event Proxy', No setup is required
2. Go to 'APPS' and install 'Sonos Controller' plugin. I am using version 1.1, After plugin is installed refresh browser (CTLRL-F5)
   Sonos Controller setup:
   a. Open Sonos Controller under 'My Apps'
   b. There should be a device under 'This plugin has created the following devices:'
   c. Select the device that is listed.
   d. When a popup dialog box opens select 'Settings'.
   e. Under settings select 'Discover', This will go out and retrieve the sonos devices on the network.
   f. The box to the right of the 'Discover' button will show your devices. Select the one you want to link to this controller.
   g. Press the 'Select' button next to your selection. Selected Zone: and IP: should now have the zone you selected and the IP of zone.
       Also State: should be ON.
   h. Save settings by pressing the 'X' in top right hand corner.
   
3. Go to 'AUTOMATION'
   a. Select 'New Scene'
   b. Name the Scene in top left had corner near the 'Immediate' button
   c. Select 'ADVANCED'  at the top of the page
   d. When the window opens, under 'Pick a device:' select the #?? Sonos (?? sonos device#) then select the 'Add' button to the right.
   e. Under Sonos (Please select), select 'Alert'.
       You will be given the following selections:
        URI:                     ( put path to file using =  x-file-cifs://Hostname/Directory/filename.wav )
        Volume:                ( Set volume to what ever you want )
        SameVolumeForAll   ( I did not do anything )
        Duration:               ( Duration of the wav file, start with 5 for five seconds )
        GroupDevices:        ( Put the sonos device/s to output to )
        GroupZones:          ( I did not do anything )
   f. At the top right of web page 'Confirm Changes'
   g. At the top right of web page "SAVE"

That should complete the Vera setup.  Now go to voxcommando and setup a command to call vera using TTS.Speak2Wav and Vera.Scene
 
 
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.0.3-->
<command id="1153" name="TestSonos" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>TTS.Speak2Wav</cmdType>
    <params>
      <param>This is a test of the voxcommando to sonos interface</param>
      <param>\\SAGE-MC\vera\test.wav</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Vera.Scene</cmdType>
    <params>
      <param>25</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
</command>

You will need to change the Vera.Scene to match the Scene you create in step 3a. You will also need to change the location of the wav file for the TTS.Speak2Wav.

This is the second time I've posted this. The first time it got lost when I selected post. Hopefully this time it will post. If you have any question I will be happy to help if I can. 

     

lemrock

  • Jr. Member
  • **
  • Posts: 21
  • Karma: 1
    • View Profile
Re: Can VC Announcements be Forwarded to SONOS
« Reply #25 on: October 08, 2014, 04:31:49 PM »
Really, everyone...I appreciate the help. jitterjames, nime5ter and crawfold have given much more time and effort to this than I could have hoped for.

I will read thru the last few posts and try these things out tonight.

jitterjames was confused by what I said "I did all of these steps and I was able to get Sonos to play both mp3 and wav files from a folder on my PC. I got the proper path from my Sonos PC controller and used that path in the command string from VC. Good news, I'm not getting the access denied error but still no playing of the file thru Sonos."

nime5ter had suggested that I make sure I had the correct path. So all I did was put the tts.wav file in the folder that I use for my Sonos music library on my PC.  I then used the Sonos controller installed on my PC to listen to that tts.wav file. This proved that Sonos can play a wave and it also exposed the proper path. That effort solved the access denied error I was getting but still did not allow the tts.wav file to be played initiated from VC control. 

lemrock

  • Jr. Member
  • **
  • Posts: 21
  • Karma: 1
    • View Profile
Re: Can VC Announcements be Forwarded to SONOS
« Reply #26 on: October 08, 2014, 06:18:22 PM »
Success!!

I used the procedure developed by crawfold. I had already completed step 1 and 2. I was already using the Sonos plugin developed for use with Vera to control the music traffic in my home. Step 3 which is the Scene development worked like a charm. Every step completed exactly as written without any issues.

AND...

I also changed the code that was provided by nime5ter and and used nime5ter's suggestion to change ""SetURItoPlay" (which only loads the file)to "PlayURI" in order to play a media file. That was why I thought the file wasn't making it's way to the Sonos. It was...it just wasn't being played.

So, there are two methods developed out of this effort that offer a way to send VC tts announcements to Vera/Sonos.

I'm done. Thank you, thank you.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Can VC Announcements be Forwarded to SONOS
« Reply #27 on: October 08, 2014, 06:38:15 PM »
Groovy. Many thanks to crawfofd for giving all Sonos w/ Vera users complete instructions on setting up the plugin for Vera and creating scenes for the Sonos.

In terms of the alternative method, sorry that I got the syntax wrong on my first guess. :bonk

In my defence, I did warn you it was a guess that might need to be corrected! 
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

crawfofd

  • Jr. Member
  • **
  • Posts: 29
  • Karma: 3
    • View Profile
Re: Can VC Announcements be Forwarded to SONOS
« Reply #28 on: October 08, 2014, 07:03:54 PM »
lemrock glad you worked everything out.

nime5ter tried your way and it works pretty good and not as many steps as mine, thanks for the info.


lemrock

  • Jr. Member
  • **
  • Posts: 21
  • Karma: 1
    • View Profile
Re: Can VC Announcements be Forwarded to SONOS
« Reply #29 on: October 08, 2014, 10:17:27 PM »
A Follow-up:

There is a difference in the outcome of the crawfold and nime5ter methods presented here. Using the crawfold method, if you are playing a song thru Sonos it will be muted or paused by the VC generated announcement but will resume when the announcement is over. nime5ter's method stops the song that is currently playing and that song does not continue when the announcement is over.