Alexa.ColorTemperatureController Interface 3
Implement the Alexa.ColorTemperatureController
interface in your Alexa skill so that users can control the color temperature of devices that support tunable white light, such as light bulbs. For more details about Smart Home skills, see Understand Smart Home Skills.
For the list of languages that the ColorTemperatureController
interface supports, see List of Alexa Interfaces and Supported Languages. For the definitions of the message properties, see Alexa Interface Message and Property Reference.
Utterances
The Alexa.ColorTemperatureController
interface uses the pre-built voice interaction model. The following examples show some user utterances:
Alexa, make the living room lights warmer.
Alexa, set the dining room lights cooler.
Alexa, set the dining room softer.
Alexa, make the living room light whiter.
Alexa, make the living room light warm white.
Alexa, set the kitchen to daylight.
Alexa, mache mein wohnzimmerlampen wärmer.
Alexa, mache mein esszimmerlampen kühler.
Alexa, schalte Schlafzimmerlicht auf warmes Weiß.
Alexa, rendi le mie luci del salone più calde.
Alexa, rendi le luci più fredde.
アレクサ、ダイニングルームをソフトな色にして。
アレクサ、リビングを暖かい色にして。
アレクサ、ダイニングルームを寒色系にして。
アレクサ、リビングの電気をもっと白っぽくして。
アレクサ、リビングを暖かい白色にして。
Alexa, pon mis luz del salón más cálidas.
Alexa, pon mis luz del comedor más frías.
After the user says one of these utterances, Alexa sends a corresponding directive to your skill.
Reportable properties
The Alexa.ColorTemperatureController
interface uses the colorTemperatureInKelvin
property as the primary property. You identify the properties that you support in your discovery response.
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 absolute Kelvin.
The following table lists the color temperature values that correspond to the user utterance. If an endpoint doesn't support a value that a user requests, set the endpoint to the nearest possible value.
Shade of white | Color temperature in absolute Kelvin |
---|---|
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
by using the standard discovery mechanism described in Alexa.Discovery.
Set retrievable
to true for all 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 a light that supports the Alexa.PowerController
, Alexa.ColorTemperatureController
, and Alexa.EndpointHealth
interfaces.
{
"event": {
"header": {
"namespace": "Alexa.Discovery",
"name": "Discover.Response",
"payloadVersion": "3",
"messageId": "Unique identifier, preferably a version 4 UUID"
},
"payload": {
"endpoints": [
{
"endpointId": "Unique ID of the endpoint",
"manufacturerName": "Manufacturer of the endpoint",
"description": "Description to be shown in the Alexa app",
"friendlyName": "Device name, displayed in the Alexa app",
"displayCategories": ["LIGHT"],
"additionalAttributes": {
"manufacturer": "Manufacturer of the endpoint",
"model" : "Model of the device",
"customIdentifier": "Optional custom identifier for the device"
},
"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
}
},
{
"type": "AlexaInterface",
"interface": "Alexa.EndpointHealth",
"version": "3.2",
"properties": {
"supported": [{
"name": "connectivity"
}],
"proactivelyReported": true,
"retrievable": true
}
},
{
"type": "AlexaInterface",
"interface": "Alexa",
"version": "3"
}
]
}
]
}
}
}
Directives
Alexa sends the following Alexa.ColorTemperatureController
interface directives to your skill.
SetColorTemperature directive
Support the SetColorTemperature
directive so that users can set the color temperature of an endpoint.
The following examples show user utterances:
Alexa, make the living room warm white.
Alexa, set the kitchen to daylight.
Alexa, schalte Schlafzimmerlicht auf warmes Weiß.
アレクサ、リビングを暖かい色にして
アレクサ、キッチンを昼白色にして
SetColorTemperature directive example
The following example shows a SetColorTemperature
directive that Alexa sends to your skill to set the temperature to 5500 degrees Kelvin.
{
"directive": {
"header": {
"namespace": "Alexa.ColorTemperatureController",
"name": "SetColorTemperature",
"messageId": "Unique version 4 UUID",
"correlationToken": "Opaque correlation token",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID",
"cookie": {}
},
"payload": {
"colorTemperatureInKelvin": 5500
}
}
}
SetColorTemperature directive parameters
Field | Description | Type |
---|---|---|
colorTemperatureinKelvin |
The color temperature in Kelvin degrees. | Integer |
SetColorTemperature response
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.
The following example shows a SetColorTemperature
response.
{
"event": {
"header": {
"namespace": "Alexa",
"name": "Response",
"messageId": "Unique identifier, preferably a version 4 UUID",
"correlationToken": "Opaque correlation token that matches the request",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID"
},
"payload": {}
},
"context": {
"properties": [{
"namespace": "Alexa.ColorTemperatureController",
"name": "colorTemperatureInKelvin",
"value": 5500,
"timeOfSample": "2020-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 500
},
{
"namespace": "Alexa.EndpointHealth",
"name": "connectivity",
"value": {
"value": "OK"
},
"timeOfSample": "2020-02-03T16:20:50Z",
"uncertaintyInMilliseconds": 0
}
]
}
}
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 can't 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 users can raise the color temperature of an endpoint. This directive doesn't 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 user utterances:
Alexa, set the dining room lights cooler.
Alexa, make the living room light whiter.
アレクサ、リビングの電気をもっと白っぽくして
IncreaseColorTemperature directive example
The following example shows a IncreaseColorTemperature
directive that Alexa sends to your skill.
{
"directive": {
"header": {
"namespace": "Alexa.ColorTemperatureController",
"name": "IncreaseColorTemperature",
"messageId": "Unique version 4 UUID",
"correlationToken": "Opaque correlation token",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID",
"cookie": {}
},
"payload": {}
}
}
IncreaseColorTemperature directive parameters
The IncreaseColorTemperature
directive doesn't define any payload parameters.
IncreaseColorTemperature response
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.
The following example shows a IncreaseColorTemperature
response indicating that the new color temperature is 7000 degrees Kelvin.
{
"event": {
"header": {
"namespace": "Alexa",
"name": "Response",
"messageId": "Unique identifier, preferably a version 4 UUID",
"correlationToken": "Opaque correlation token that matches the request",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 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 can't 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 users can lower the color temperature of an endpoint. This directive doesn't 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 user utterances:
Alexa, set the dining room softer.
Alexa, make the living room lights warmer.
アレクサ、リビングをもっと暖かい色にして
DecreaseColorTemperature directive example
The following example shows a DecreaseColorTemperature
directive that Alexa sends to your skill.
{
"directive": {
"header": {
"namespace": "Alexa.ColorTemperatureController",
"name": "DecreaseColorTemperature",
"messageId": "Unique version 4 UUID",
"correlationToken": "Opaque correlation token",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID",
"cookie": {}
},
"payload": {}
}
}
DecreaseColorTemperature directive parameters
The DecreaseColorTemperature
directive doesn't define any payload parameters.
DecreaseColorTemperature response
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.
The following example shows a DecreaseColorTemperature
response that indicates the new color temperature is 2200 degrees Kelvin.
{
"event": {
"header": {
"namespace": "Alexa",
"name": "Response",
"messageId": "Unique identifier, preferably a version 4 UUID",
"correlationToken": "Opaque correlation token that matches the request",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 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 can't 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 the retrievable properties in the context object. You identify your retrievable properties in your discovery response. For details about state reports, see Understand State and Change Reporting.
StateReport response example
{
"event": {
"header": {
"namespace": "Alexa",
"name": "StateReport",
"messageId": "Unique identifier, preferably a version 4 UUID",
"correlationToken": "Opaque correlation token that matches the request",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID"
},
"payload": {}
},
"context": {
"properties": [{
"namespace": "Alexa.ColorTemperatureController",
"name": "colorTemperatureInKelvin",
"value": 2200,
"timeOfSample": "2020-02-05T16:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.EndpointHealth",
"name": "connectivity",
"value": {
"value": "OK"
},
"timeOfSample": "2020-02-05T16:20:50Z",
"uncertaintyInMilliseconds": 100
}
]
}
}
Change reporting
You send a ChangeReport
event to report changes proactively in the state of an endpoint. You identify the properties that you proactively report in your discovery response. For details about change reports, see Understand State and Change 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": "Unique identifier, preferably a version 4 UUID",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID"
},
"payload": {
"change": {
"cause": {
"type": "PHYSICAL_INTERACTION"
},
"properties": [{
"namespace": "Alexa.ColorTemperatureController",
"name": "colorTemperatureInKelvin",
"value": 4000,
"timeOfSample": "2020-02-05T16:20:50.52Z",
"uncertaintyInMilliseconds": 0
}]
}
}
},
"context": {
"properties": [{
"namespace": "Alexa.EndpointHealth",
"name": "connectivity",
"value": {
"value": "OK"
},
"timeOfSample": "2020-02-05T16:20:50Z",
"uncertaintyInMilliseconds": 100
}]
}
}