Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get started
Connect with Matter
Alexa Connect Kit
Add-ons
Certify
Resources
Skip to main content
Implement the Alexa.LockController interface in your Alexa add-on so that users can lock and unlock their lockable devices. For more details about security add-ons, see Smart Home Security Overview. For the list of languages that the LockController 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

When you use the Alexa.LockController interface, the Alexa service provides the voice interaction model for you. After the user says one of these utterances, Alexa sends a corresponding directive or report state request to your add-on. The following examples show some user utterances:



Reportable properties

The Alexa.LockController interface uses the lockState property to represent the state of a lock. The following table shows the valid lock state values:
ValueDescription
LOCKEDThe device is currently locked.
UNLOCKEDThe device is currently unlocked.
JAMMEDThe lock can’t transition to locked or unlocked because the locking mechanism is jammed.

Discovery

You describe endpoints that support Alexa.LockController using the standard discovery mechanism described in Alexa.Discovery. Set retrievable to true for all interfaces and properties that you report when Alexa sends your add-on a state report request. Set proactivelyReported to true for interfaces and properties that you proactively report to Alexa in a change report. Use SMARTLOCK for the display category. 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 smart lock that supports the Alexa.LockController interface.

Directives

Alexa sends the following Alexa.LockController interface directives to your add-on.

Lock directive

Support the Lock directive so that a customer can request that you lock an endpoint. The following examples show user utterances:

Lock directive example

The following example illustrates a Lock directive that Alexa sends to your add-on.

Lock directive payload

The Lock directive doesn’t define any payload parameters.

Lock response

If you handle a Lock directive successfully, respond depending on the speed with which your hardware can complete the task.
  • If your hardware can lock in 5 seconds or fewer, send an Alexa.Response event.
  • If your hardware takes more than 5 seconds to lock, first send a synchronous DeferredResponse event, and then send a Response event when the lock completes.
In either case, you can send the Response event synchronously or asynchronously. If you send the Response asynchronously, include a correlation token and a scope with an authorization token. Specify the value of the lockState property in the context of your response.

Lock response example

Slow lock example with deferred response and response

The following example shows the two responses to a lock directive that completes in more than 5 seconds. First send a synchronous DeferredResponse event. Optionally include estimatedDeferralInSeconds, the approximate time before you send your second response, in seconds.
Then send a Response event.

Lock directive error handling

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

Unlock directive

Support the Unlock directive so that a customer can request that you unlock an endpoint. By default, you can’t unlock a device. When you test your lockable endpoint add-ons, first enable the unlock feature by editing the device in the Alexa app. The following examples show user utterances:

Unlock directive example

The following example illustrates an Unlock directive that Alexa sends to your add-on.

Unlock directive payload

The Unlock directive doesn’t define any payload parameters.

Unlock response

If you handle an Unlock directive successfully, respond depending on the speed with which your hardware can complete the task.
  • If your hardware can unlock in 5 seconds or fewer, send a Response event.
  • If your hardware takes more than 5 seconds to unlock, first send a synchronous DeferredResponse event, and then send a Response event when the unlock completes.
In either case, you can send the Response event synchronously or asynchronously. Specify the value of the lockState property in the context of your response.

Unlock response example

Slow unlock example with deferred response and response

The following example shows the two responses to an unlock directive that completes in more than 5 seconds. First send a synchronous DeferredResponse event. Optionally include estimatedDeferralInSeconds, the approximate time before you send your second response, in seconds.
Then send a Response event.

Unlock directive error handling

If you can’t handle an Unlock 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. The following examples show some user utterances:

StateReport response example

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

Last modified on September 30, 2026