Author Topic: Workshop: How we create a „Virtual Feedback“ in VoxCommando  (Read 4787 times)

0 Members and 1 Guest are viewing this topic.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Workshop: How we create a „Virtual Feedback“ in VoxCommando
« on: October 20, 2012, 10:49:04 AM »
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 can’t 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) or a USB-UIRT (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 can’t 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 or write a PM here in VC-Forum to “xtermin8r” 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
« Last Edit: April 01, 2013, 02:24:12 PM by Kalle »
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Workshop: How we create a „Virtual Feedback“ in VoxCommando
« Reply #1 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 ?

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Workshop: How we create a „Virtual Feedback“ in VoxCommando
« Reply #2 on: October 20, 2012, 04:06:52 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.WriteLine

Thanks to James
« Last Edit: October 21, 2012, 02:47:19 AM by Kalle »
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Workshop: How we create a „Virtual Feedback“ in VoxCommando
« Reply #3 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.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Workshop: How we create a „Virtual Feedback“ in VoxCommando
« Reply #4 on: October 21, 2012, 02:44:59 AM »
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
« Last Edit: October 21, 2012, 02:48:55 AM by Kalle »
***********  get excited and make things  **********

xtermin8r

  • $upporter
  • Sr. Member
  • *****
  • Posts: 366
  • Karma: 9
  • Crunchie
    • View Profile
Re: Workshop: How we create a „Virtual Feedback“ in VoxCommando
« Reply #5 on: October 23, 2012, 07:23:11 AM »
Thanks Kalle.
Nice feature, nice tutorial.
Neural Net Based Artificial Intelligence.

jb5349

  • Jr. Member
  • **
  • Posts: 46
  • Karma: 2
    • View Profile
Re: Workshop: How we create a „Virtual Feedback“ in VoxCommando
« Reply #6 on: November 14, 2013, 03:35:50 PM »
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.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Workshop: How we create a „Virtual Feedback“ in VoxCommando
« Reply #7 on: November 14, 2013, 04:35:09 PM »
You can also use variables, which will be lost when VC closes, or maps, which will be remembered.


jb5349

  • Jr. Member
  • **
  • Posts: 46
  • Karma: 2
    • View Profile
Re: Workshop: How we create a „Virtual Feedback“ in VoxCommando
« Reply #8 on: November 16, 2013, 12:25:06 PM »
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.