Join us online for the Google Smart Home Developer Summit on October 21st! Register here to learn what's new, and what's coming up for Google Smart Home.

Smart Home TransportControl Trait Schema

action.devices.traits.TransportControl - This trait is used for devices which are able to control media playback (for example, resuming music while it is paused).

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
transportControlSupportedCommands Array

Required.

A list of strings describing supported transport control commands on this device.

[item, ...] String

Supported commands.

Supported values:

CAPTION_CONTROL
NEXT
PAUSE
PREVIOUS
RESUME
SEEK_RELATIVE
SEEK_TO_POSITION
SET_REPEAT
SHUFFLE
STOP

Examples

Device supporting playback commands

{
  "transportControlSupportedCommands": [
    "NEXT",
    "PREVIOUS",
    "PAUSE",
    "STOP",
    "RESUME"
  ]
}

Device STATES

None.

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.mediaStop

Pause media playback.

This command requires the following attributes:
{
  "transportControlSupportedCommands": [
    "STOP"
  ]
}

Parameters

Parameters Type Description

No properties

Examples

No parameters

{
  "command": "action.devices.commands.mediaStop",
  "params": {}
}

action.devices.commands.mediaNext

Skip to next media item.

This command requires the following attributes:
{
  "transportControlSupportedCommands": [
    "NEXT"
  ]
}

Parameters

Parameters Type Description

No properties

Examples

No parameters

{
  "command": "action.devices.commands.mediaNext",
  "params": {}
}

action.devices.commands.mediaPrevious

Skip to previous media item.

This command requires the following attributes:
{
  "transportControlSupportedCommands": [
    "PREVIOUS"
  ]
}

Parameters

Parameters Type Description

No properties

Examples

No parameters

{
  "command": "action.devices.commands.mediaPrevious",
  "params": {}
}

action.devices.commands.mediaPause

Pause media playback.

This command requires the following attributes:
{
  "transportControlSupportedCommands": [
    "PAUSE"
  ]
}

Parameters

Parameters Type Description

No properties

Examples

No parameters

{
  "command": "action.devices.commands.mediaPause",
  "params": {}
}

action.devices.commands.mediaResume

Resume media playback.

This command requires the following attributes:
{
  "transportControlSupportedCommands": [
    "RESUME"
  ]
}

Parameters

Parameters Type Description

No properties

Examples

No parameters

{
  "command": "action.devices.commands.mediaResume",
  "params": {}
}

action.devices.commands.mediaSeekRelative

Seek to a relative position.

This command requires the following attributes:
{
  "transportControlSupportedCommands": [
    "SEEK_RELATIVE"
  ]
}

Parameters

Parameters Type Description
relativePositionMs Integer

Required.

Milliseconds of the forward (positive int) or backward (negative int) amount to seek.

Examples

Seek 10s forward

{
  "command": "action.devices.commands.mediaSeekRelative",
  "params": {
    "relativePositionMs": 10000
  }
}

Seek 10s backward

{
  "command": "action.devices.commands.mediaSeekRelative",
  "params": {
    "relativePositionMs": -10000
  }
}

action.devices.commands.mediaSeekToPosition

Seek to an absolute position.

This command requires the following attributes:
{
  "transportControlSupportedCommands": [
    "SEEK_TO_POSITION"
  ]
}

Parameters

Parameters Type Description
absPositionMs Integer

Required.

Millisecond of the absolute position to seek to.

Examples

Seek to 30s

{
  "command": "action.devices.commands.mediaSeekToPosition",
  "params": {
    "absPositionMs": 30000
  }
}

action.devices.commands.mediaRepeatMode

Set repeat playback mode.

This command requires the following attributes:
{
  "transportControlSupportedCommands": [
    "SET_REPEAT"
  ]
}

Parameters

Parameters Type Description
isOn Boolean

Required.

True to turn on repeat mode, false to turn off repeat mode.

isSingle Boolean

(Default: false)

If specified, true means turning on single-item repeat mode, false means turning on normal repeat mode (for example a playlist).

Examples

Repeat on

{
  "command": "action.devices.commands.mediaRepeatMode",
  "params": {
    "isOn": true
  }
}

Repeat off

{
  "command": "action.devices.commands.mediaRepeatMode",
  "params": {
    "isOn": false
  }
}

Repeat a single track

{
  "command": "action.devices.commands.mediaRepeatMode",
  "params": {
    "isOn": true,
    "isSingle": true
  }
}

action.devices.commands.mediaShuffle

Shuffle the current playlist.

This command requires the following attributes:
{
  "transportControlSupportedCommands": [
    "SHUFFLE"
  ]
}

Parameters

Parameters Type Description

No properties

Examples

No parameters

{
  "command": "action.devices.commands.mediaShuffle",
  "params": {}
}

action.devices.commands.mediaClosedCaptioningOn

Turn captions on.

This command requires the following attributes:
{
  "transportControlSupportedCommands": [
    "CAPTION_CONTROL"
  ]
}

Parameters

Parameters Type Description
closedCaptioningLanguage String

Language or locale for closed captioning.

userQueryLanguage String

Language or locale for user query.

Examples

Turn on closed captioning in English

{
  "command": "action.devices.commands.mediaClosedCaptioningOn",
  "params": {
    "closedCaptioningLanguage": "en"
  }
}

Turn on closed captioning in Korean

{
  "command": "action.devices.commands.mediaClosedCaptioningOn",
  "params": {
    "closedCaptioningLanguage": "ko-KR"
  }
}

Turn on closed captioning in Korean with user query in American English

{
  "command": "action.devices.commands.mediaClosedCaptioningOn",
  "params": {
    "closedCaptioningLanguage": "ko-KR",
    "userQueryLanguage": "en-US"
  }
}

action.devices.commands.mediaClosedCaptioningOff

Turn captions off.

This command requires the following attributes:
{
  "transportControlSupportedCommands": [
    "CAPTION_CONTROL"
  ]
}

Parameters

Parameters Type Description

No properties

Examples

Turn off closed captioning

{
  "command": "action.devices.commands.mediaClosedCaptioningOff",
  "params": {}
}

Device ERRORS

See the full list of errors and exceptions.