Custom commands integrated with Tasker allow to merge the infinite possibilities of Tasker with the powerful voice recognition handling of KLets, giving you the ability to create commands to perform almost everything (from taking a photo, to change the color of the light in a room using a wireless Arduino).
A custom command allows to define which Tasker's task to execute, which variables must be set on it and by which voice commands it is triggered.
In order to use them at their full power, you need to firstly understand how Tasker variables work reading its Online Guide.
In order to start a command, you need to define by which phrases it can be triggered, and those phrases are called “Activation phrases”. A command can have one or more activation phrases, and KLets will start it when your command match one of these activation phrases.
A variable, in KLets, is a portion of an “activation phrase” that can change when it is said, or it is an information that can be said separately from the activation phrase itself.
Each activation phrase can have any number of variables. Also, if a variable is needed to execute a command and it is missing from the said activation phrase, KLets can be configured to ask for it.
Values that can be said for a variable depends on its “Type”: it can be a number, a contact name, a contact phone, a phone number, a song name etc, and it can be specified while defining the variable (it is needed because KLets must exactly know which values are allowed for a variable in order to correctly handle voice recognition inaccuracies).
KLets variables can be used from a Tasker's task by their names in lowercase prefixed by a percent. For example, if a variable in KLets is named “SECONDS_TO_WAIT”, it can be used from a task with the name “%seconds_to_wait”. Complex variables like contacts or audio entries are sent to Tasker separated in more variables, each one prefixed with the variable name and with appended information name. Plase check the table below in order to know how complex types they are translated.
Other variable types can return multiple values, like contact name or audio entries variables. KLets can manage these variables in order to sent to Tasker only a single value, asking for which one to send, or it can send all results to Tasker. You can choose how to handle them selected the variable type ending with “(single value)” or “(multiple values)”. Multiple values are sent to Tasker as array variables.
Currently KLets allows to use the following types:
Type | Accepted values | KLets variable name example | Converted Tasker variables examples | Description |
---|---|---|---|---|
Numeric | Only numeric values | SECONDS_TO_WAIT | %seconds_to_wait | It will contains only digits like “11”, “120” etc. |
Phone number | Any value compatible with a phone number | NUMBER_TO_CALL | %number_to_call | It will contain a phone number, like “+012345#78*9” |
Free text | Any value | SOME_FREE_TEXT | %some_free_text | It will contain a textual value like “message to sent to tasker” |
Free text (without confirmation) | Any value. KLets will not asks for a confirmation | SOME_FREE_TEXT | %some_free_text | It will contain a textual value like “message to sent to tasker”, |
Tasker's task name | A Tasker's task name | TASK_NAME | %task_name | It will contain an existing Tasker's task name |
Time only (relative or absolute) | A time value, like “at 11 and 20 minutes”, “in 70 minutes” and so on | TIME_VALUE | %time_value | It will contain a text with the nearest future date matching the given time, formatted like “25/04/2013 22:55:58” |
Date with optional absolute time | A date with an optional time, like “12 December 2013”, “tomorrow at 12” and so on | DATE_VALUE | %date_value | It will contain a text with the date said, formatted like “25/04/2013 22:55:58” |
Application | A name of a launcher icon | APP_TO_LAUNCH | %app_to_launch_name | Will contain the name of the launcher icon for the application |
%app_to_launch_package_name | Will contain the android package name | |||
%app_to_launch_component_name | Will contain the component name to use to launch the icon | |||
Audio - Generic media | A name of a playlist, an artist, a song or an album. Can be enforced to a specific media type using one of the other type which name starts with “Audio - ” | MEDIA_VAR | %media_var_name | Will contain the name of the matched audio entry |
Audio - Artist name | Only a name of an artist | %media_var_type | Will contain the type of matched entry. It can be “ALBUM”, “ARTIST”, “SONG” or “PLAYLIST” | |
Audio - Song name | Only a name of a song | %media_var_source | Will contain the source of the media info. It can me “STANDARD” or “POWERAMP”. | |
Audio - Album name | Only a name of an album | %media_var_media_id | Will contain the standard Android media ID when the source is “STANDARD”, otherwise it will contains the Poweramp internal ID. | |
Audio - Playlist name | Only a name of a playlist | %media_var_google_music_3_id | Will contain the Google Music v3 internal id only when the source is “STANDARD” and Google Music v3 is installed. | |
Contact | A name of a contact saved inside the cotact list | CONTACT | %contact_name | The name displayed inside the contact list for the contact |
%contact_contact_id | The internal Android id for the contact | |||
Contact - Phone number | A name of a contact number. It can be only the contact name, or the name with the number label | CONTACT_PHONE | %contact_phone_name | The name displayed inside the contact list for the contact |
%contact_phone_contact_id | The internal Android id for the contact | |||
%contact_phone_label | The label for the contact phone number as displayed inside the contact list | |||
%contact_phone_number | The phone number | |||
Contact - Email address | A name of a contact email. It can be only the contact name, or the name with the email label | CONTACT_EMAIL | %contact_email_name | The name displayed inside the contact list for the contact |
%contact_email_contact_id | The internal Android id for the contact | |||
%contact_email_label | The label for the contact email as displayed inside the contact list | |||
%contact_email_mail | The email address | |||
Contact - Location address | A name of a contact location. It can be only the contact name, or the name with the location label | CONTACT_LOCATION | %contact_location_name | The name displayed inside the contact list for the contact |
%contact_location_contact_id | The internal Android id for the contact | |||
%contact_location_label | The label for the contact address as displayed inside the contact list | |||
%contact_location_address | The contact's location address | |||
Contact - Skype account | A name of a skype account. | CONTACT_SKYPE | %contact_skype_name | The name displayed inside the contact list for the contact |
%contact_skype_contact_id | The internal Android id for the contact | |||
%contact_skype_skype | The skype account name |
This is an example showing how to create a command that take a photo with the rear camera through Tasker, with an optional delay in seconds.
In this example, we will create the Tasker's task that takes the photo, and that will handle a delay in accord to a local variable value if it is set. Then, we will create the custom command in KLets, defining the Tasker's task to execute, the variable to use to handle the seconds for the delay, and two activation phrases to trigger the command (one without the variable and one with the variable for the delay).
That's it. Now, every time you will say a command to KLets, it will try to compare what you said to every activation phrase defined for the custom command just created.
So, when you will say “take a photo”, KLets will trigger the task “Photo”, and because the phrase “take a photo” matched the one that doesn't contain the KLets variable “SECONDS”, KLest will not set the “%seconds” variable on the task (and this will prevent the “wait” action of the task to be executed in accord to the “if” condition configured on it).
Instead, when you will say “take a photo in 4 seconds” or “take a photo in 20 seconds”, KLets will still trigger the task “Photo” but will also set the variable “%seconds” to “4” or “20” (depending on what you said), because the phrase matched the one that contains the KLets variable “SECONDS”.