Alexa.ContactSensor interface in your Alexa add-on for devices that detect contact between two surfaces. For example, a contact sensor can report whether a door or window is open or closed. For more details about security add-ons, see Smart Home Security Overview.
If your contact sensors are components of a larger security system, your add-on can also implement the Alexa.MotionSensor and Alexa.SecurityPanelController interfaces for a unified customer experience.
For the list of languages that the ContactSensor interface supports, see List of Alexa Interfaces and Supported Languages. For the definitions of the message properties, see Alexa Interface Message and Property Reference.
Contact sensor overview
A contact sensor typically has two components; a main component and a magnet component. When the components are in contact with each other, the sensor is closed. When they lose contact, the sensor is open. The following image shows the open and closed states of a contact sensor on closed and open windows.
Utterances
When you use theAlexa.ContactSensor interface, the voice interaction model is already built for you. The following examples show some customer utterances:
- English (All)
Reportable properties
TheAlexa.ContactSensor interface uses detectionState as the primary property. You can use the following values for detectionState.
| Value | Description |
|---|---|
DETECTED | The sensor is open and the two pieces of the sensor aren’t in contact with each other. For example, after a window is opened. |
NOT_DETECTED | The sensor is closed and the two pieces of the sensor are in contact with each other. |
Discovery
You describe endpoints that supportAlexa.ContactSensor using the standard discovery mechanism described in Alexa.Discovery.
Set retrievable to true for the properties that you report when Alexa sends your add-on a state report request. Set proactivelyReported to true for the properties that you proactively report to Alexa in a change report.
Use CONTACT_SENSOR for the display category. For the full list of display categories, see display categories.
Sensor devices must also implement Alexa.EndpointHealth.
Discover response example
The following example shows aDiscover.Response message for a contact sensor device that supports the Alexa.ContactSensor interface.
Directives
TheAlexa.ContactSensor interface doesn’t define any directives.
State reporting
Support theReportState directive so that customers can ask about the state of their contact sensors.
The following examples show user utterances:
- English (All)
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 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
Change reporting
You send aChangeReport 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.

