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

Greeting by Time of Day

Started by bp_pbs, June 06, 2013, 02:39:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bp_pbs

Alright Team I have another one. So I'm trying to get Vox to greet me based on the time of the day
Ex. Anything between 7AM and 11Am ( Vox would respond with "Good morning")

I did find this previous topic
http://voxcommando.com/forum/index.php?topic=605.msg4389#msg4389

Dave

try this:

<?xml version="1.0" encoding="utf-16"?>
<command id="389" name="greeting" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>07 08 09 10 11 &amp;&amp;{DtCustom.HH}</ifParams>
    <then>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <cmdString>Good Morning</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>12 13 14 15 16 17 18 19 20&amp;&amp;{DtCustom.HH}</ifParams>
    <then>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <cmdString>Have a nice day</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>21 22 23 00 01 02&amp;&amp;{DtCustom.HH}</ifParams>
    <then>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <cmdString>Good night</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
</command>

Kalle

Hi Dave, good job - excellent!  :clap
***********  get excited and make things  **********

bp_pbs

That is exactly what I needed. Like Kalle said "Good Job"

Thanks

Dave


mdsh

Hi Dave thank you for this share!!! Works really well. Currently configuring it to say Hi and Bye based on time of day. I at least started creating my own version of this but then when I got to the logic I had CONTAINING argument right but couldn't figure out the {DtCustom.HH} side of it.

How\where did you get this?? I presume there must a place within VC that I could see these types of options I have but could find it within the ADD LOGIC section when I was attempting to create my own one. Thanks

Kalle

Quote from: mdsh on July 20, 2013, 08:32:32 AM
Hi Dave thank you for this share!!! Works really well. Currently configuring it to say Hi and Bye based on time of day. I at least started creating my own version of this but then when I got to the logic I had CONTAINING argument right but couldn't figure out the {DtCustom.HH} side of it.

How\where did you get this?? I presume there must a place within VC that I could see these types of options I have but could find it within the ADD LOGIC section when I was attempting to create my own one. Thanks
take a look in this post http://voxcommando.com/forum/index.php?topic=822.msg6728#msg6728  ;)
***********  get excited and make things  **********

nime5ter

Quote from: mdsh on July 20, 2013, 08:32:32 AM
How\where did you get this?? I presume there must a place within VC that I could see these types of options I have but could find it within the ADD LOGIC section when I was attempting to create my own one. Thanks

DtCustom.?? is a system variable that allows you to create custom DateTime codes. You can find out more about payloads and other variables on the wiki: http://voxcommando.com/mediawiki/index.php?title=Logical_Command_Builder#Using_Payloads_and_other_variables_with_.7B_.7D

(Though the documentation for that needs a bit more work still.)

Generally speaking, you can use the 'parameter helper' button in the LCB (the button with the three building blocks icon to the right of the parameter fields) to find the syntax for various common parameters. Unfortunately the custom DateTime code doesn't seem to be listed there, but you might still find some others that are of interest.

See also: http://voxcommando.com/mediawiki/index.php?title=Logical_Command_Builder#Main_Command_Builder_Window
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)

mdsh

Thanks Kalle and nime5ter... reading these right now so will note these and build my own from scratch :)

I have it set up now that when VC.on it says GOOD MORNING or GOOD AFTERNOON and so on and the same for VC.off\standby - still tweaking a bit and will hopefully set up a new action to just say GOOD MORNING should i say good morning computer as opposed to my normal computer command for VC.on

thanks again for these links

Kalle

#9
Quote from: mdsh on July 22, 2013, 06:03:59 AM
Thanks Kalle and nime5ter... reading these right now so will note these and build my own from scratch :)

I have it set up now that when VC.on it says GOOD MORNING or GOOD AFTERNOON and so on and the same for VC.off\standby - still tweaking a bit and will hopefully set up a new action to just say GOOD MORNING should i say good morning computer as opposed to my normal computer command for VC.on

thanks again for these links
You can create similar as in the attached pic - don't forget to make the payloadList optional  ;)
You can also change the sequence of phrase (first the phrase "computer, pay attention" and then the payloadList)
***********  get excited and make things  **********

mdsh

That is real tidy Kalle!!! Thank you for that! I will be testing a few things over the weekend as soon as I have time. Only had about 45 minutes tonight so I quickly set up my Gmail check for new emails in inbox... AND FROM SCRATCH and alone  ;D SOooooooo happy. I am clearly learning bit by bit even though it was a pretty simple task it great to know I didnt have to look anything up :) So next is reminders and then ill do this good morning\afternoon\evening again

But thanks again for the pointers!