Natural Language Types (Called Entities on API.AI)

Your commands can have variables, and each variable has a type
For example, in a voice command like
living room can be a variable of the type light
You can create the light type and give it multiple options. For example:
If you want, each item can have synonyms so that any of those values will work. For example:
You can then create commands using this type. For example:
Here you use the $light type as a placeholder so that any of the types of lights can apply there.
After creating this type and command you'll be able to say any of these
and the same natural language command will always be triggered and the light variable will have a different room name in each case.

Reference Mode

You can define types in 2 ways: Synonym mode and Reference mode
To toggle between these, touch a type in the list and select Toggle Reference Mode
With the default Synonym mode you simply define a base value and a list of synonyms for each item like shown above
With Reference mode you can reference other types and create Composite Types.
For example, if you create a type called light-state it could have these entries:
  1. @light:light light @state:state
  2. @state:state my @light:light
  3. @state:state the @light:light
You can then create commands using this type. For example:
After creating this type and command you'll be able to say any of these
  1. Turn bath room light on
  2. Turn on my living room light
  3. Turn off the small room light
Notice how the commands here match the patters above.
For example @state:state my @light:light means that you want a state (on or off), followed by the word "my", followed by the name of a light. This matches the command "Turn on my living room light"
Full tutorial for this example here.

Composite Types in Tasker

When you receive a command that uses a composite type in Tasker, the variable will be a JSON string containing the values. You can then read these using AutoTools JSON Read
For example, if you receive a light-state variable in Tasker you would get something like
{"light":"bath room","state":"on"}
As you can see the same variable contains both the name of the light and the state.
Again full tutorial for this example here.

Examples

Create a Natural Language Voice Command
Control multiple devices with one voice command using natural language
Play Movies or TV Shows in Kodi with Natural Language commands using custom Types