Connect a Window AC Unit to Alexa

The following shows an example of how to use the capability interfaces to connect a window air conditioning unit.

Capabilities

This example air conditioning unit declares the following capabilities.

Capability Purpose Example utterance

PowerController

Allows a customer to turn the device on or off.

"Turn on the Living Room Air Conditioner"

ThermostatController

Allows a customer to control the temperature. This particular unit supports a single setpoint and a COOL mode.

"Set the Living Room Air Conditioner to 68 degrees."

TemperatureSensor

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 living room air conditioner?" "What is the temperature in the group name?"

RangeController "Fan Speed"

Allows a customer to control the speed of the fan. This example also specifies presets of minimum and maxium for specific rangeValue settings for additional supported utterances.

"Set the fan speed to 5 on the living room air conditioner." "Set the air speed on living room air conditioner to maximum"

EndpointHealth

Enables in-depth reporting of the state of the device to the customer through experiences like the Alexa app.

Not applicable.

Alexa

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": "Living Room Air Conditioner",
          "description": "Smart Thermostat by Sample Manufacturer",
          "manufacturerName": "Sample Manufacturer",
          "displayCategories": [
            "THERMOSTAT"
          ],
          "cookie": {},
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.PowerController",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "powerState"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.ThermostatController",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "targetSetpoint"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              },
              "configuration": {
                "supportsScheduling": true,
                "supportedModes": [
                  "COOL"
                ]
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.TemperatureSensor",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "temperature"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.RangeController",
              "version": "3",
              "instance": "SampleManufacturer.Fan.Speed",
              "capabilityResources": {
                "friendlyNames": [
                  {
                    "@type": "text",
                    "value": {
                      "text": "Fan Speed".
                      "locale": "en-US"
                    }
                  },
                  {
                    "@type": "text",
                    "value": {
                      "text": "Air Speed",
                      "locale": "en-US"
                    }
                  }
                ]
              },
              "properties": {
                "supported": [
                  {
                    "name": "rangeValue"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              },
              "configuration": {
                "supportedRange": {
                  "minimumValue": 1,
                  "maximumValue": 10,
                  "precision": 1
                },
                "presets": [
                  {
                    "rangeValue": 1,
                    "presetResources": {
                      "friendlyNames": [
                        {
                          "@type": "asset",
                          "value": {
                            "assetId": "Alexa.SettingValues.Low"
                          }
                        },
                        {
                          "@type": "asset",
                          "value": {
                            "assetId": "Alexa.SettingValues.Minimum"
                          }
                        }
                      ]
                    }
                  },
                  {
                    "rangeValue": 10,
                    "presetResources": {
                      "friendlyNames": [
                        {
                          "@type": "asset",
                          "value": {
                            "assetId": "Alexa.SettingValues.High"
                          }
                        },
                        {
                          "@type": "asset",
                          "value": {
                            "assetId": "Alexa.SettingValues.Maximum"
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.EndpointHealth",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa",
              "version": "3"
            }
          ]
        }
      ]
    }
  }
}

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.