Alexa.BrightnessController Interface 3


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

The following examples show some user utterances:

Alexa, brighten the bathroom light to seventy five percent.
Alexa, dim the lights to twenty five percent.
Alexa, set the bedroom light to fifty percent.

Alexa, diminue la lumière de la salle de bains
Alexa, règle la luminosité de la lumière à cinquante
Alexa, mets la lumière de la chambre en lumineux
Alexa, ajuste les lumières de la cuisine à cinquante pourcents

Alexa, dimme das Licht auf fünfundzwanzig Prozent.
Alexa, erhelle das Licht auf fünfundsiebzig Prozent.
Alexa, stelle das Licht auf fünfzig Prozent.
Alexa, lege die Küchenbeleuchtung auf fünfundsiebzig Prozent fest.

Alexa, बाथरूम की रोशनी को पचहत्तर प्रतिशत तक रोशन करो।
Alexa, रोशनी को पच्चीस प्रतिशत तक कम कर दो।
Alexa, बेडरूम की रोशनी को पचास प्रतिशत पर सेट करो।

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

Alexa, metti la luce a venticinque percento.
Alexa, rendi la mia luce più luminosa per favore.
Alexa, imposta il gruppo le luci della cucina alla luminosità massima.
Alexa, aumenta la luminosità delle lampade al cinquanta percento per favore.

Alexa, aumente o brilho da luz do banheiro para setenta e cinco por cento.
Alexa, diminua o brilho das luzes para vinte e cinco por cento.
Alexa, diminua as luzes para vinte e cinco por cento.
Alexa, coloque a luz do banheiro em cinquenta por cento.

Alexa, pon el brillo de las luces de la cocina a cincuenta.
Alexa, por favor, baje la luz del dormitorio al veinticinco por ciento.
Alexa, ajusta el brillo de las luces de la cocina al setenta y cinco.

Alexa, zet de badkamerlamp feller tot vijfenzeventig procent.
Alexa, dim de verlichting tot vijfentwintig procent.
Alexa, zet de slaapkamerlamp op vijftig procent.

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

Alexa sends the following Alexa.BrightnessController interface directives to your skill.

SetBrightness directive

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

The following examples show user utterances:

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.

Alexa, टेबल लाइट बल्ब को पचास प्रतिशत पर सेट करो।

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

Alexa, metti la lampada da tavolo a venticinque per cento.

Alexa, coloque a lâmpada de mesa em cinquenta por cento.

Alexa, sube la bombilla de la mesa a cincuenta por ciento.

Alexa, zet de tafellamp op vijftig procent.

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 users can adjust the brightness value of a device.

The following examples show user utterances:

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.

Alexa, डिम टेबल लाइट बल्ब पच्चीस प्रतिशत।

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

Alexa, diminuisci lampadina da tavolo venticinque per cento.

Alexa, diminua o brilho da lâmpada de mesa em vinte e cinco por cento.

Alexa, baja el brillo de luz a veinticinco.

Alexa, dim de tafellamp tot vijfentwintig procent.

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

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": "2024-02-03T16:17:00.00Z",
                    "uncertaintyInMilliseconds": 0
                }]
            }
        }
    },
    "context": {
        "namespace": "Alexa.EndpointHealth",
        "name": "connectivity",
        "value": {
            "value": "OK"
        },
        "timeOfSample": "2024-02-03T16:15:00.00Z",
        "uncertaintyInMilliseconds": 0
    }
}

Was this page helpful?

Last updated: Aug 23, 2024