Author Topic: Programming Help  (Read 8580 times)

0 Members and 1 Guest are viewing this topic.

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Programming Help
« on: November 12, 2013, 12:21:04 PM »
Hi, Great program.

I am very new to this and am looking for assistance with implementing a command that will fire when I come home.  Here is the idea.

D... I'm home
D... welcome home the time is ... the temperature outside is ... Would you like me to adjust the thermostat?

If yes then speak "ok, I will adjust the thermostat to 75 degrees and will adjust the lighting in the TV Room and Kitchen to 75 percent.  Is there anything else you would like me to do?"
If no then speak " ok, Would you like to listen to music? (From this point on I can use information provided from the example on this forum)

Any help would be appreciated.

To help me accomplish this I am using the following equipment.

XBMC
ISY994 Universal Device controller
Insteon Light switches
Insteon Thermostat

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Programming Help
« Reply #1 on: November 12, 2013, 01:41:24 PM »
I think this video give you a start  ;)

www.youtube.com/watch?v=ewCRJZKFW34
***********  get excited and make things  **********

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #2 on: November 12, 2013, 01:50:40 PM »
Yes, that is where I got the idea.  However, I'm not so sure how to integrate VC with my insteon devices. 

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Programming Help
« Reply #3 on: November 12, 2013, 02:15:50 PM »
Do you already have VC working well with XBMC?

Have you been able to create the non-Insteon portions of the commands you're describing? It would be good to know what your level of familiarity is with VC command building, as well as your familiarity with your Insteon devices.

You will probably need to use one of the plugins, such as the X10 plugin or the TCP plugin to communicate with the Insteon devices.
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)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Programming Help
« Reply #4 on: November 12, 2013, 02:32:29 PM »
Actually, to control the insteon you will probably want to use the "scrape" action and refer to the following page for commands:
http://wiki.universal-devices.com/index.php?title=ISY_Developers:API:REST_Interface#Commands

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #5 on: November 12, 2013, 02:35:18 PM »
I have only used VC for a couple of days now.  I already have it working with XBMC.  I have limited experience with insteon and yes, I have been able to create the non insteon portions of the commands that I am describing. While I agree with you that I should start slow I just got real excited about the overall possibility.:)

As far as weather reporting... I was hoping to direct VC to report from a weather service if available.

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #6 on: November 12, 2013, 02:39:34 PM »
Thanks for the heads up about the scraping action.  I will try it tonight when I get home.  I am familiar with the Rest api and should be able to figure it out. 

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Programming Help
« Reply #7 on: November 12, 2013, 03:15:04 PM »
As far as weather reporting... I was hoping to direct VC to report from a weather service if available.

No problem there.  You can use the weather underground plugin.  "Wunder".

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #8 on: November 12, 2013, 07:49:32 PM »
Using the weather plugin.  I would like to create an action that will speak the current temperature.  I cant figure out the syntax.  Can you guide me in the right direction?  Here is what I've done so far.

Action = TTS.SpeakSync  "The current temp outside is {c.temp_f}" 

When I test this it reads the text as type above.  It does not include the actual temperature outside.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Programming Help
« Reply #9 on: November 12, 2013, 08:20:58 PM »
You need to first use a WUnder plugin-specific action to get the temperature. Then in your TTS.Speak action you can use {LastResult} to access the returned value.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="705" name="WEATHER" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>WUnder.Refresh</cmdType>
    <cmdString>Montreal&amp;&amp;EN&amp;&amp;C</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>WUnder.GetCustom</cmdType>
    <cmdString>{C.temp_f}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <cmdString>The current temperature is {LastResult} Fahrenheit</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <cmdString>The current temperature is {LastResult} Fahrenheit</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
</command>

The documentation for the WUnder.GetCustom action recommends using the refresh action first, which is why I put it in my code. It will work without it, but using refresh ensures you're always getting the most recent data.

List of WUnder plugin actions are here: http://voxcommando.com/mediawiki/index.php?title=Plugin_WUnder

As well as in the Action Selection Tree (see http://voxcommando.com/mediawiki/index.php?title=Logical_Command_Builder)
« Last Edit: November 12, 2013, 08:43:43 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)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Programming Help
« Reply #10 on: November 12, 2013, 08:42:47 PM »
Update: I just double-checked with James. Probably you don't need to bother with the Refresh action and can just use WUnder.GetCustom on its own.
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)

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #11 on: November 12, 2013, 08:48:30 PM »
Thank you so much for the prompt reply.  Works perfectly!

Thanks again.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Programming Help
« Reply #12 on: November 12, 2013, 09:00:06 PM »
If I remember correctly, any time you make a request for info, it will use the data cached from the last request, but before doing so, it will check how long it has been and if the data is more than 15 minutes old, it will auto-refresh the data first.

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #13 on: November 12, 2013, 09:21:11 PM »
ok, Thanks.

Now I have another question.  I would like to send a command from VC to process a program that turns on my lights.  I am using an ISY99 Universal device controller to control all of my insteon devices.  Earlier the suggestion was made that I use the scrape action in VC to implement this. 

After looking at the documentation for the scrape action.  I'm not so sure I understand the options.  XML and UserAgent.  I am familiar with Rest API and am able to get a list of the nodes and programs. I am still not sure how to setup the action in VC. Any other suggestions?


jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Programming Help
« Reply #14 on: November 12, 2013, 09:53:39 PM »
Just use the regular scrape action.  You don't need the other variations.  There are plenty of examples on the forum using scrape. 

The first parameter will be the URL and possibly some get parameters defined in the isy api.  To turn the lights on you don't really need to worry about what info gets sent back, but if you want to there are other actions that can deal with the result of the scrape.

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #15 on: November 12, 2013, 10:13:41 PM »
Got it! Worked like a charm.  Thanks again.

d

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #16 on: November 12, 2013, 11:05:02 PM »
Ok, I promise that this will be the last question of the night:)

I am struggling with the command to play a playlist in XBMC.  Here is what I have put together so far.  I read the thread about this issue and I am not sure that it applies to smart playlist with a .xsp extension.

<macro>
<action actiontype="XJson.Btn.KB" repeat="1" logic="False"><paramstring>x</paramstring></action>
<action actiontype="TTS.SpeakSync" repeat="1" logic="False"><paramstring>OKAY, I will play your jazz playlist. Enjoy</paramstring></action>
<action actiontype="XJson.ExecBuiltin" repeat="1" logic="False"><paramstring>PlayMedia(special://users/ddl/appdata/roaming/xbmc/userdata/playlists/music/gospel.xsp)</paramstring></action>
</macro>
« Last Edit: November 13, 2013, 12:18:28 PM by ddl »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Programming Help
« Reply #17 on: November 12, 2013, 11:16:11 PM »
I think your path is wrong. Check the XBMC wiki but I think you can delete

users/ddl/appdata/roaming/xbmc/userdata

Or something similar...  Past my bedtime. :-)
« Last Edit: November 13, 2013, 12:37:38 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Programming Help
« Reply #18 on: November 12, 2013, 11:18:15 PM »

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #19 on: November 12, 2013, 11:26:25 PM »
ok.

This is what the command looks like in another program.  Which action do I use in VC Raw or ???

/jsonrpc?request={"jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": "special://profile/playlists/music/Gospel.xsp" } }, "id": 1

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Programming Help
« Reply #20 on: November 13, 2013, 08:41:40 AM »
If you choose to use xJson.Raw instead, then method is the first param, and params is the second.

method": "  Player.Open  ", "params": { "item": { "file": "special://profile/playlists/music/Gospel.xsp"}  }, "id": 1


Look here for some examples: http://voxcommando.com/forum/index.php?topic=1010.msg9898#msg9898

« Last Edit: November 13, 2013, 08:46:23 AM by jitterjames »

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #21 on: November 13, 2013, 09:29:15 PM »
Trying to implement an answer to the question in red not sure I understand how.  Can you direct me? Is there some special action I can use that will walk me through.

<macro>
<action actiontype="WUnder.Refresh" repeat="1" logic="False"><paramstring>District of Columbia&amp;&amp;US-en&amp;&amp;F</paramstring></action>
<action actiontype="WUnder.GetCustom" repeat="1" logic="False"><paramstring>{C.temp_f}</paramstring></action>
<action actiontype="TTS.SpeakSync" repeat="1" logic="False"><paramstring>Hey, d!  Welcome home! The time is {ShortTime}.</paramstring></action>
<action actiontype="TTS.SpeakSync" repeat="1" logic="False"><paramstring>The current temperature is {LastResult} degrees fahrenheit.</paramstring></action>
<action actiontype="TTS.SpeakSync" repeat="1" logic="False"><paramstring>I will adjust the thermostat to 77 degrees fahrenheit. I will also set the lighting to 100% in the Kitchen and TV Room.</paramstring></action>
<action actiontype="Scrape" repeat="1" logic="False"><paramstring>http://192.168.1.14/rest/nodes/C 7B 80 1/cmd/DON&amp;&amp;don</paramstring></action>
<action actiontype="Scrape" repeat="1" logic="False"><paramstring>http://192.168.1.14/rest/nodes/D 2B A6 1/cmd/DON&amp;&amp;don</paramstring></action>
<action actiontype="Scrape" repeat="1" logic="False"><paramstring>http://192.168.1.14/rest/programs/004D/runThen&amp;&amp;don</paramstring></action>

<action actiontype="TTS.SpeakSync" repeat="1" logic="False"><paramstring>How was your day today?</paramstring></action>
    I would like to answer the question but can't figure out how to format it.... please help.  What action should I use.

<action actiontype="TTS.SpeakSync" repeat="1" logic="False"><paramstring>Would you like to listen to music?</paramstring></action>
<action actiontype="VC.TellVox" repeat="1" logic="False"><paramstring>confirm play music</paramstring></action>
</macro>
 
« Last Edit: November 13, 2013, 09:35:10 PM by ddl »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Programming Help
« Reply #22 on: November 13, 2013, 10:00:33 PM »
It depends on what you mean by wanting to answer it, but possibly you're meaning something along the lines of Kalle's "human touch" commands: http://voxcommando.com/forum/index.php?topic=1147.0

See video, and then his code later in the thread.

By the way, to share code on the forum, it's best to put it within "insert code" tags, which you can do by using the number sign/hash tag button above the message field.

See also: http://voxcommando.com/mediawiki/index.php?title=XML_on_the_forum
« Last Edit: November 13, 2013, 10:07:43 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)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Programming Help
« Reply #23 on: November 13, 2013, 10:32:12 PM »
This "2 way conversation thread" may also help meet your needs: http://voxcommando.com/forum/index.php?topic=1171.0

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)

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #24 on: November 13, 2013, 11:22:59 PM »
The puny humans xml to reference is perfect.  However, I am not a programmer and can't figure out how to get the xml into VC so I can edit to my liking. Can you help?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Programming Help
« Reply #25 on: November 14, 2013, 02:25:41 AM »
1 Save the  Punyhumans.xml file to your desktop
2 Open VC editor by clicking Edit on the main VC window
3 Click and drag the xml file from your desktop directly into the editor window

or for step 3 you can instead use File Open from the VC editor tree and then select the xml file.  This will create a second tree in another sub-window.  You can drag commands, or groups of commands from one window to another.

http://voxcommando.com/mediawiki/index.php?title=MDI_editor_interface

Just tested dragging the punyhumans.xml file into the editor and it works fine.

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #26 on: November 14, 2013, 10:33:25 AM »
Thank you... was able to get the commands into VC successfully.

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #27 on: November 14, 2013, 10:46:39 AM »
Fyi,

I think I am ready to take the plunge and purchase a license for VC.  However, I have a concern and I am hoping that its an easy fix.

Last night after installing VoxWav on my cell and trying to configure the folder on my pc.  I notice a considerable change in the response from commands issued through my mic. In some cases the VC did not respond and in some cases I got an error from VC indicating that the command was not in the dictionary.  I restarted VC and the computer and have gone through the mic setup several times but still no change.  This morning I tried again and I not no response at all from VC when trying to speak a command. 

I hope that this is something that can be fixed by just reinstalling the software and will try that this evening when I get home.  Any other suggestions would be appreciated.  I am also a home technology integrator and would love to be able to offer this product as an option to my clients.  However, I have to be sure that it will be stable. 

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Programming Help
« Reply #28 on: November 14, 2013, 11:13:31 AM »
Well, obviously installing VoxWav on your phone won't affect your VC installation.

Without knowing anything about your setup, microphone, or what settings you might have changed, it is difficult to suggest a fix.

You can try to clear your cache and rebuild, verify that you have the correct microphone set as the default, and that the volume is not set too high etc.

VC is usually quite stable but there are many things a user can do to mess it up.  That is just the nature of the beast when something is so extremely customisable and interfaces with so many programs and devices, adapts to your media content and can work in different languages etc.

You may send me your entire VC folder zipped if you want me to test it.  Use the contact link from the main website to send me email with a zip attachment renamed to .jpg just in case
« Last Edit: November 14, 2013, 11:20:22 AM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #30 on: November 14, 2013, 11:33:27 AM »
Thanks for your offer to help.  I will try more of the troubleshooting tips to include re installation of VC before sending the file to you.  To avoid having to recreate commands.  Can I copy the command.xml file and reload on a fresh VC installation? 

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Programming Help
« Reply #31 on: November 14, 2013, 12:00:27 PM »
Yes, if you do end up re-installing you can just copy your voicecommands.xml file into the root folder of the new installation. Note also that you can have more than one VC installation on your computer, so you could do a fresh install in a new folder and keep the original for a while.

Just in case you misunderstood James's suggestion regarding purging your VC cache and rebuilding, see: http://voxcommando.com/mediawiki/index.php?title=Main_Menu. You don't have to re-install the program to do this.

In general, there are quite a few pointers in the wiki documentation, on the forum, and in the many youtube tutorials, all of which can help with trouble-shooting VC and VoxWav.
« Last Edit: November 14, 2013, 12:05:23 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)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Programming Help
« Reply #32 on: November 14, 2013, 12:20:51 PM »
Yes, that is one way to recover your commands.  You should do a purge cache afterwards and restart VC.  You'll need to check your options too to re-enable plugins and you'll need to genXML again if you are using something like XBMC.

If your problems are caused by changes to the voicecommands.xml then you will be bringing them back.

You don't really "install VC" so much as unzip it.  But you can start with a fresh unzip into a blank folder to see if it fixes your problems.  That will help you to determine if you messed up a configuration, or if the problem is external to the program, such as a microphone setting or something like that.

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #33 on: November 16, 2013, 08:41:33 AM »
Ok,  I seem to have had a corrupt command.xml file.  Created a new one and all seems to be working now.  Thanks for your help.

Now for another issue that i am having.  I can't seem to get the second confirmation to work properly.  It works fine when I test the command but when I try it from the beginning it doesn't show the confirmation and it wont' finish the command.  Can you help me with this one?  I believe I followed the steps in the video.  I have one other comfirmation command in the program and it works fine. 

Code: [Select]
<macro>
<action actiontype="OSD.ShowText" repeat="1" logic="False"><paramstring></paramstring></action>
<action actiontype="TTS.SpeakSync" repeat="1" logic="False"><paramstring>Alright!  </paramstring></action>
<action actiontype="TTS.SpeakSync" repeat="1" logic="False"><paramstring>I'm glad to hear that  you are doing well!</paramstring></action>
<action actiontype="TTS.SpeakSync" repeat="1" logic="False"><paramstring>I'm doing fine myself.</paramstring></action>
<action actiontype="TTS.SpeakSync" repeat="1" logic="False"><paramstring>Would you like me to run program one?</paramstring></action>
<action actiontype="VC.TellVox" repeat="1" logic="False"><paramstring>Program one</paramstring></action>
</macro>

<macro>
<action actiontype="OSD.ShowText" repeat="1" logic="False"><paramstring></paramstring></action>
<action actiontype="VC.TellVox" repeat="1" logic="False"><paramstring>program one</paramstring></action>
<action actiontype="TTS.SpeakSync" repeat="1" logic="False"><paramstring>Ok!  running program one now.</paramstring></action>
<action actiontype="TTS.SpeakSync" repeat="1" logic="False"><paramstring>The time is {ShortTime}</paramstring></action>
<action actiontype="WUnder.Refresh" repeat="1" logic="False"><paramstring>Bowie&amp;&amp;EN&amp;&amp;C</paramstring></action>
<action actiontype="WUnder.GetCustom" repeat="1" logic="False"><paramstring>{C.temp_f}</paramstring></action>
<action actiontype="TTS.SpeakSync" repeat="1" logic="False"><paramstring>The current temperature outside is {LastResult} degrees</paramstring></action>
<action actiontype="TTS.SpeakSync" repeat="1" logic="False"><paramstring>I will adjust the thermostat to 75 degrees</paramstring></action>
<action actiontype="TTS.SpeakSync" repeat="1" logic="False"><paramstring>I will also set the kitchen and tv room lights to 100%.</paramstring></action>
<action actiontype="Scrape" repeat="1" logic="False"><paramstring>http://192.168.1../rest/programs/002C/runThen&amp;&amp;don</paramstring></action>
<action actiontype="Scrape" repeat="1" logic="False"><paramstring>http://192.168.1../rest/nodes/C 7B 80 1/cmd/DON&amp;&amp;don</paramstring></action>
<action actiontype="Scrape" repeat="1" logic="False"><paramstring>http://192.168.1../rest/nodes/D 2B A6 1/cmd/DON&amp;&amp;don</paramstring></action>
<action actiontype="Scrape" repeat="1" logic="False"><paramstring>http://192.168.1../rest/programs/004D/runThen&amp;&amp;don</paramstring></action>
</macro>
« Last Edit: November 16, 2013, 08:43:42 AM by ddl »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Programming Help
« Reply #34 on: November 16, 2013, 09:51:47 AM »
Hi ddl,

You've posted the xml for actions within your commands by copying them from within the Logical Command Builder (LCB), rather than posting your complete command xml (which can be copied directly within the command tree editor window).

This makes it difficult to assist, as we really need the entire command xml. Note that you can copy a whole command group at once. Please see the explanation of how to post your complete commands here: http://voxcommando.com/mediawiki/index.php?title=XML_on_the_forum

The very brief video tutorials may be the most helpful, if you're not yet completely familiar with the various terms we use in VC (e.g. command tree editor vs. LCB). They show the opposite -- copying code from the forum to your command tree, but it works the same in reverse.
« Last Edit: November 16, 2013, 10:06:10 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)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Programming Help
« Reply #35 on: November 16, 2013, 12:24:45 PM »
In other words, if you want help with this confirmation sequence that you are trying to create, you should do the following:

- Put all the relevant commands into one group.
- Copy the entire group from your tree (either select and press Ctrl-C, or right-click and choose copy)
- Reply to this thread, and paste the group into a code block, as you have done above.

This way we can simply paste the group into our own tree and immediately test it try to see if it works, or spot why it doesn't.

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #36 on: November 16, 2013, 06:42:52 PM »
Hi Jitterjames,

Sorry for the delayed response.  Thanks for helping me with this.  I hope I have followed the instructions right. 

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="test" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="348" name="Greet computer" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <cmdString>Hello, who am I speaking to?</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.EnableGroup</cmdType>
      <cmdString>User options</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <payloadList optional="true">good morning, good afternoon, good evening</payloadList>
    <phrase>Hello computer</phrase>
  </command>
  <command id="429" name="User choices" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>Hey! {1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{1}&amp;&amp;Donald</ifParams>
      <then>
        <action>
          <cmdType>TTS.SpeakSync</cmdType>
          <cmdString>How are you today?</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.TellVox</cmdType>
          <cmdString>Acknowledgement 1</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>VC.TellVox</cmdType>
          <cmdString>Watch TV episode</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{1}&amp;&amp;Lisa</ifParams>
      <then>
        <action>
          <cmdType>TTS.SpeakSync</cmdType>
          <cmdString>Would you like to listen to your favourite music?</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.TellVox</cmdType>
          <cmdString>Play Lisa's music</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <action>
      <cmdType>VC.DisableGroup</cmdType>
      <cmdString>User options</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>This is, I am, It is</phrase>
    <payloadList>Donald, Lisa</payloadList>
    <phrase optional="true">speaking, here</phrase>
  </command>
  <command id="410" name="Acknowledgement 1" enabled="true" alwaysOn="False" confirm="True" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>Alright!  </cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>I'm glad to hear that  you are doing well!</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>I'm doing fine myself.</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>Would you like me to run program one?</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TellVox</cmdType>
      <cmdString>Program one</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Acknowledgement 1</phrase>
  </command>
  <command id="443" name="Program one" enabled="true" alwaysOn="False" confirm="True" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TellVox</cmdType>
      <cmdString>program one</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>Ok!  running program one now.</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>The time is {ShortTime}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>WUnder.Refresh</cmdType>
      <cmdString>Bowie&amp;&amp;EN&amp;&amp;C</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>WUnder.GetCustom</cmdType>
      <cmdString>{C.temp_f}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>The current temperature outside is {LastResult} degrees</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>I will adjust the thermostat to 75 degrees</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>I will also set the kitchen and tv room lights to 100%.</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <cmdString>http://192.168.1.1/rest/programs/002C/runThen&amp;&amp;d</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <cmdString>http://192.168.1.1/rest/nodes/C 7B 80 1/cmd/DON&amp;&amp;d</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <cmdString>http://192.168.1.1/rest/nodes/D 2B A6 1/cmd/DON&amp;&amp;d</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <cmdString>http://192.168.1.1/rest/programs/004D/runThen&amp;&amp;don</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>program one</phrase>
  </command>
</commandGroup>

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Programming Help
« Reply #37 on: November 16, 2013, 09:52:27 PM »
Hi ddl,

You're right, the second confirmation wasn't working in your scene. This is because Vox has trouble with multiple confirm commands strung together. Although there's a technical workaround if it's absolutely necessary, there's no need to have multiple confirm commands in your particular scene.

Instead, you can use your scripted response to the previous command as the command phrase that triggers the next command (in this case, Acknowledgement One). Then the only command you're confirming is the last one -- Program One.

Apart from that, we just did some minor clean-up of actions and more importantly, divided your commands into two groups. Try them out, see what you think.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="test" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="362" name="Greet computer" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <cmdString>Hello, who am I speaking to?</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.EnableGroup</cmdType>
      <cmdString>Program one</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <payloadList optional="true">good morning, good afternoon, good evening</payloadList>
    <phrase>Hello computer</phrase>
  </command>
</commandGroup>


Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="Program one" enabled="False" prefix="" priority="0" requiredProcess="" description="">
  <command id="483" name="User choices" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>Hey! {1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{1}&amp;&amp;Donald</ifParams>
      <then>
        <action>
          <cmdType>TTS.SpeakSync</cmdType>
          <cmdString>How are you today?</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.TellVox</cmdType>
          <cmdString>Acknowledgement 1</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{1}&amp;&amp;Lisa</ifParams>
      <then>
        <action>
          <cmdType>TTS.SpeakSync</cmdType>
          <cmdString>Would you like to listen to your favourite music?</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.TellVox</cmdType>
          <cmdString>Play Lisa's music</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <phrase>This is, I am, It is</phrase>
    <payloadList>Donald, Lisa</payloadList>
    <phrase optional="true">speaking, here</phrase>
  </command>
  <command id="462" name="Acknowledgement 1" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>Alright!  </cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>I'm glad to hear that  you are doing well!</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>I'm doing fine myself.</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>Would you like me to run program one?</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TellVox</cmdType>
      <cmdString>program one</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>I am fine, Not bad, I'm okay</phrase>
    <phrase optional="true">thanks, I'm afraid</phrase>
  </command>
  <command id="495" name="Program one" enabled="true" alwaysOn="False" confirm="True" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>Ok!  running program one now.</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>The time is {ShortTime}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>WUnder.Refresh</cmdType>
      <cmdString>Bowie&amp;&amp;EN&amp;&amp;C</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>WUnder.GetCustom</cmdType>
      <cmdString>{C.temp_f}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>The current temperature outside is {LastResult} degrees</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>I will adjust the thermostat to 75 degrees</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>I will also set the kitchen and tv room lights to 100%.</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <cmdString>http://192.168.1.1/rest/programs/002C/runThen&amp;&amp;d</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <cmdString>http://192.168.1.1/rest/nodes/C 7B 80 1/cmd/DON&amp;&amp;d</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <cmdString>http://192.168.1.1/rest/nodes/D 2B A6 1/cmd/DON&amp;&amp;d</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <cmdString>http://192.168.1.1/rest/programs/004D/runThen&amp;&amp;don</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.DisableGroup</cmdType>
      <cmdString>Program one</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>program one</phrase>
  </command>
</commandGroup>

As James has said before, VC was not initially conceived as a conversational AI bot, but really as a way to replace manual control with voice control. So while it's great for a single back and forth exchange, implementing entire conversational threads can definitely get tricksy.
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)

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #38 on: November 17, 2013, 12:29:35 PM »
This will work just fine.  Thanks for your help.

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #39 on: November 17, 2013, 12:37:11 PM »
I have another problem that I am running into.  I have xbmc loaded on my e:drive.  When I request xbmc to launch from VC it defaults to the c:drive where xbmc does not exist.  I understand where to change the path but I can't figure out the syntax.  Is it simply

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="Launch" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="99" name="launch xbmc" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Launch.RawParam</cmdType>
      <cmdString>{E:progrm files x86}\XBMC\XBMC.exe</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>open, launch, run, start</phrase>
    <phrase>x b m c, media center</phrase>
  </command>
</commandGroup>

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Programming Help
« Reply #40 on: November 17, 2013, 01:09:26 PM »
The path should just be the actual path to your xbmc.exe file as you could type it in a dos prompt to run it.

so instead of
Code: [Select]
{E:progrm files x86}\XBMC\XBMC.exe
it should be something like:

Code: [Select]
E:\Program Files (x86)\XBMC\XBMC.exe
the variable {Path.PFx86} cannot be modifed in any way.  On 64 bit systems it becomes
Code: [Select]
C:\Program Files (x86) and on 32 bit systems it becomes
Code: [Select]
c:\Program Files
This is just a way to make it work on most systems without needing to be modified by the user.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Programming Help
« Reply #41 on: November 17, 2013, 02:35:30 PM »
For future reference, when editing commands in the LCB, you can always use the "parameter helper" tool to browse to a folder or file, or to otherwise help in defining the correct path.

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

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Programming Help
« Reply #42 on: November 17, 2013, 08:42:55 PM »
ok, I have setup vc and am using it successfully with a mic.  Now, I would like to use my cell phone to send commands.  I have downloaded vox wave from googl playstore (free version).  In the setup I have entered the ip address of the computer hosting vc.  For whatever reason I am unable to connect.  Are there setup instruction for vox wave available.  I have looked on the site and have followed some instructions but still no connection established.  Any help would be appreciated.


nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Programming Help
« Reply #43 on: November 17, 2013, 09:14:11 PM »
ok, I have setup vc and am using it successfully with a mic.  Now, I would like to use my cell phone to send commands.  I have downloaded vox wave from googl playstore (free version).  In the setup I have entered the ip address of the computer hosting vc.  For whatever reason I am unable to connect.  Are there setup instruction for vox wave available.  I have looked on the site and have followed some instructions but still no connection established.  Any help would be appreciated.

Glad to hear that you're making progress.

By "followed some instructions" on "the site", do you mean that you followed all of the instructions in the installation guide on the VoxWav site? (http://voxwav.wikispaces.com/VoxWav+Home) ?

It's difficult to help without knowing the exact steps you've taken, but it doesn't sound as though all the instructions have been followed.

In the future, please post new support questions in new threads on the appropriate board, as per the forum guidelines. http://voxcommando.com/forum/index.php?topic=1248.0

Information that's valuable to all users tends to get buried when support information is provided deep within an unrelated thread on an unrelated board.

Thanks.
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)