VoxCommando

Help and Support (Using VoxCommando) => Command Builder Reference => Topic started by: OklahomaGreyBeard on May 02, 2015, 01:46:40 AM

Title: Sequential commands
Post by: OklahomaGreyBeard on May 02, 2015, 01:46:40 AM
Maybe it's because it's late and I just can't get it straight in my head but I can't figure out the flow of this or how to do it.

I have 90% of the lights in my house made up of either hue or link bulbs all controlled through the hue hub. All the built in commands from the plugin as well as most of the ones I've created work great. My question though revolves around more natural speaking.

I have three groups of lights in the living room. "The Entertainment Wall" "The Living Room Ambient " "The Living Room" Right now I have two commands "Turn the {1} lights on/off" "Set the {1} lights to {2} percent"

I think I'm going to create a third that joins them together "Turn the {1} lights on and set them to {2} percent"

However if I say turn the x lights on and then after a few seconds realize their either too bright or dark, just say "set them to x percent,it's still too dark, it's too bright" and it still know which lights I mean. yet after a minute passes those commands don't work without specifying which lights I'm talking about again.
Title: Re: Sequential commands
Post by: Kalle on May 02, 2015, 03:04:17 AM
You can use a maptable - as example:


1. Create a maptable and name it last_used or what ever you want - you can let do this VC automatically by insert as first action (in your command where you specify which light you turn on) - Map.CreateTable with parameter last_used



2. Insert a Map.Set action in the same command with following parameter.


Map.Set: last_used as maptable name / hue device as key  / {1} as value (I think {1} is the ID for the hue device)


This action create a maptable and store the last result from {1} as last used device in the value row.


Now you can use this value in your "set them to x percent, it's still too bright" command, while insert a query from the created maptable {M:last_used.hue device} instead of the ID in the Hue.Light action.


I can not try this command, because I have no Hue  ::)  but I hope this will help you.
Title: Re: Sequential commands
Post by: jitterjames on May 02, 2015, 08:38:02 AM
I'd just like to mention that you can also use variables for this.  Map tables will work of course but since you dont need to remember these values permanently a variable will do just fine to remember which hue ID you used last.

See:
http://voxcommando.com/forum/index.php?topic=2144.msg18581#msg18581