Alexa.Cooking.PresetController Interface

Implement the Alexa.Cooking.PresetController interface in your Alexa skill so that users can control cooking appliances that cook with custom settings, called presets. For example, a microwave with a popcorn button or an oven with a custom way to cook "Herb Roasted Chicken" for a specific brand. When you set up presets, a user can cook foods without manually having to select time, temperature, or power level, and without having to read directions.

You must use the PresetController interface with the Alexa.Cooking interface. For more details about cooking skills, see Build Smart Home Skills for Cooking Appliances.

For the list of languages that the PresetController interface supports, see List of Alexa Interfaces and Supported Languages.

Utterances

When you use the Alexa.Cooking.PresetController interface, Alexa provides the voice interaction model for you. The following examples show some customer utterances:

Alexa, microwave the popcorn.
Alexa, cook the pizza in the microwave.
Alexa, defrost five pounds of chicken breast.

After the user says one of these utterances, Alexa sends a corresponding directive to your skill.

Preset catalogs

Preset cooking relies on a catalog of custom cooking settings that you provide to Amazon. Alexa can use this catalog to tailor the speech recognition to better understand the user's utterances and intentions.

A preset catalog includes the preset item name and cooking mode, along with some optional fields, such as whether the preset requires the food quantity. Together, the preset item name and cooking mode must be unique. Consider the following when you build your catalog:

  • Include commonly used recipes and packaged food in your catalog.
  • Avoid using the full name of items.
  • Avoid repeating the same words in more than one item.
  • Group items that share the same cooking mode and time settings under a common name, such as roasted chicken.
  • Use item names that reflect the most common way people identify or describe the cooked item, not necessarily the actual name on the box.
  • Catalogs can vary by brand, appliance type, and model.

The following table shows an example of information to provide in your preset catalog.

Preset item name Cooking mode Food quantity (optional)
Chicken DEFROST Weight
Chicken ROAST
Coffee REHEAT Volume
Popcorn PRESET
Potatoes PRESET Count

You identify the catalog that your device uses in your discover response. When the user includes a preset in the utterance, Alexa sends the item from the catalog to your skill in the CookByPreset directive.

Prepare your preset catalog for submission

You must send an email request to Amazon to receive your catalog ID and instructions about uploading your catalog.

To prepare to submit a preset cooking catalog for Alexa to use

  1. Draft an email that includes in the subject line, the appliance brand, the appliance type, the appliance model, and your AWS Account ID. For example, your email could look like the following.
    To: alexa-kitchen-presets@amazon.com
    Subject: Brand: *your appliance brand*, Appliance type: *your appliance type*, Appliance model: *your appliance model*, AWS Account ID: *your AWS account ID*
    
  2. Send the email to alexa-kitchen-presets@amazon.com.

Within two weeks, you receive a response that includes the following information:

  • Instructions for uploading your catalog.
    • How to format your catalog in Excel.
    • Where to upload the Excel file that contains your catalog.
  • Your preset catalog ID.
    • The ID is from 3 through 63 characters long, and contains numbers, lower case letters, and hyphens.
    • You specify the catalog ID in your discover response for devices that use the catalog.

Properties

The Alexa.Cooking.PresetController interface uses the presetName and the requestedFoodDoneness properties as the primary properties. The presetName property represents the name of the preset from the preset catalog. The requestedFoodDoneness property represents how cooked a user wants their food, such as a rare steak or a well-done steak, expressed as a foodDoneness.

Discovery

You describe endpoints that support Alexa.Cooking.PresetController by using the standard discovery mechanism described in Alexa.Discovery.

Set retrievable to true for the properties that you report when Alexa sends your skill a state report request. Set proactivelyReported to true for the properties that you proactively report to Alexa in a change report.

For the full list of display categories, see display categories.

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

Field Description Type Required
presetCatalogId The ID for the preset catalog. For details, see preset catalogs. String Yes
supportsRemoteStart True if Alexa can start the device after a voice command. When false, Alexa sends the CookByPreset directive to set the parameters for the cook session, and Alexa prompts the user to push Start on the device. The default is false. Boolean No
supportedCookingModes The cooking modes that the device supports through this interface. Specify the default cooking mode as the first item in the array. Use other interfaces to specify cooking modes for the same appliance. An array of cookingMode strings. Yes

Discover response example

The following example shows a Discover.Response message for a microwave that supports the PresetController and Cooking interfaces.

Copied to clipboard.

{
  "event": {
    "header": {
      "namespace": "Alexa.Discovery",
      "name": "Discover.Response",
      "payloadVersion": "3",
      "messageId": "<message id>"
    },
    "payload": {
      "endpoints": [
        {
          "endpointId": "<unique ID of the endpoint>",
          "manufacturerName": "<the manufacturer name of the endpoint>",
          "description": "<a description that is shown in the Alexa app>",
          "friendlyName": "Microwave",
          "displayCategories": ["MICROWAVE"],
          "cookie": {},
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.Cooking.PresetController",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "presetName"
                  },
                  {
                    "name": "requestedFoodDoneness"

                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              },
              "configuration": {
                "presetCatalogId": "<catalog ID>",
                "supportedCookingModes": ["REHEAT", "DEFROST"],
                "supportsRemoteStart": true
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.Cooking",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "cookingMode"
                  },
                  {
                    "name": "foodItem"
                  },
                  {
                    "name": "cookingTimeInterval"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              },
              "configuration": {
                "supportsRemoteStart": false,
                "supportedCookingModes": ["REHEAT", "DEFROST", "PRESET", "OFF"]
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa",
              "version": "3"
            }
          ]
        }
      ]
    }
  }
}

Directives

CookByPreset directive

Support the CookByPreset directive so that customers can start a cooking session and specify a preset option.

The following examples show customer utterances:

Alexa, defrost five pounds of chicken breast.

CookByPreset directive payload details

Field Description Type
presetName The name of the preset option to use for the cooking session. For details, see preset catalogs. String
cookingMode The cooking mode for the cooking session, such as BROIL. If the user doesn't specify the cookingMode, Alexa chooses the first supported mode that you specified in your discovery response. A cookingMode object.
requestedFoodDoneness How cooked a user wants their food, such as a rare steak. The directive includes this field only if the user specifies it. A foodDoneness object.
foodItem The food to cook. The directive includes this field only if the user specifies it. A foodItem object.

CookByPreset directive example

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

{
  "directive": {
    "header": {
      "namespace": "Alexa.Cooking.PresetController",
      "name": "CookByPreset",
      "messageId": "<message id>",
      "correlationToken": "<an opaque correlation token>",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "<an OAuth2 bearer token>"
      },
      "endpointId": "<endpoint id>",
      "cookie": {}
    },
    "payload": {
      "presetName": "pizza",
      "foodItem": {
        "foodName": "pizza",
        "foodQuantity": {
            "@type": "Count",
            "value": "1"
        }
      },
      "cookingMode": {
        "PRESET"
      }
    }
  }
}

CookByPreset directive example with requested food doneness

The following example shows a CookByPreset directive that Alexa sends to your skill to request a specific food doneness.

{
  "directive": {
    "header": {
      "namespace": "Alexa.Cooking.PresetController",
      "name": "CookByPreset",
      "messageId": "<message id>",
      "correlationToken": "<an opaque correlation token>",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "<an OAuth2 bearer token>"
      },
      "endpointId": "<endpoint id>",
      "cookie": {}
    },
    "payload": {
      "presetName": "beef steak",
      "foodItem": {
          "foodName": "steak"
      },
      "cookingMode": {
        "PRESET"
      },
      "requestedFoodDoneness": "MEDIUM_RARE"
    }
  }
}

CookByPreset response event

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

CookByPreset response event example

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

Example Response

Copied to clipboard.

{
  "event": {
    "header": {
      "namespace": "Alexa",
      "name": "Response",
      "messageId": "<message id>",
      "correlationToken": "<an opaque correlation token>",
      "payloadVersion": "3"
    },
    "endpoint": {
      "endpointId": "<endpoint id>"
    },
    "payload":{}
  },
  "context":  {
    "properties": [
      {
        "namespace":"Alexa.Cooking.PresetController",
        "name":"presetName",
        "value":"Salmon",
        "timeOfSample":"2017-08-31T23:30:00Z",
        "uncertaintyInMilliseconds":0
      },
      {
        "namespace":"Alexa.Cooking.PresetController",
        "name":"requestedFoodDoneness",
        "value":"MEDIUM",
        "timeOfSample":"2017-08-31T23:30:00Z",
        "uncertaintyInMilliseconds":0
      },
      {
         "namespace": "Alexa.Cooking",
         "name": "cookingMode",
         "value": "PRESET",
         "timeOfSample": "2019-11-11T21:20:45Z",
         "uncertaintyInMilliseconds": 0
      },
      {
         "namespace": "Alexa.Cooking",
         "name": "foodItem",
         "value":{
            "foodName": "Salmon",
            "foodCategory": "FISH",
            "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
      }
    ]
  }
}

CookByPreset directive error handling

If you can't handle a CookByPreset directive successfully, respond with an Alexa.Cooking.ErrorResponse event. You can also respond with a generic Alexa.ErrorResponse event if your error is generic, and not specific to cooking.

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 more details about state reports, see Understand State Reporting.

StateReport response event example

Copied to clipboard.

{
  "event": {
    "header": {
      "namespace": "Alexa",
      "name": "StateReport",
      "messageId": "<message id>",
      "correlationToken": "<an opaque correlation token>",
      "payloadVersion": "3"
    },
    "endpoint": {
      "endpointId": "<endpoint id>"
    },
    "payload": {}
  },
  "context": {
    "properties": [
      {
        "namespace":"Alexa.Cooking.PresetController",
        "name":"presetName",
        "value":"Salmon",
        "timeOfSample":"2017-08-31T23:30:00Z",
        "uncertaintyInMilliseconds":0
      },
      {
        "namespace":"Alexa.Cooking.PresetController",
        "name":"requestedFoodDoneness",
        "value":"MEDIUM",
        "timeOfSample":"2017-08-31T23:30:00Z",
        "uncertaintyInMilliseconds":0
      },
      {
         "namespace": "Alexa.Cooking",
         "name": "cookingMode",
         "value": "PRESET",
         "timeOfSample": "2019-11-11T21:20:45Z",
         "uncertaintyInMilliseconds": 0
      },
      {
         "namespace": "Alexa.Cooking",
         "name": "foodItem",
         "value":{
            "foodName": "Salmon",
            "foodCategory": "FISH",
            "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 a ChangeReport event to proactively report changes in the state of an endpoint. You identify the properties that you proactively report in your discovery response. For more details about change reports, see Understand State Reporting.

ChangeReport event example

Copied to clipboard.

{  
  "event": {
    "header": {
      "namespace": "Alexa",
      "name": "ChangeReport",
      "messageId": "<message id>",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "<an OAuth2 bearer token>"
      },
      "endpointId": "<endpoint id>"
    },
    "payload": {
      "change": {
        "cause": {
          "type": "PHYSICAL_INTERACTION"
        },
        "properties": [
          {
            "namespace":"Alexa.Cooking.PresetController",
            "name":"presetName",
            "value":"Salmon",
            "timeOfSample":"2017-08-31T23:30:00Z",
            "uncertaintyInMilliseconds":0
          },
          {
            "namespace":"Alexa.Cooking.PresetController",
            "name":"requestedFoodDoneness",
            "value":"MEDIUM",
            "timeOfSample":"2017-08-31T23:30:00Z",
            "uncertaintyInMilliseconds":0
          },
          {
             "namespace": "Alexa.Cooking",
             "name": "cookingMode",
             "value": "PRESET",
             "timeOfSample": "2019-11-11T21:20:45Z",
             "uncertaintyInMilliseconds": 0
          },
          {
             "namespace": "Alexa.Cooking",
             "name": "foodItem",
             "value":{
                "foodName": "Salmon",
                "foodCategory": "FISH",
                "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
          }
        ]
      }
    }
  },
  "context": {}
}