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. After the user says one of these utterances, Alexa sends a corresponding directive to your skill.

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, stelle das Esszimmer weicher.
Alexa, mache das Wohnzimmerlicht weißer.
Alexa, schalte Schlafzimmerlicht auf warmes Weiß.
Alexa, stelle die Küche auf Tageslicht.

Alexa, rends la lumière plus chaude.
Alexa, règle les lumières moins chaudes.
Alexa, rends la salle à manger plus douce.
Alexa, rends le salon plus blanc.
Alexa, mets la lumière du salon en blanc chaud.
Alexa, règle la cuisine à lumière du jour.

Alexa, लिविंग रूम की रोशनी को गर्म करो।
Alexa, डाइनिंग रूम की लाइट को ठंडा करो।
Alexa, भोजन कक्ष को नरम करो।
Alexa, लिविंग रूम को हल्का सफेद बनाओ।
Alexa, लिविंग रूम को हल्का गर्म सफेद बनाएं।
Alexa, किचन को दिन की रोशनी में सेट करो।

Alexa, rendi più calde le luci del soggiorno.
Alexa, raffredda le luci della sala da pranzo.
Alexa, metti la sala da pranzo più morbida.
Alexa, rendi la luce del soggiorno più bianca.
Alexa, fai in modo che la luce del soggiorno sia di un bianco caldo.
Alexa, cambia la cucina in bianco diurno.

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

Alexa, coloque as luzes da sala mais quentes.
Alexa, ponha as luzes da sala mais quentes.
Alexa, coloque a sala de jantar mais fria.
Alexa, ponha a sala de jantar mais fria.
Alexa, coloque a sala de jantar mais suave.
Alexa, ponha a sala de jantar mais suave.
Alexa, coloque a luz da sala mais branca.
Alexa, ponha a luz da sala mais branca.
Alexa, coloque a luz da sala em branco quente.
Alexa, ponha a luz da sala em branco quente.
Alexa, coloque a cozinha em branco diurno.
Alexa, muda a cozinha para branco diurno.

Alexa, haz que las luces de la sala sean más cálidas.
Alexa, pon las luces del comedor más frías.
Alexa, pon la luz del comedor más suave.
Alexa, pon la luz del comedor más tenue.
Alexa, pon la luz de la sala más blanca.
Alexa, haz que la luz de la sala de estar sea blanca cálida.
Alexa, pon la cocina a luz del día.
Alexa, pon la luz de la cocina a modo día.

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.

To let Alexa know the health of your device, also implement the Alexa.EndpointHealth interface.

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.

Copied to clipboard.

{
  "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.1",
                "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ß.
Alexa, stelle die Küche auf Tageslicht.

Alexa, mets la lumière du salon en blanc chaud.
Alexa, règle la cuisine à lumière du jour.

Alexa, लिविंग रूम को हल्का गर्म सफेद बनाएं।
Alexa, किचन को दिन की रोशनी में सेट करो।

Alexa, fai in modo che la luce del soggiorno sia di un bianco caldo.
Alexa, cambia la cucina in bianco diurno.

アレクサ、リビングを暖かい色にして
アレクサ、キッチンを昼白色にして

Alexa, coloque a luz da sala em branco quente.
Alexa, ponha a luz da sala em branco quente.
Alexa, coloque a cozinha em branco diurno.
Alexa, muda a cozinha para branco diurno.

Alexa, haz que la luz de la sala de estar sea blanca cálida.
Alexa, pon la cocina a luz del día.
Alexa, pon la luz de la cocina a modo día.

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.

Copied to clipboard.

{
    "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.

Alexa, règle les lumières moins chaudes.
Alexa, rends le salon plus blanc.

Alexa, mache mein esszimmerlampen kühler.
Alexa, mache das Wohnzimmerlicht weißer.

Alexa, डाइनिंग रूम की लाइट को ठंडा करो।
Alexa, लिविंग रूम को हल्का सफेद बनाओ।

Alexa, raffredda le luci della sala da pranzo.
Alexa, rendi la luce del soggiorno più bianca.

アレクサ、リビングを暖かい色にして。
アレクサ、リビングの電気をもっと白っぽくして

Alexa, coloque a sala de jantar mais fria.
Alexa, ponha a sala de jantar mais fria.
Alexa, coloque a luz da sala mais branca.
Alexa, ponha a luz da sala mais branca.

Alexa, pon las luces del comedor más frías.
Alexa, pon la luz de la sala más blanca.

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.

Copied to clipboard.

{
  "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.

Alexa, rends la salle à manger plus douce.
Alexa, rends la lumière plus chaude.

Alexa, stelle das Esszimmer weicher.
Alexa, mache mein wohnzimmerlampen wärmer.

Alexa, भोजन कक्ष को नरम करो।
Alexa, लिविंग रूम की रोशनी को गर्म करो।

Alexa, metti la sala da pranzo più morbida.
Alexa, rendi più calde le luci del soggiorno.

アレクサ、ダイニングルームをソフトな色にして。
アレクサ、リビングをもっと暖かい色にして

Alexa, coloque a sala de jantar mais suave.
Alexa, ponha a sala de jantar mais suave.
Alexa, coloque as luzes da sala mais quentes.
Alexa, ponha as luzes da sala mais quentes.

Alexa, pon la luz del comedor más suave.
Alexa, pon la luz del comedor más tenue.
Alexa, haz que las luces de la sala sean más cálidas.

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.

Copied to clipboard.

{
  "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

Copied to clipboard.

{
    "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

Copied to clipboard.

{
    "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
        }]
    }
}

Was this page helpful?

Last updated: Jan 16, 2024