Alexa.Cooking Interface

Implement the Alexa.Cooking interface in your Alexa skill so that users can control cooking appliances. All smart home skills that control cooking appliances must implement the Alexa.Cooking interface. For details about cooking skills, see Build Smart Home Skills for Cooking Appliances.

For the list of languages that the Alexa.Cooking 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.Cooking interface uses the pre-built voice interaction model. The following examples show some user utterances:

Alexa, is the oven on?
Alexa, is the microwave running?
Alexa, stop the microwave.
Alexa, turn off the oven.
Alexa, set the oven to convection bake.
Alexa, defrost three pounds of meat in my microwave.

After the customer says one of these utterances, Alexa sends a corresponding directive or report state request to your skill.

Reportable properties

The following table shows the reportable properties that the Alexa.Cooking interface defines. You identify that you support the property in your discovery response.

Property Description Type
cookingMode Mode for a cooking session, such as REHEAT. CookingMode string
foodItem Describe the food to cook. FoodItem object
cookingTimeInterval Time when cooking begins, and the time when the user expects cooking to complete. If the appliance needs to preheat before cooking begins, report the preheat time separately through the preheatTimeInterval property. Time interval object
cookingStatus State of your appliance or the food cooking in the appliance, such as COOKING_COMPLETED. If your device supports proactive announcements for cooking, include this property. CookingStatus.

Announcements for cooking status

You can enable announcements to notify the user when the cooking appliance or the food needs attention. For example, "Your oven has preheated." and "Your food in the oven is ready."

To enable announcements, implement the Alexa.ProactiveNotificationSource interface in your Alexa skill. To indicate the cooking statuses that your appliance supports, include the supportedCookingStatuses property in your discovery response. You trigger announcements by sending ChangeReport to report a change in the cooking status.

For details, see Alexa.ProactiveNotificationSource.

Discovery

You describe endpoints that support Alexa.Cooking 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.

Configuration object

In addition to the usual discovery response fields, for the Alexa.Cooking interface, include a configuration object that contains the following fields.

Property Description Type Required

supportsRemoteStart

True if Alexa can start the device after a voice command. When false, Alexa prompts the user to push start on the device. The default is false.

Boolean

No

supportedCookingModes

Cooking modes that the device supports through this interface. Use other interfaces to specify cooking modes for the same appliance.

Array of CookingMode values

Yes

supportedCookingStatuses

To enable announcements, include the cooking statuses that the device supports.
You must include at least two cooking statuses.

Array of CookingStatus string values

No

Discover response example

The following example shows a Discover.Response message for a microwave that supports the Alexa.Cooking, TimeController, PresetController, and ProactiveNotificationSource 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": "Microwave",
                "displayCategories": ["MICROWAVE"],
                "additionalAttributes": {
                    "manufacturer": "manufacturer name",
                    "model": "sample model",
                    "serialNumber": "the serial number",
                    "customIdentifier": "your custom identifier"
                },
                "cookie": {},
                "capabilities": [{
                        "type": "AlexaInterface",
                        "interface": "Alexa.Cooking",
                        "version": "3",
                        "properties": {
                            "supported": [{
                                    "name": "cookingMode"
                                },
                                {
                                    "name": "foodItem"
                                },
                                {
                                    "name": "cookingTimeInterval"
                                },
                                {
                                    "name": "cookingStatus"
                                }
                            ],
                            "proactivelyReported": true,
                            "retrievable": true
                        },
                        "configuration": {
                            "supportsRemoteStart": false,
                            "supportedCookingModes": [{
                                    "name": "cookingMode",
                                    "value": "OFF"
                                },
                                {
                                    "name": "cookingMode",
                                    "value": "DEFROST"
                                },
                                {
                                    "name": "cookingMode",
                                    "value": "REHEAT"
                                },
                                {
                                    "name": "cookingMode",
                                    "value": "BOIL",
                                    "customName": "QUICK_BOIL"
                                }
                            ],
                            "supportedCookingStatuses": ["COOKING", "COOKING_COMPLETED", "NOT_IN_USE"]
                        }
                    },
                    {
                        "type": "AlexaInterface",
                        "interface": "Alexa.Cooking.TimeController",
                        "version": "3",
                        "properties": {
                            "supported": [{
                                "name": "requestedCookTime"
                            }],
                            "proactivelyReported": true,
                            "retrievable": true
                        },
                        "configuration": {
                            "supportsRemoteStart": false,
                            "supportedCookingModes": ["DEFROST", "REHEAT"]
                        }
                    },
                    {
                        "type": "AlexaInterface",
                        "interface": "Alexa.Cooking.PresetController",
                        "version": "3",
                        "properties": {
                            "supported": [{
                                "name": "presetName"
                            }, {
                                "name": "requestedFoodDoneness"
                            }],
                            "proactivelyReported": true,
                            "retrievable": true
                        },
                        "configuration": {
                            "presetCatalogId": "catalog ID",
                            "supportsRemoteStart": false,
                            "supportedCookingModes": ["PRESET", "DEFROST", "REHEAT"]
                        }
                    },
                    {
                        "type": "AlexaInterface",
                        "interface": "Alexa.ProactiveNotificationSource",
                        "version": "3.0",
                        "proactivelyReported": true,
                        "configuration": {
                            "notificationConditions": [{
                                "conditionType": "PropertyValueChange",
                                "property": {
                                    "type": "AlexaInterface",
                                    "interface": "Alexa.Cooking",
                                    "name": "cookingStatus"
                                },
                                "valueChangeCondition": {
                                    "comparator": "StringIn",
                                    "value": ["COOKING", "COOKING_COMPLETED", "NOT_IN_USE"]
                                }
                            }]
                        }
                    },
                    {
                        "type": "AlexaInterface",
                        "interface": "Alexa.EndpointHealth",
                        "version": "3",
                        "properties": {
                            "supported": [{
                                "name": "connectivity"
                            }],
                            "proactivelyReported": true,
                            "retrievable": true
                        }
                    },
                    {
                        "type": "AlexaInterface",
                        "interface": "Alexa",
                        "version": "3"
                    }
                ]
            }]
        }
    }
}

Directives

SetCookingMode directive

Support the SetCookingMode directive so that customers can set the cooking mode for a device.

The following examples show some customer utterances:

Alexa, stop the microwave.
Alexa, defrost three pounds of meat in my microwave.

SetCookingMode directive example

The following example shows a SetCookingMode directive that Alexa sends to your skill.

{
  "directive": {
    "header": {
      "namespace": "Alexa.Cooking",
      "name": "SetCookingMode",
      "messageId": "Unique identifier, preferably a version 4 UUID",
      "correlationToken": "Opaque correlation token",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "OAuth2.0 bearer token"
      },
      "endpointId": "Endpoint ID",
      "cookie": {}
    },
    "payload": {
      "cookingMode": {
        "value": "DEFROST"
      },
      "foodItem": {
        "foodName": "meat",
        "foodQuantity": {
          "@type": "Weight",
          "value": 3,
          "unit": "POUND"
        }
      }
    }
  }
}

SetCookingMode directive example to turn off a device

The following example shows a SetCookingMode directive that Alexa sends to your skill to turn off a device.

{
  "directive": {
    "header": {
      "namespace": "Alexa.Cooking",
      "name": "SetCookingMode",
      "messageId": "Unique identifier, preferably a version 4 UUID",
      "correlationToken": "Opaque correlation token",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "OAuth2.0 bearer token"
      },
      "endpointId": "Endpoint ID",
      "cookie": {}
    },
    "payload": {
      "cookingMode": {
        "value": "OFF"
      }
    }
  }
}

SetCookingMode directive payload

Property Description Type Required

cookingMode

Mode for the cooking session, such as DEFROST.

CookingMode object

Yes

foodItem

Food to cook. The directive includes this field only if the user specifies it.

FoodItem

No

SetCookingMode response

If you handle a SetCookingMode directive successfully, respond with an Alexa.Response event. In the context object, include the values of all relevant properties.

The following example shows a response to a SetCookingMode directive. The context contains the values of all properties relevant to the current cooking action, even those properties defined by other interfaces.

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.Cooking",
         "name": "cookingMode",
         "value": "PRESET",
         "timeOfSample": "2019-11-11T21:20:45Z",
         "uncertaintyInMilliseconds": 0
      },
      {
         "namespace": "Alexa.Cooking",
         "name": "foodItem",
         "value":{
            "foodName": "Salmon",
            "foodQuantity":{
               "@type": "Weight",
               "value": 5.5,
               "unit": "POUND"
            }
         },
         "timeOfSample": "2019-11-11T21:20:45Z",
         "uncertaintyInMilliseconds": 0
      },
      {
          "namespace": "Alexa.Cooking",
          "name": "cookingTimeInterval",
          "value": {
              "start": "2019-11-11T21:00:00Z",
              "end": "2019-11-11T22:30:00Z"
          },
          "timeOfSample": "2019-11-11T21:20:45Z",
          "uncertaintyInMilliseconds": 0
      }
    ]
  }
}

SetCookingMode directive error handling

If you can't handle a SetCookingMode directive successfully, respond with an Alexa.Cooking.ErrorResponse event. If your error is generic, and not specific to cooking, you can also respond with a generic 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 retrievable properties in the context object. You identify your retrievable properties in your discovery response. For details about state reports, see Understand State 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",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "OAuth2.0 bearer token"
      },
      "endpointId": "Endpoint ID"
    },
    "payload": {}
  },
  "context": {
    "properties": [
      {
         "namespace": "Alexa.Cooking",
         "name": "cookingMode",
         "value": "BAKE",
         "timeOfSample": "2019-11-11T21:20:45Z",
         "uncertaintyInMilliseconds": 0
      },
      {
         "namespace": "Alexa.Cooking",
         "name": "foodItem",
         "value":{
            "foodName": "Salmon",
            "foodQuantity":{
               "@type": "Weight",
               "value": 5.5,
               "unit": "POUND"
            }
         },
         "timeOfSample": "2019-11-11T21:20:45Z",
         "uncertaintyInMilliseconds": 0
      },
      {
          "namespace": "Alexa.Cooking",
          "name": "cookingTimeInterval",
          "value": {
              "start": "2019-11-11T21:00:00Z",
              "end": "2019-11-11T22:30:00Z"
          },
          "timeOfSample": "2019-11-11T21:20:45Z",
          "uncertaintyInMilliseconds": 0
      }
    ]
  }
}

Change reporting

You send an Alexa.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 reporting, see Understand State Reporting.

For an example Alexa.ChangeReport to trigger a notification to the user, see Alexa.ProactiveNotificationSource.

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.Cooking",
             "name": "cookingMode",
             "value": "BAKE",
             "timeOfSample": "2019-11-11T21:20:45Z",
             "uncertaintyInMilliseconds": 0
          },
          {
             "namespace": "Alexa.Cooking",
             "name": "foodItem",
             "value":{
                "foodName": "Roast",
                "foodQuantity":{
                   "@type": "Weight",
                   "value": 5.5,
                   "unit": "POUND"
                }
             },
             "timeOfSample": "2019-11-11T21:20:45Z",
             "uncertaintyInMilliseconds": 0
          },
          {
              "namespace": "Alexa.Cooking",
              "name": "cookingTimeInterval",
              "value": {
                  "start": "2019-11-11T21:00:00Z",
                  "end": "2019-11-11T22:30:00Z"
              },
              "timeOfSample": "2019-11-11T21:20:45Z",
              "uncertaintyInMilliseconds": 0
          },
          {
            "namespace": "Alexa.Cooking",
            "name": "cookingStatus",
            "value": "COOKING",
            "timeOfSample": "2017-02-03T16:20:50Z",
            "uncertaintyInMilliseconds": 0
          }
        ]
      }
    }
  },
  "context": {
    "namespace": "Alexa.EndpointHealth",
    "name": "connectivity",
    "value": {
      "value": "OK"
    },
    "timeOfSample": "2019-11-11T21:20:45Z",
    "uncertaintyInMilliseconds": 0
  }
}