Smart Home AppSelector Trait Schema

action.devices.traits.AppSelector - This trait is used for devices which are able to switch inputs.

Device ATTRIBUTES

Devices with this trait may report the following attributes as part of the SYNC operation. To learn more about handling SYNC intents, see Intent fulfillment.

Attributes Type Description
availableApplications Array

Required.

A list of applications. Each application has one or more synonyms in each supported language. The first synonym is used in the response.

[item, ...] Object

Application that users of this device can interact with.

key String

Required.

Unique key for the application which is not exposed to users in speech or response.

names Array

Required.

Name of each application and its language-specific synonyms.

[item, ...] Object

Application synonyms.

name_synonym Array

Required.

User-friendly synonyms for the application name for a given language. The first synonym is used in the response.

[item, ...] String

Application name.

lang String

Required.

Language code.

Examples

Device with YouTube app

{
  "availableApplications": [
    {
      "key": "youtube",
      "names": [
        {
          "name_synonym": [
            "youtube",
            "YouTube US"
          ],
          "lang": "en"
        },
        {
          "name_synonym": [
            "youtube",
            "YouTube DE"
          ],
          "lang": "de"
        }
      ]
    }
  ]
}

Device STATES

Devices with this trait may report the following states as part of the QUERY operation. To learn more about handling QUERY intents, see Intent fulfillment.

States Type Description
currentApplication String

Required.

Key value of the current application that is active in the foreground.

Examples

Device with YouTube app currently active on foreground.

{
  "currentApplication": "youtube"
}

Device COMMANDS

Devices with this trait may respond to the following commands as part of the EXECUTE operation. To learn more about handling EXECUTE intents, see Intent fulfillment.

action.devices.commands.appInstall

Install the given application.

Parameters

Parameters Type Description
newApplication String

Key of the application to install.

newApplicationName String

Name of the application to install.

Examples

Install YouTube app by key

{
  "command": "action.devices.commands.appInstall",
  "params": {
    "newApplication": "youtube"
  }
}

Install YouTube app by name

{
  "command": "action.devices.commands.appInstall",
  "params": {
    "newApplicationName": "YouTube US"
  }
}

action.devices.commands.appSearch

Search for the given application.

Parameters

Parameters Type Description
newApplication String

Key of the application to search for.

newApplicationName String

Name of the application to search for.

Examples

Search for YouTube app by key

{
  "command": "action.devices.commands.appSearch",
  "params": {
    "newApplication": "youtube"
  }
}

Search for YouTube app by name

{
  "command": "action.devices.commands.appSearch",
  "params": {
    "newApplicationName": "YouTube US"
  }
}

action.devices.commands.appSelect

Select the given application.

Parameters

Parameters Type Description
newApplication String

Key of the application to select.

newApplicationName String

Name of the application to select.

Examples

Select YouTube app by key

{
  "command": "action.devices.commands.appSelect",
  "params": {
    "newApplication": "youtube"
  }
}

Select YouTube app by name

{
  "command": "action.devices.commands.appSelect",
  "params": {
    "newApplicationName": "YouTube US"
  }
}

Device ERRORS

See the full list of errors and exceptions.
  • noAvailableApp: The application doesn’t exist or is not available.
  • appLaunchFailed: The application failed to launch.
  • alreadyInstalledApp: The application was already installed.