VoxCommando

Help and Support (Using VoxCommando) => VoxCommando Basics and Core Features => Topic started by: sebaszz on December 30, 2015, 11:03:51 AM

Title: Use confirm command together with trigger events
Post by: sebaszz on December 30, 2015, 11:03:51 AM
Hi guys,

I would like to trigger VC by using event. Then VC ask a TTS question, I need to confirm, then Action.
I found example on youtube for confirming commands. that's but only with phrase triggers not events.

I create the example to get the result but of course this should be done differently


Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.2-->
<commandGroup open="True" name="Fibaro Asking" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="330" name="Shall I spray the garden?" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Shall I spray the garden?</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Garden</event>
  </command>
  <command id="372" name="Irrigation system activated" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Irrigation system activated</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>yes</phrase>
    <phrase optional="true">please</phrase>
  </command>
</commandGroup>
Title: Re: Use confirm command together with trigger events
Post by: nime5ter on December 30, 2015, 11:48:10 AM
See: http://voxcommando.com/forum/index.php?topic=1589.msg13879#msg13879

Your commands will work fine if you add a VC.TellVox action to the first command. Then the second one can require confirmation.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<commandGroup open="True" name="Fibaro Asking" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="330" name="Shall I spray the garden?" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Shall I spray the garden?</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TellVox</cmdType>
      <params>
        <param>Activate the irrigation system</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Garden</event>
  </command>
  <command id="372" name="Activate irrigation" enabled="true" alwaysOn="False" confirm="True" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>Fibaro action to activate the irrigation system ....</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Irrigation system activated</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Activate the irrigation system</phrase>
  </command>
</commandGroup>
Title: Re: Use confirm command together with trigger events
Post by: sebaszz on December 31, 2015, 05:19:11 AM
Many thanx again this works perfect.