Author Topic: Sequential commands  (Read 2008 times)

0 Members and 1 Guest are viewing this topic.

OklahomaGreyBeard

  • Contributor
  • ***
  • Posts: 54
  • Karma: 3
    • View Profile
Sequential commands
« 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.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Sequential commands
« Reply #1 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.
« Last Edit: May 02, 2015, 08:42:02 AM by Kalle »
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Sequential commands
« Reply #2 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