Alexa.BrightnessController Interface

Implement the Alexa.BrightnessController interface in your Alexa skill so that users can control the brightness of devices, such as light bulbs. For more details about Smart Home skills, see Understand Smart Home Skills.

Use the Alexa.BrightnessController interface for devices that you know support brightness control instead of the more general Alexa.PercentageController interface. If you want to control the power level of an endpoint such as a dimmer switch, use the Alexa.PowerLevelController interface instead.

For the list of languages that the Alexa.BrightnessController 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.BrightnessController interface uses the pre-built voice interaction model. After the customer says one of the following utterances, Alexa sends a corresponding directive to your skill.

The following examples show some customer utterances:

Alexa, dim the bathroom light.
Alexa, set the bedroom light to fifty percent.

Alexa, diminue la lumière de la salle de bains
Alexa, mets la lumière de la chambre à cinquante pour cent

Alexa, dimme das Licht um fünfundzwanzig Prozent.
Alexa, stelle das Licht auf fünfzig Prozent.

アレクサ、浴室の照明を暗くして。
アレクサ、浴室の照明を50パーセントにして。

Reportable properties

The Alexa.BrightnessController interface uses the brightness property as the primary property. The property is an integer with valid values from 0 to 100 inclusive. If you use the brightness property to represent a change, valid values are from –100 to 100 inclusive.

Discovery

You describe endpoints that support Alexa.BrightnessController by 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 a light that supports the Alexa.BrightnessController and Alexa.ColorController 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": "Living Room Light",
                "displayCategories": ["LIGHT"],
                "additionalAttributes": {
                    "manufacturer": "Manufacturer of the endpoint",
                    "model": "Model of the device",
                    "serialNumber": "Serial number of the device",
                    "firmwareVersion": "Firmware version of the device",
                    "softwareVersion": "Software version of the device",
                    "customIdentifier": "Optional custom identifier for the device"
                },
                "cookie": {},
                "capabilities": [{
                        "type": "AlexaInterface",
                        "interface": "Alexa.BrightnessController",
                        "version": "3",
                        "properties": {
                            "supported": [{
                                "name": "brightness"
                            }],
                            "proactivelyReported": true,
                            "retrievable": true
                        }
                    },
                    {
                        "type": "AlexaInterface",
                        "interface": "Alexa.ColorController",
                        "version": "3",
                        "properties": {
                            "supported": [{
                                "name": "color"
                            }],
                            "proactivelyReported": true,
                            "retrievable": true
                        }
                    },
                    {
                        "type": "AlexaInterface",
                        "interface": "Alexa.EndpointHealth",
                        "version": "3",
                        "properties": {
                            "supported": [{
                                "name": "connectivity"
                            }],
                            "proactivelyReported": true,
                            "retrievable": true
                        }
                    },
                    {
                        "type": "AlexaInterface",
                        "interface": "Alexa",
                        "version": "3"
                    }
                ]
            }]
        }
    }
}

Directives

The Alexa.BrightnessController interface defines the following directives.

SetBrightness directive

Support the SetBrightness directive so that customers can set the brightness value of a device.

The following example shows a customer utterance:

Alexa, set the table light bulb to fifty percent.

Alexa, règle la lumière de la chambre à cinquante pour cent

Alexa, stelle das Licht auf fünfzig Prozent.

アレクサ、浴室の照明を50パーセントにして。

SetBrightness directive example

The following example shows a request to set the brightness to 50 percent.

{
    "directive": {
        "header": {
            "namespace": "Alexa.BrightnessController",
            "name": "SetBrightness",
            "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": {
            "brightness": 50
        }
    }
}

SetBrightness directive payload

The following table shows the payload details for the SetBrightness directive.

Property Description Type Required

brightness

Identifies the percentage brightness to set the device to.

Integer

Yes

SetBrightness response

If you handle a SetBrightness directive successfully, respond with an Alexa.Response event. Include the values of all properties that changed in the context object. 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 SetBrightness 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.BrightnessController",
            "name": "brightness",
            "value": 50,
            "timeOfSample": "2017-02-03T16:20:50.52Z",
            "uncertaintyInMilliseconds": 500
        }]
    }
}

SetBrightness directive error handling

If you can't handle a SetBrightness directive successfully, respond with an Alexa.ErrorResponse event.

AdjustBrightness directive

Support the AdjustBrightness directive so that customers can adjust the brightness value of a device.

The following example shows a customer utterance:

Alexa, dim table light bulb twenty five percent.

Alexa, baisse la lumière de la salle de bains

Alexa, dimme das Licht um fünfundzwanzig Prozent.

アレクサ、テーブルライトの電球を25パーセント暗くして。

AdjustBrightness directive example

The following example shows a request to adjust the brightness lower by 25 percent.

{
    "directive": {
        "header": {
            "namespace": "Alexa.BrightnessController",
            "name": "AdjustBrightness",
            "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": {
            "brightnessDelta": -25
        }
    }
}

AdjustBrightness directive payload

The following table shows the payload details for the AdjustBrightness directive.

Property Description Type Required

brightnessDelta

Amount by which to change the brightness.

Integer

Yes

AdjustBrightness response

If you handle an AdjustBrightness directive successfully, respond with an Alexa.Response event. Include the values of all properties that changed in the context object. 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 an AdjustBrightness 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.BrightnessController",
            "name": "brightness",
            "value": 75,
            "timeOfSample": "2017-02-03T16:20:50.52Z",
            "uncertaintyInMilliseconds": 1000
        }]
    }
}

AdjustBrightness directive error handling

If you can't handle an AdjustBrightness directive successfully, respond with an Alexa.ErrorResponse event.

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",
            "payloadVersion": "3"
        },
        "endpoint": {
            "scope": {
                "type": "BearerToken",
                "token": "OAuth2.0 bearer token"
            },
            "endpointId": "Endpoint ID"
        },
        "payload": {}
    },
    "context": {
        "properties": [{
            "namespace": "Alexa.BrightnessController",
            "name": "brightness",
            "value": 75,
            "timeOfSample": "2017-02-03T16:20:50.52Z",
            "uncertaintyInMilliseconds": 1000
        }]
    }
}

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.

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.BrightnessController",
                    "name": "brightness",
                    "value": 75,
                    "timeOfSample": "2017-02-03T16:20:50.52Z",
                    "uncertaintyInMilliseconds": 0
                }]
            }
        }
    },
    "context": {
        "namespace": "Alexa.EndpointHealth",
        "name": "connectivity",
        "value": {
            "value": "OK"
        },
        "timeOfSample": "2017-02-03T16:20:50.52Z",
        "uncertaintyInMilliseconds": 0
    }
}