Alexa.ColorTemperatureController Interface

The Alexa.ColorTemperatureController capability interface describes the messages used to control the color temperature of an endpoint that supports tunable white light.

For the list of locales that are supported for the ColorTemperatureController interface, see List of Capability Interfaces and Supported Locales.

Utterances

When you use the Alexa.ColorTemperatureController interface, the voice interaction model is already built for you. The following examples show some customer utterances:

Alexa, set the dining room softer.
Alexa, make the living room warmer.
Alexa, set the dining room cooler.
Alexa, make the living room light whiter.
Alexa, make the living room warm white.
Alexa, set the kitchen to daylight.

アレクサ、ダイニングルームをソフトな色にして。
アレクサ、リビングを暖かい色にして。
アレクサ、ダイニングルームを寒色系にして。
アレクサ、リビングの電気をもっと白っぽくして。
アレクサ、リビングを暖かい白色にして。

After the customer says one of these utterances, Alexa sends a corresponding directive to your skill.

Properties

The colorTemperatureInKelvin property

The Alexa.ColorTemperatureController interface uses the colorTemperatureInKelvin property as the primary property. The colorTemperatureInKelvin property represents the color temperature in degrees Kelvin of an endpoint, and is used by endpoints that support tunable white light. Valid values range from 1,000 to 10,000 inclusive.

The following table lists some color temperature values. If an endpoint does not support a value that a customer requests, we recommend that you set the endpoint to the nearest possible value.

Shade of White Color Temperature in Kelvin Value
warm, warm white 2200
incandescent, soft white 2700
white 4000
daylight, daylight white 5500
cool, cool white 7000

Discovery

You describe endpoints that support Alexa.ColorTemperatureController using the standard discovery mechanism described in Alexa.Discovery.

Set retrievable to true for all of the interfaces and properties that you report when Alexa sends your skill a state report request. Set proactivelyReported to true for interfaces and properties that you proactively report to Alexa in a change report.

For the full list of display categories, see display categories.

Discover response example

The following example shows a Discover.Response message for an endpoint that supports the Alexa.PowerController and Alexa.ColorTemperatureController interfaces.

{
  "event": {
    "header": {
      "namespace": "Alexa.Discovery",
      "name": "Discover.Response",
      "payloadVersion": "3",
      "messageId": "<message id>"
    },
    "payload": {
      "endpoints":[
        {
          "endpointId": "<unique ID of the endpoint>",
          "manufacturerName": "<the manufacturer name of the endpoint>",
          "modelName": "<the model name of the endpoint>",
          "description": "<a description that is shown in the Alexa app>",
          "friendlyName": "<device name, displayed in the Alexa app>",
          "displayCategories": ["LIGHT"],
          "cookie": {},
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.PowerController",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "powerState"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.ColorTemperatureController",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "colorTemperatureInKelvin"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              }
            }
          ]
        }
      ]
    }
  }
}

Directives

SetColorTemperature directive

Support the SetColorTemperature directive so that customers can set the color temperature of an endpoint.

The following examples show customer utterances:

Alexa, make the living room warm white.
Alexa, set the kitchen to daylight.

Alexa, schalte Schlafzimmerlicht auf warmes Weiß.

SetColorTemperature directive payload details

Field Description Type
colorTemperatureinKelvin The color temperature in Kelvin degrees. Integer

SetColorTemperature directive example


{
  "directive": {
    "header": {
      "namespace": "Alexa.ColorTemperatureController",
      "name": "SetColorTemperature",
      "messageId": "<message id>",
      "correlationToken": "<an opaque correlation token>",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "<an OAuth2 bearer token>"
      },
      "endpointId": "<endpoint id>",
      "cookie": {}
    },
    "payload": {
      "colorTemperatureInKelvin": 5500
    }
  }
}

SetColorTemperature response event

If you handle a SetColorTemperature directive successfully, respond with an Alexa.Response event. In the context object, include the values of all properties that changed. You can respond synchronously or asynchronously. If you respond asynchronously, include a correlation token and a scope with an authorization token.

SetColorTemperature response event example

{
  "event": {
    "header": {
      "namespace": "Alexa",
      "name": "Response",
      "messageId": "<message id>",
      "correlationToken": "<an opaque correlation token>",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "<an OAuth2 bearer token>"
      },
      "endpointId": "<endpoint id>"
    },
    "payload": {}
  },
  "context": {
    "properties": [
      {
        "namespace": "Alexa.ColorTemperatureController",
        "name": "colorTemperatureInKelvin",
        "value": 5500,
        "timeOfSample": "2017-02-03T16:20:50.52Z",
        "uncertaintyInMilliseconds": 500
      }
    ]
  }
}

SetColorTemperature directive error handling

If you can't handle an SetColorTemperature directive successfully, respond with an Alexa.ErrorResponse event. Use the NOT_SUPPORTED_IN_CURRENT_MODE error type if the device is in a mode in which it cannot be controlled with a color temperature directive. For example, if a light is set to an HSB color, return an error, and Alexa responds to the user with "That only works when your light is set to a shade of white."

IncreaseColorTemperature directive

Support the IncreaseColorTemperature directive so that customers can raise the color temperature of an endpoint. This directive does not specify a specific value, but asks for a cooler or whiter setting relative to the current device setting. You can choose how much to adjust the setting of the device. If you can't increment the setting further, set the device to the maximum color temperature.

The following examples show customer utterances:

Alexa, set the dining room cooler.
Alexa, make the living room light whiter.

IncreaseColorTemperature directive example

{
  "directive": {
    "header": {
      "namespace": "Alexa.ColorTemperatureController",
      "name": "IncreaseColorTemperature",
      "messageId": "<message id>",
      "correlationToken": "<an opaque correlation token>",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "<an OAuth2 bearer token>"
      },
      "endpointId": "<endpoint id>",
      "cookie": {}
    },
    "payload": {}
  }
}

IncreaseColorTemperature response event

If you handle a IncreaseColorTemperature directive successfully, respond with an Alexa.Response event. In the context object, include the values of all properties that changed. You can respond synchronously or asynchronously. If you respond asynchronously, include a correlation token and a scope with an authorization token.

IncreaseColorTemperature response event example

{
  "event": {
    "header": {
      "namespace": "Alexa",
      "name": "Response",
      "messageId": "<message id>",
      "correlationToken": "<an opaque correlation token>",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "<an OAuth2 bearer token>"
      },
      "endpointId": "<endpoint id>"
    },
    "payload": {}
  },
  "context": {
    "properties": [
      {
        "namespace": "Alexa.ColorTemperatureController",
        "name": "colorTemperatureInKelvin",
        "value": 7000,
        "timeOfSample": "2018-02-05T16:20:50.52Z",
        "uncertaintyInMilliseconds": 500
      }
    ]
  }
}

IncreaseColorTemperature directive error handling

If you can't handle an IncreaseColorTemperature directive successfully, respond with an Alexa.ErrorResponse event. Use the NOT_SUPPORTED_IN_CURRENT_MODE error type if the device is in a mode in which it cannot be controlled with a color temperature directive. For example, if a light is set to an HSB color, return an error, and Alexa responds to the user with "That only works when your light is set to a shade of white."

DecreaseColorTemperature directive

Support the DecreaseColorTemperature directive so that customers can lower the color temperature of an endpoint. This directive does not specify a specific value, but asks for a warmer or softer setting relative to the current device setting. You can choose how much to adjust the setting of the device. If you can't increment the setting further, set the device to the minimum color temperature.

The following examples show customer utterances:

Alexa, set the dining room softer.
Alexa, make the living room warmer.

DecreaseColorTemperature directive example

{
  "directive": {
    "header": {
      "namespace": "Alexa.ColorTemperatureController",
      "name": "DecreaseColorTemperature",
      "messageId": "<message id>",
      "correlationToken": "<an opaque correlation token>",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "<an OAuth2 bearer token>"
      },
      "endpointId": "<endpoint id>",
      "cookie": {}
    },
    "payload": {}
  }
}

DecreaseColorTemperature response event

If you handle a DecreaseColorTemperature directive successfully, respond with an Alexa.Response event. In the context object, include the values of all properties that changed. You can respond synchronously or asynchronously. If you respond asynchronously, include a correlation token and a scope with an authorization token.

DecreaseColorTemperature response event example

{
  "event": {
    "header": {
      "namespace": "Alexa",
      "name": "Response",
      "messageId": "<message id>",
      "correlationToken": "<an opaque correlation token>",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "<an OAuth2 bearer token>"
      },
      "endpointId": "<endpoint id>"
    },
    "payload": {}
  },
  "context": {
    "properties": [
      {
        "namespace": "Alexa.ColorTemperatureController",
        "name": "colorTemperatureInKelvin",
        "value": 2200,
        "timeOfSample": "2019-02-05T16:20:50.52Z",
        "uncertaintyInMilliseconds": 500
      }
    ]
  }
}

DecreaseColorTemperature directive error handling

If you can't handle an DecreaseColorTemperature directive successfully, respond with an Alexa.ErrorResponse event. Use the NOT_SUPPORTED_IN_CURRENT_MODE error type if the device is in a mode in which it cannot be controlled with a color temperature directive. For example, if a light is set to an HSB color, return an error, and Alexa responds to the user with "That only works when your light is set to a shade of white."

State reporting

Alexa sends a ReportState directive to request information about the state of an endpoint. When Alexa sends a ReportState directive, you send a StateReport event in response. The response contains the current state of all of the retrievable properties in the context object. You identify your retrievable properties in your discovery response. For more information about state reports, see Understand State Reporting.

StateReport response event example

{
  "event": {
    "header": {
      "namespace": "Alexa",
      "name": "StateReport",
      "messageId": "<message id>",
      "correlationToken": "<an opaque correlation token>",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "<an OAuth2 bearer token>"
      },
      "endpointId": "<endpoint id>"
    },
    "payload": {}
  },
  "context": {
    "properties": [
      {
        "namespace": "Alexa.ColorTemperatureController",
        "name": "colorTemperatureInKelvin",
        "value": 2200,
        "timeOfSample": "2019-02-05T16:20:50.52Z",
        "uncertaintyInMilliseconds": 0
      }
    ]
  }
}

Change reporting

You send a ChangeReport event to proactively report changes in the state of an endpoint. You identify the properties that you proactively report in your discovery response. For more information about change reports, see Understand State Reporting.

For lighting endpoints that support both the ColorController and ColorTemperatureController interfaces, report the state of color when an endpoint is set to a color, and report the state of colorTemperatureInKelvin when an endpoint is set to a shade of white.

ChangeReport event example

{  
  "event": {
    "header": {
      "namespace": "Alexa",
      "name": "ChangeReport",
      "messageId": "<message id>",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "<an OAuth2 bearer token>"
      },
      "endpointId": "<endpoint id>"
    },
    "payload": {
      "change": {
        "cause": {
          "type": "PHYSICAL_INTERACTION"
        },
        "properties": [
          {
            "namespace": "Alexa.ColorTemperatureController",
            "name": "colorTemperatureInKelvin",
            "value": 4000,
            "timeOfSample": "2019-02-05T16:20:50.52Z",
            "uncertaintyInMilliseconds": 0
          }
        ]
      }
    }
  },
  "context": {}
}