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

0 Members and 4 Guests are viewing this topic.

lemrock

  • Jr. Member
  • **
  • Posts: 21
  • Karma: 1
    • View Profile
Can VC Announcements be Forwarded to SONOS
« on: October 03, 2014, 02:14:42 AM »
Hello again. I have been controlling my Vera 3 using my PC, iMac and various mobile devices. The announcements at home are via a constellation of SONOS and my computer speakers. Now that I have discovered VC with the Vera plugin I would love to be able to send the announcements created by VC to my SONOS networked speakers. I have done my due diligence and searched here on this forum, at Micasaverde and generally across the internet, yet nothing of interest has caught my attention. Can anyone point me in the right direction or is this a reach too far what I am considering? I'm using VC 2.103.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Can VC Announcements be Forwarded to SONOS
« Reply #1 on: October 03, 2014, 08:56:09 AM »
I am sure this is possible using either Vera or by directly controlling sonos from VoxCommando. Unfortunately it is difficult for me to figure it out without having a sonos.  Perhaps if there is enough interest a plugin could be made.

With enough micro-contributions I could get a basic sonos to play with.

I will add sonos to the plugin wish list. http://voxcommando.com/forum/index.php?topic=1620.msg14163#msg14163

What is the minimum hardware that I need?  I think you used to need a bridge in addition to something like a Play1 but I'm not sure if you still need the bridge.

Just a Sonos Play1 will set me back 250 clams.
« Last Edit: October 03, 2014, 09:06:48 AM by nime5ter »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Can VC Announcements be Forwarded to SONOS
« Reply #2 on: October 03, 2014, 09:35:00 AM »
If you're open to experimenting, it should be possible using Vera.Raw to send info from VC to your Sonos via the Sonos plugin for Vera. Another user pointed to it just yesterday on another thread here (maybe you're already using it?): http://code.mios.com/trac/mios_sonos-wireless-music-systems.

In VC, you can choose to use TTS.Speak2Wav, which saves the TTS announcement as a wav file. It seems like you should be able to send this to your Sonos speakers via Vera.

Based on the documentation provided at the above link, below is a complete guess of what the Vera.Raw string would look like.

Some trial and error will likely be involved, and perhaps seeking help over on the Vera boards.

[UPDATE: This thread involves a lot of trial and error. See later in this thread --> http://voxcommando.com/forum/index.php?topic=1778.msg15657#msg15657 onward for discussion of what actually works.]

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=SetURIToPlay&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=123&amp;serviceId=urn:micasaverde-com:serviceId:Sonos1&amp;action=SetURIToPlay&amp;URIToPlay=x-file-cifs://192.168.0.100/D/tts.wav</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Send your tts to Sonos</phrase>
</command>
« Last Edit: November 14, 2014, 01:35:47 PM 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)

lemrock

  • Jr. Member
  • **
  • Posts: 21
  • Karma: 1
    • View Profile
Re: Can VC Announcements be Forwarded to SONOS
« Reply #3 on: October 03, 2014, 11:32:01 AM »
A bridge is no longer required if you have a simple audio set up. I have two Play 1's.

lemrock

  • Jr. Member
  • **
  • Posts: 21
  • Karma: 1
    • View Profile
Re: Can VC Announcements be Forwarded to SONOS
« Reply #4 on: October 03, 2014, 11:35:37 AM »
@nime5ter, I do use the Sonos plugin. This weekend I will start with the code you provided and tinker some and see what I can come up with. I will report out my findings.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Can VC Announcements be Forwarded to SONOS
« Reply #5 on: October 03, 2014, 11:48:27 AM »
Excited to hear it. We look forward to your report.
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: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Can VC Announcements be Forwarded to SONOS
« Reply #6 on: October 03, 2014, 03:14:22 PM »
A bridge is no longer required if you have a simple audio set up. I have two Play 1's.

Cool.  If you only have a Play1 can you use it through the house wifi, or do you need to plug a network cable into it?

lemrock

  • Jr. Member
  • **
  • Posts: 21
  • Karma: 1
    • View Profile
Re: Can VC Announcements be Forwarded to SONOS
« Reply #7 on: October 03, 2014, 04:14:47 PM »
The Play 1 can connect through home wifi or Ethernet.

lemrock

  • Jr. Member
  • **
  • Posts: 21
  • Karma: 1
    • View Profile
Re: Can VC Announcements be Forwarded to SONOS
« Reply #8 on: October 06, 2014, 04:01:45 AM »
Well, I worked a fair amount over the weekend using the code provided from nime5ter . But alas, no joy... I believe the code you provided is working. The tts.wav file is generated and I get a response from SONOS. What ever is playing stops and tts.wav is queued up but I get an Access Denied error. I took a stroll over to the SONOS forums and there are lots of Access Denied discussions and tried everything I could find. Changing file permissions, adjusting the firewall, taking down the firewall....nothing. So anyone have any additional suggestions.

By the way it turns out that SONOS has issues with .wav files, they aren't recommended. So I created an .mp3 but the same issues.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Can VC Announcements be Forwarded to SONOS
« Reply #9 on: October 06, 2014, 08:20:21 AM »
Bummer.

Sounds like it's either not allowed to access that file path, or somehow the path syntax being used is wrong and access is denied because the path is invalid.

Maybe try to instruct Sonos to play a file that it already knows how to play (i.e. a music file from a folder it already accesses) to make sure you're getting the path syntax correct. That is, in your VC command, try to get it to play that file.

If that works, then try copying the TTS wav to the same folder on the music server (or wherever it is) and see if it will play the wav in that location.

If that works, then either get VC to save your TTS to that location when it's being generated, or try to figure out the difference access-wise between the original path and the path that works. Maybe Sonos can only play files from paths that have already been registered with it as valid sources, or something along those lines.
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 #10 on: October 07, 2014, 01:10:26 AM »
I did get the sonos to play a wav file from vc. You need to create a file and make sure it is in your sonos library. Then just keep writing what you want outputted to that same file. I will try to work up a complete process later today and post it.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Can VC Announcements be Forwarded to SONOS
« Reply #11 on: October 07, 2014, 09:36:53 AM »
Thanks crawfofd. That would be really helpful.
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)

lemrock

  • Jr. Member
  • **
  • Posts: 21
  • Karma: 1
    • View Profile
Re: Can VC Announcements be Forwarded to SONOS
« Reply #12 on: October 07, 2014, 06:13:44 PM »
Quote from nime5ter
Quote
Maybe try to instruct Sonos to play a file that it already knows how to play (i.e. a music file from a folder it already accesses) to make sure you're getting the path syntax correct. That is, in your VC command, try to get it to play that file.

If that works, then try copying the TTS wav to the same folder on the music server (or wherever it is) and see if it will play the wav in that location.

If that works, then either get VC to save your TTS to that location when it's being generated, or try to figure out the difference access-wise between the original path and the path that works. Maybe Sonos can only play files from paths that have already been registered with it as valid sources, or something along those lines.

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.

lemrock

  • Jr. Member
  • **
  • Posts: 21
  • Karma: 1
    • View Profile
Re: Can VC Announcements be Forwarded to SONOS
« Reply #13 on: October 07, 2014, 06:36:19 PM »
Oh, I see crawfold may have a solution. I'll wait for that.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Can VC Announcements be Forwarded to SONOS
« Reply #14 on: October 07, 2014, 06:41:55 PM »
Yes, here's hoping he has time to get to that soon.

If all else fails, you can resort to using the robotic Google Translate TTS voice until a better solution comes along, using the following URIToPLay syntax in your Vera.Raw string instead of the URIToPlay substring used above:

Code: [Select]
URIToPlay=x-rincon-mp3radio://translate.google.com/translate_tts?tl=en&q=[YOUR TTS MSG GOES HERE]
Found here: http://forum.micasaverde.com/index.php/topic,11269.msg82963.html#msg82963

(I tested the URL and it works but sounds terrible. ... And obviously, if your Internet is down, then no TTS.)
« Last Edit: October 07, 2014, 06:49:23 PM 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)