How we create a Virtual Feedback in VoxCommando and how we use it?
VoxCommando has a powerful action group that is called File. This action group has commands for writing, reading, copying, moving and deleting files or text line in files (pic 01). Some of this actions can we use to create a Virtual Feedback
A Virtual Feedback is sometimes useful when you control a device that you cant see.
For an example: a light outside the house
To use this command as here written, you must have extra hardware like a HALi-Controller (http://lifetek.co.uk/forum/showthread.php?tid=13 (http://lifetek.co.uk/forum/showthread.php?tid=13)) or a USB-UIRT (http://www.usbuirt.com/ (http://www.usbuirt.com/))
or similar that can be used with VoxCommando. I will show you only the structure of the command to realizing a TTS playback of a state of a device with VoxCommando.
For first this works only correct if you use VoxCommando to control the device. VoxCommando works here as control unit and always saves the switched state of the device. If you control the device with the original hardware remote, VoxCommando cant detect this.Not all VoxCommando users control lights with VoxCommando, so we use here as example to turn an amplifier ON or Off.
Here the task of: We want to know is the amplifier turned ON or OFF.
1. We create a group in VoxCommando Tree Editor with two commands. The first turned the amp on and the second off. Important is that you write the correct text in the File.WriteLine action to On command ON and in off command OFF (red marked in pic 02).
The File.WriteLine action write this text in a specified file which represent the current state of the device.
[attachment=1]
2. What we need as next is a command that read the inner text in this file and can distinguish between ON and OFF. To realizing that we must use the File.Read action combined with a logic block. (pic 03)
The File.Read action stored the inner text of this file (ON or OFF) and we can use it as {LastResult} value in a logic block (If-Then-Else).
If {LastResult} = ON -> Then -> TTS.Speak the amplifier is current on
Else -> TTS.Speak the amplifier is current off
[attachment=3]
This is not a feature that you absolutely needed, but it shows what can be achieved with this action group. I use similar actions with a prototype of HALi controller to control my lights. This makes much easier, because VoxCommando can scrape the state of the lights and also the temperature from a sensor in it directly from the HALi controller over network. For more information of the HALi controller you can take a look here: http://lifetek.co.uk/forum/showthread.php?tid=13 (http://lifetek.co.uk/forum/showthread.php?tid=13) or write a PM here in VC-Forum to xtermin8r http://voxcommando.com/forum/index.php?action=pm;sa=send (http://voxcommando.com/forum/index.php?action=pm;sa=send)
I hope this short workshop gives you an insight into mostly unknown but effective actions of VoxCommando. ;)
Kalle
very nice Tut Kalle. Your English is getting pretty good too! ;D
I notice you are using File.Append, but I think in this case it might be better to use File.WriteLine ?
Quote from: jitterjames on October 20, 2012, 03:16:40 PM
very nice Tut Kalle. Your English is getting pretty good too! ;D
I notice you are using File.Append, but I think in this case it might be better to use File.WriteLine ?
Thanks James,
I think we can use both - I will test it ;)
File.Append is wrong, I have change it in the tutorial to File.WriteLineThanks to James
If you turn the amp on multiple times, then the file will look like this:
OnOnOn
and when you check if {lastresult}=On it will be false.
Quote from: jitterjames on October 20, 2012, 05:47:10 PM
If you turn the amp on multiple times, then the file will look like this:
OnOnOn
and when you check if {lastresult}=On it will be false.
Ups, you've right, we must use
File.WriteLine - sorry for the confusion - I had open a other command as I written the tutorial ::duh
I have change it in the tutorial
Thanks for the attention :clap
Kalle
Thanks Kalle.
Nice feature, nice tutorial.
I can see so many uses for this write line and read line function. VC can essentially remember things and recall them on demand. Nice! Going to have lots of uses for this.
You can also use variables, which will be lost when VC closes, or maps, which will be remembered.
http://www.youtube.com/watch?v=k-kwIkmPDtI
Sweet! That's a really great feature. My mind now floods with ideas!
Ask VC, who is my (relationship). This is like mother, father, spouse, etc.
And VC says persons name.
Likewise I can say, Persons name (using payload dictation) is my best friend
And it would add it to my relationships table so that later I could ask it again.
Who is my mother-in-law again? :P
Now VC just got way more fun.