Home > Alexa > Alexa Skills Kit

Alexa.PowerController Interface

intro

The PowerController interface describes the messages used to control and report on the power state of a device.

Directives

The following table shows the directive support depending on the type of skill you are implementing.

Directive Skill Type
TurnOn Smart Home

TurnOn

Request to turn on an endpoint.

“Alexa, turn on the TV”

Example Request:

{
  "directive": {
    "header": {
      "namespace": "Alexa.PowerController",
      "name": "TurnOn",
      "payloadVersion": "3",
      "messageId": "1bd5d003-31b9-476f-ad03-71d471922820"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "some-access-token"
      }
      },
      "endpointId": "appliance-001",
      "cookie": {}
    },
    "payload": {}
  }
}

Payload Details

Field Description Type Required
None No required or optional fields in the payload. N/A N/A

TurnOff

Request to turn off an endpoint.

“Alexa, turn off the TV”

Example Request:

{
  "directive": {
    "header": {
      "namespace": "Alexa.PowerController",
      "name": "TurnOff",
      "payloadVersion": "3",
      "messageId": "1bd5d003-31b9-476f-ad03-71d471922820"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "some-access-token"
      },
      "endpointId": "appliance-001",
      "cookie": {}
    },
    "payload": {}
  }
}

Payload Details

Field Description Type Required
None No required or optional fields in the payload. N/A N/A

Properties and Events

Reportable Properties

When the power state changes, send a state report with a powerState property.

Property Name Property Type Description
powerState PowerState Indicates the whether the devices is powered on or off. Valid values are “ON” and “OFF”.

Alexa.Response Event

Send an Alexa.Response event when a power on or power off request successfully completes.

Alexa.Response example for a TurnOn request

{
  "context": {
    "properties": [ {
      "namespace": "Alexa.PowerController",
      "name": "powerState",
      "value": "ON",
      "timeOfSample": "2017-02-03T16:20:50.52Z",
      "uncertaintyInMilliseconds": 500
    } ]
  },
  "event": {
    "header": {
      "namespace": "Alexa",
      "name": "Response",
      "payloadVersion": "3",
      "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4"
    },
    "payload": {}
  }
}

Alexa.Response example for a TurnOff request

{
  "context": {
    "properties": [ {
      "namespace": "Alexa.PowerController",
      "name": "powerState",
      "value": "OFF",
      "timeOfSample": "2017-02-03T16:20:50.52Z",
      "uncertaintyInMilliseconds": 500
    } ]
  },
  "event": {
    "header": {
      "namespace": "Alexa",
      "name": "Response",
      "payloadVersion": "3",
      "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    },
    "payload": {}
  }
}