News:

HOT TIP! Exploring the commands packaged in VC's standard configurations is a great way to learn how to build your own. You can also clone a command as a starting point: just right-click and select "Clone" (or type Alt-C).

Main Menu

Toggle optional

Started by Darthvuder2, April 21, 2015, 10:42:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Darthvuder2

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

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

#2
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.

<?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>
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

#3
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:

<?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>
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

The second option dividing into on and off functions works like a charm