Maps
Maps are used to store and retrieve key-value pairs. They are a convenient way to store and access more complex values that can be used within commands. This can be extremely useful for values such as IR codes, device IDs, and API keys.
Map tables are really just sql data tables with two columns. Unlike user variables, values stored in map tables are non-volatile, meaning that they will not lose their value when VoxCommando is closed, and then restarted.
Contents
Map Editor
Using the map editor, we can view and edit maps directly, delete maps and create new maps.
Accessing the Map Editor
The map editor can be accessed two ways.
- From the Main VoxCommando window by clicking: File >> Open Map Editor
- From the LCB when editing a command, by clicking the "Open Map" button.
You can select any existing map using the "Map Table" dropdown list on the right.
Actions
There are several core actions for modifying and reading maps and their values within commands.
- Map.CreateTable
- Map.DropTable
- Map.ExportPayloadXML
- Map.Get
- Map.GetKey
- Map.Set
- Map.Query
You can also directly store matches acquired from previous actions in a command to a map using the action Results.MatchToMap.
Map Variables
Once stored in a map, individual map values can be accessed as needed within our commands.
Within the LCB, we can open the map of interest, find the value we are looking for, and simply drag and drop the value into our actions where needed. (See the videos listed below for demonstrations.)
When dragged into an action, the map value is displayed as a variable of the form: {M:mapName.keyName}.
You could also manually type the name of the map variable in the action parameter field; however, the drag and drop method ensures the variable name will be accurate.
Video tutorials and demos
The following videos are the best way to familiarize yourself with VC's map functions.
- Introduction to Maps
- Voice Control Vera Home Automation (2nd half)
- Fastest way to learn IR codes from your remotes with USB-UIRT, and the related tutorial:
- VoxCommando Tutorial - Learning IR Codes with USB-UUIRT device and voice commands
- Learn IR codes from your remotes with Global Caché iTach Wifi2IR