Author Topic: Greeting by Time of Day  (Read 5038 times)

0 Members and 1 Guest are viewing this topic.

bp_pbs

  • Contributor
  • ***
  • Posts: 94
  • Karma: 1
    • View Profile
Greeting by Time of Day
« on: June 06, 2013, 02:39:02 AM »
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

  • $upporter
  • Sr. Member
  • *****
  • Posts: 139
  • Karma: 31
    • View Profile
Re: Greeting by Time of Day
« Reply #1 on: June 06, 2013, 04:09:57 AM »
try this:

Code: [Select]
<?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

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Greeting by Time of Day
« Reply #2 on: June 06, 2013, 05:57:18 AM »
Hi Dave, good job - excellent!  :clap
***********  get excited and make things  **********

bp_pbs

  • Contributor
  • ***
  • Posts: 94
  • Karma: 1
    • View Profile
Re: Greeting by Time of Day
« Reply #3 on: June 06, 2013, 11:18:54 AM »
That is exactly what I needed. Like Kalle said "Good Job"

Thanks

Dave

  • $upporter
  • Sr. Member
  • *****
  • Posts: 139
  • Karma: 31
    • View Profile
Re: Greeting by Time of Day
« Reply #4 on: June 06, 2013, 01:53:19 PM »
You're welcome!  8)

mdsh

  • $upporter
  • Sr. Member
  • *****
  • Posts: 127
  • Karma: 4
    • View Profile
Re: Greeting by Time of Day
« Reply #5 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

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Greeting by Time of Day
« Reply #6 on: July 20, 2013, 08:48:34 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

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Greeting by Time of Day
« Reply #7 on: July 20, 2013, 10:26:51 PM »
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

  • $upporter
  • Sr. Member
  • *****
  • Posts: 127
  • Karma: 4
    • View Profile
Re: Greeting by Time of Day
« Reply #8 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

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Greeting by Time of Day
« Reply #9 on: July 22, 2013, 08:19:57 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)
« Last Edit: July 22, 2013, 10:24:26 AM by Kalle »
***********  get excited and make things  **********

mdsh

  • $upporter
  • Sr. Member
  • *****
  • Posts: 127
  • Karma: 4
    • View Profile
Re: Greeting by Time of Day
« Reply #10 on: July 24, 2013, 05:59:05 AM »
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!