Author Topic: VC.TellVox issue with duplicated Payloads  (Read 3287 times)

0 Members and 3 Guests are viewing this topic.

monkee

  • $upporter
  • Jr. Member
  • *****
  • Posts: 40
  • Karma: 4
    • View Profile
VC.TellVox issue with duplicated Payloads
« on: December 30, 2016, 02:37:01 AM »
Hi, I'm doing something wrong and would love some help figuring out how to fix it.  Thanks in advance for taking a look!

I'm attempting to use VoxCommando on two different PCs and using this technique: http://voxcommando.com/forum/index.php?topic=1050.msg8790#msg8790

EventGhost.SetIP   - 192.x.x.x
EventGhost.SetPort - 33000
EventGhost.Send    - VC.TellVox - xyz

(sends to VC not EventGhost)

It is working fine for all of my commands EXCEPT for the ones which contain Payloads.  On those, I cannot replace xyz above with their exact phrase because there are variables (payloads) in the phrase. 

I've tried a few things and when using "VC.Tellvox - {lastspoken}", the payloads are being correctly added to the message sent to the other PC but they are being duplicated and appended to the end of the command so the receiving PC's VoxCommando sees the payloads twice, like below.

Example (window of receiving VoxCommando):
emulate: Set a timer for 2 minutes&&2&&minutes

This will not allow the receiving PC to recognize the phrase :(

Is there a way to strip that appended payload (&&2&&minutes) from the command before it is sent?

Thanks so much for taking a look at this :)

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: VC.TellVox issue with duplicated Payloads
« Reply #1 on: December 30, 2016, 03:34:10 AM »
could you copy the commands from both PC's so we can test them out, I tried to duplicate your problem but I didn't have any issues

how to post commands on the forum
http://voxcommando.com/mediawiki/index.php?title=XML_on_the_forum
scroll down to Posting Your Code to the Forum

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: VC.TellVox issue with duplicated Payloads
« Reply #2 on: December 30, 2016, 12:08:34 PM »
If you read the description of the action you can see that payloads are sent automatically: http://voxcommando.com/mediawiki/index.php?title=Actions#Send

I'm not sure why having an extra payload would cause VC.TellVox to not work but I have not actually tested it.
OK.  Tested it and extra payloads do interfere with VC.TellVox.  While this is not technically a bug I can probably fix it.  But see below.

The better option would be to use TCP.UDP.SendMixed which does not send payloads automatically.

You will find you get much better support if you start posting XML for the commands you want help with.
« Last Edit: December 30, 2016, 12:11:27 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando

monkee

  • $upporter
  • Jr. Member
  • *****
  • Posts: 40
  • Karma: 4
    • View Profile
Re: VC.TellVox issue with duplicated Payloads
« Reply #4 on: December 30, 2016, 04:38:44 PM »
Thanks for the responses and also for adding a new feature in the future!  Do you have an approximate timeline for that release?

And OK I will start posting the code in the future too.  I didn't realize you could copy it right from the tree without digging out the xml file.  Thanks for the tip!

I tried using TCP.UDP.SendMixed instead of the Eventghost.Xxx commands and it arrives but shows a yellow bar in the history and does not trigger anything.  I think VC may need the phrase "spoken" to it in this case instead of sent as a pre-formed phrase, if that makes sense?

In any case, the code is below and I think I got the timer code from a post here but it's been a while.

Thanks!

Here is the code from the main computer:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.2.9-->
<command id="712" name="timer" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{2}&amp;&amp;seconds</ifParams>
    <then>
      <action>
        <cmdType>VC.SetEventTimer</cmdType>
        <params>
          <param>{1}s</param>
          <param>alarmsound</param>
          <param>{1}</param>
          <param>{2}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{2}&amp;&amp;minutes</ifParams>
    <then>
      <action>
        <cmdType>VC.SetEventTimer</cmdType>
        <params>
          <param>{1}m</param>
          <param>alarmsound</param>
          <param>{1}</param>
          <param>{2}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{2}&amp;&amp;hours</ifParams>
    <then>
      <action>
        <cmdType>VC.SetEventTimer</cmdType>
        <params>
          <param>{1}h</param>
          <param>alarmsound</param>
          <param>{1}</param>
          <param>{2}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <action>
    <cmdType>Sound.PartialMute</cmdType>
    <params>
      <param>60</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <params>
      <param>300</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>Reminder set for {1} {2}.</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.SpeakSync</cmdType>
    <params>
      <param>Tea minus {1} {2} and counting. | Reminder set for {1} {2}.</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Sound.PartialUnMute</cmdType>
    <params />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>set an alarm, set a timer, set a reminder, remind me</phrase>
  <phrase>in, for</phrase>
  <payloadRange>1,120</payloadRange>
  <payloadList>seconds, minutes, hour, hours</payloadList>
</command>

And from the secondary computer:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.2.9-->
<command id="418" name="timer test send" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>EventGhost.SetIP</cmdType>
    <params>
      <param>192.168.1.12</param>
    </params>
    <cmdRepeat>0</cmdRepeat>
  </action>
  <action>
    <cmdType>EventGhost.SetPort</cmdType>
    <params>
      <param>33000</param>
    </params>
    <cmdRepeat>0</cmdRepeat>
  </action>
  <action>
    <cmdType>EventGhost.Send</cmdType>
    <params>
      <param>VC.TellVox</param>
      <param>{LastSpoken}</param>
    </params>
    <cmdRepeat>0</cmdRepeat>
  </action>
  <action>
    <cmdType>TCP.UDP.SendMixed</cmdType>
    <params>
      <param>{LastSpoken}</param>
      <param>33000</param>
      <param>192.168.1.12</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase optional="true">Computer</phrase>
  <phrase>set an alarm, set a timer, set a reminder, remind me</phrase>
  <phrase>in, for</phrase>
  <payloadRange>1,120</payloadRange>
  <payloadList>seconds, minutes, hour, hours</payloadList>
</command>

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: VC.TellVox issue with duplicated Payloads
« Reply #5 on: December 30, 2016, 06:55:15 PM »
You are just sending the recognized text.  VC does not know what to do when it receives just words.

You should be sending an action to tell it what to do just like you were apparently doing before.

So the sending computer (what you call the secondary computer) your command should be more like this:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.3.2-->
<command id="431" name="timer test send" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>TCP.UDP.SendMixed</cmdType>
    <params>
      <param>VC.TellVox\x26\x26{lastSpoken}</param>
      <param>33000</param>
      <param>192.168.1.12</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase optional="true">Computer</phrase>
  <phrase>set an alarm, set a timer, set a reminder, remind me</phrase>
  <phrase>in, for</phrase>
  <payloadRange>1,120</payloadRange>
  <payloadList>seconds, minutes, hour, hours</payloadList>
</command>

We must use /x26/x26 instead of && because you can't put && in a parameter.
« Last Edit: December 30, 2016, 07:01:27 PM by jitterjames »

monkee

  • $upporter
  • Jr. Member
  • *****
  • Posts: 40
  • Karma: 4
    • View Profile
Re: VC.TellVox issue with duplicated Payloads
« Reply #6 on: December 30, 2016, 09:42:11 PM »
You are just sending the recognized text.  VC does not know what to do when it receives just words.

You should be sending an action to tell it what to do just like you were apparently doing before.

Yep, that's what I meant by VC needing to be "spoken to", haha.  I didn't realize I could still use VC.TellVox along with TCP.UDP.SendMixed but your solution worked great, thank you so much!! 

Would you suggest I change my other actions, even thought they are working, to use this method instead of the EventGhost... method I was using?  I only had a problem with the ones with payloads.

Thanks again!

Quote
We must use /x26/x26 instead of && because you can't put && in a parameter.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: VC.TellVox issue with duplicated Payloads
« Reply #7 on: December 31, 2016, 11:43:39 AM »
Would you suggest I change my other actions, even thought they are working, to use this method instead of the EventGhost... method I was using?  I only had a problem with the ones with payloads.

Well, whatever works works, but going forward you may find it easier to maintain your configuration if you are consistent.  It's up to you.  When the next release is out you may want to switch all your commands over to using EventGhost.SendNP, otherwise I would suggest using the TCP plugin.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: VC.TellVox issue with duplicated Payloads
« Reply #8 on: December 31, 2016, 11:45:48 AM »
Thanks for the responses and also for adding a new feature in the future!  Do you have an approximate timeline for that release?

Almost certainly before the end of January 2017 but I can't be much more precise than that.  There are a few things I'm looking at doing before the next release.

monkee

  • $upporter
  • Jr. Member
  • *****
  • Posts: 40
  • Karma: 4
    • View Profile
Re: VC.TellVox issue with duplicated Payloads
« Reply #9 on: January 01, 2017, 06:10:46 PM »
Well, whatever works works, but going forward you may find it easier to maintain your configuration if you are consistent.  It's up to you.  When the next release is out you may want to switch all your commands over to using EventGhost.SendNP, otherwise I would suggest using the TCP plugin.

Thanks for the info and I was able to get everything working even better than my original goal.  Thank you so much!