Connect a Wall Thermostat to Alexa
The following shows an example of how to use the capability interfaces to connect a wall thermostat to Alexa.
Capabilities
This example wall thermostat declares the following capabilities.
Capability | Purpose | Example utterance |
---|---|---|
Allows a customer to control the thermostat. This particular thermostat supports a single setpoint when in |
"Set the hallway thermostat to 72 degrees." |
|
Allows a customer to query the current ambient temperature. If the customer puts the device in a group, they can use additional utterances. |
"What is the temperature of the hallway thermostat?" "What is the temperature in the group name?" |
|
Enables in-depth reporting of the state of the device to the customer through experiences like the Alexa app. |
Not applicable. |
|
Contains directives and events related to state and error reporting. Make sure to explicitly include this interface and the supported version in the discovery response. |
Not applicable. |
Discovery
The wall thermostat provides the following AddOrUpdateReport.
{
"event": {
"header": {
"namespace": "Alexa.Discovery",
"name": "AddOrUpdateReport",
"payloadVersion": "3",
"messageId": "00000000-0000-0000-0000-000000000000"
},
"payload": {
"endpoints": [
{
"endpointId": "appliance-001",
"friendlyName": "Hallway Thermostat",
"description": "Smart Thermostat by Sample Manufacturer",
"manufacturerName": "Sample Manufacturer",
"displayCategories": [
"THERMOSTAT"
],
"cookie": {},
"capabilities": [
{
"type": "AlexaInterface",
"interface": "Alexa.ThermostatController",
"version": "3",
"properties": {
"supported": [
{
"name": "lowerSetpoint"
},
{
"name": "targetSetpoint"
},
{
"name": "upperSetpoint"
},
{
"name": "thermostatMode"
}
],
"proactivelyReported": true,
"retrievable": true
},
"configuration": {
"supportsScheduling": true,
"supportedModes": [
"HEAT",
"COOL",
"AUTO"
]
}
},
{
"type": "AlexaInterface",
"interface": "Alexa.TemperatureSensor",
"version": "3",
"properties": {
"supported": [
{
"name": "temperature"
}
],
"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"
}
]
}
]
}
}
}
Related resources
For information about building a smart home skill for lights, see Build a Smart Home Skill for Thermostats.
For more details on state reporting, see Understand State Reporting for a Smart Home Skill.
If the device has additional capabilities, you can add other capability interfaces.