Author Topic: Toggle optional  (Read 2181 times)

0 Members and 1 Guest are viewing this topic.

Darthvuder2

  • Jr. Member
  • **
  • Posts: 13
  • Karma: 0
    • View Profile
Toggle optional
« on: April 21, 2015, 10:42:25 PM »
Hello , I have my vera connected to vox commando
The built in switch command uses words switch or turn to activate, ie "turn kitchen off".
Was wondering if there was a way to make it so I wouldn't have to use the word "turn or switch at all. Meaning could I just say "kitchen off" and have the function work

I know that I could make a dedicated command for each vera device but I was hoping to just modify the built in command as I have many vera devices

I have tried using the "toggle optional" on the "switch or turn phrase but then the system doesn't recogniZe The command at all.

The reason I want this is that I have to use a prefix ie "computer" to avoid false firings as the microphone is near a tv and thus the phrase, computer turn kitchen on seems long to say. I'd rather say computer,kitchen on

Thanks for your help

Collin

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: Toggle optional
« Reply #1 on: April 22, 2015, 01:30:15 AM »
are you saving and exiting the command editor after toggling the phrase "switch, turn" to optional before testing,

changes won't take effect until you have saved and closed the command editor

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Toggle optional
« Reply #2 on: April 22, 2015, 09:26:51 AM »
A voice command cannot consist of only payloads. If you make the one phrase optional, VC can't identify which command you're asking for. http://voxcommando.com/mediawiki/index.php?title=Command_Tree_Editor

Depending on how many switches you have, one option would be to break up your Vera commands by room, rather than using a single payload xml for all switches. Then each can be phrase-based. e.g.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.5-->
<command id="258" name="Kitchen {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="NOTE: Map variable is an example. You need to use the correct variable from your own Vera device map.">
  <action>
    <cmdType>Vera.SetState</cmdType>
    <params>
      <param>{M:Vera1D.Kitchen}</param>
      <param>{2}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>Turning kitchen light {PF.1}.</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>Turning kitchen light {PF.1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Kitchen</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\on_off.xml</payloadFromXML>
</command>
« Last Edit: April 22, 2015, 09:30:58 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)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Toggle optional
« Reply #3 on: April 22, 2015, 09:52:42 AM »
Another perhaps preferable option is to break it up into one ON command and one OFF command. On and Off are your non-optional phrases.

On:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.5-->
<command id="258" name="{1} on" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description=".">
  <action>
    <cmdType>Vera.SetState</cmdType>
    <params>
      <param>{1}</param>
      <param>1</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>{PF.1} on.</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>{PF.1} on</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">Vera1\switches.xml</payloadFromXML>
  <phrase>on</phrase>
</command>
« Last Edit: March 03, 2017, 08:15:18 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)

Darthvuder2

  • Jr. Member
  • **
  • Posts: 13
  • Karma: 0
    • View Profile
Re: Toggle optional
« Reply #4 on: April 24, 2015, 02:27:24 AM »
The second option dividing into on and off functions works like a charm