Alexa.Cooking.PresetController Interface 3


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. For the definitions of the message properties, see Alexa Interface Message and Property Reference.

Utterances

The Alexa.Cooking.PresetController interface uses the pre-built voice interaction model. 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.

Reportable 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, expressed as a FoodDoneness string, represents how cooked a user wants their food, such as a hard egg or a well-done steak.

FoodDoneness values

FoodDoneness represents how cooked a user wants their food, such as a rare steak, crispy bacon, or al dente pasta. You can use the following values for FoodDoneness. The values are strings.

Doneness value Supported food types

AL_DENTE

Pasta, vegetables

CREAMY

Eggs

CRISPY

Vegetables

DRY

FIRM

Fish, poultry

FLAKY

Fish

HARD

Eggs

JUICY

Poultry

MEDIUM

Eggs, fish, meat, pasta

MEDIUM_RARE

Fish, meat

MEDIUM_WELL

Eggs, fish, meat, pasta

MOIST

OPAQUE

OVERCOOKED

Fish, meat, pasta

RARE

Fish, meat

RUNNY

Eggs

SMOOTH

Eggs

SOFT

Eggs, vegetables

SPRINGY

SUCCULENT

TENDER

Poultry

UNDERCOOKED

Pasta, vegetables

VELVETY

Eggs

WELL_DONE

Fish, meat, pasta

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.

To let Alexa know the health of your device, also implement the Alexa.EndpointHealth interface.

Configuration object

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

Field Description Type Required
presetCatalogId 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 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. Array of CookingMode values 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": "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"],
          "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.EndpointHealth",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa",
              "version": "3"
            }
          ]
        }
      ]
    }
  }
}

Directives

Alexa sends the following Alexa.Cooking.PresetController interface directives to your skill.

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 example

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

{
  "directive": {
    "header": {
      "namespace": "Alexa.Cooking.PresetController",
      "name": "CookByPreset",
      "messageId": "Unique version 4 UUID",
      "correlationToken": "Opaque correlation token",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "OAuth2.0 bearer token"
      },
      "endpointId": "Endpoint ID",
      "cookie": {}
    },
    "payload": {
      "presetName": "pizza",
      "foodItem": {
        "foodName": "pizza",
        "foodQuantity": {
            "@type": "Count",
            "value": 1
        }
      },
      "cookingMode": {
        "PRESET"
      }
    }
  }
}

CookByPreset directive with requested food doneness example

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": "Unique version 4 UUID",
      "correlationToken": "Opaque correlation token",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "OAuth2.0 bearer token"
      },
      "endpointId": "Endpoint ID",
      "cookie": {}
    },
    "payload": {
      "presetName": "beef steak",
      "foodItem": {
          "foodName": "steak"
      },
      "cookingMode": {
        "PRESET"
      },
      "requestedFoodDoneness": "MEDIUM_RARE"
    }
  }
}

CookByPreset directive payload

The following table shows the payload details for the CookByPreset directive.

Property Description Type Required

presetName

Name of the preset option to use for the cooking session. For details, see preset catalogs.

String

Yes

cookingMode

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.

CookingMode object

Yes

requestedFoodDoneness

How cooked a user wants their food, such as a rare steak. The directive includes this field only if the user specifies it.

FoodDoneness string

No

foodItem

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

FoodItem object

No

CookByPreset response

If you handle a CookByPreset 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 CookByPreset 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.PresetController",
        "name":"presetName",
        "value":"Salmon",
        "timeOfSample":"2019-11-11T21:20:52.32Z",
        "uncertaintyInMilliseconds":0
      },
      {
        "namespace":"Alexa.Cooking.PresetController",
        "name":"requestedFoodDoneness",
        "value":"MEDIUM",
        "timeOfSample":"2019-11-11T21:20:52.32Z",
        "uncertaintyInMilliseconds":0
      },
      {
         "namespace": "Alexa.Cooking",
         "name": "cookingMode",
         "value": "PRESET",
         "timeOfSample": "2019-11-11T21:20:52.32Z",
         "uncertaintyInMilliseconds": 0
      },
      {
         "namespace": "Alexa.Cooking",
         "name": "foodItem",
         "value":{
            "foodName": "Salmon",
            "foodQuantity":{
               "@type": "Weight",
               "value": 5.5,
               "unit": "POUND"
            }
         },
         "timeOfSample": "2019-11-11T21:20:52.32Z",
         "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:52.32Z",
          "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 example

Copied to clipboard.

{
  "event": {
    "header": {
      "namespace": "Alexa",
      "name": "StateReport",
      "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.PresetController",
        "name":"presetName",
        "value":"Salmon",
        "timeOfSample":"2019-11-11T21:20:52.32Z",
        "uncertaintyInMilliseconds":0
      },
      {
        "namespace":"Alexa.Cooking.PresetController",
        "name":"requestedFoodDoneness",
        "value":"MEDIUM",
        "timeOfSample":"2019-11-11T21:20:52.32Z",
        "uncertaintyInMilliseconds":0
      },
      {
         "namespace": "Alexa.Cooking",
         "name": "cookingMode",
         "value": "PRESET",
         "timeOfSample": "2019-11-11T21:20:52.32Z",
         "uncertaintyInMilliseconds": 0
      },
      {
         "namespace": "Alexa.Cooking",
         "name": "foodItem",
         "value":{
            "foodName": "Salmon",
            "foodQuantity":{
               "@type": "Weight",
               "value": 5.5,
               "unit": "POUND"
            }
         },
         "timeOfSample": "2019-11-11T21:20:52.32Z",
         "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:52.32Z",
          "uncertaintyInMilliseconds": 0
      }
    ]
  }
}

Change reporting

You send a 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 more details about change reports, see Understand State Reporting.

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.PresetController",
            "name":"presetName",
            "value":"Salmon",
            "timeOfSample":"2019-11-11T21:20:52.32Z",
            "uncertaintyInMilliseconds":0
          },
          {
            "namespace":"Alexa.Cooking.PresetController",
            "name":"requestedFoodDoneness",
            "value":"MEDIUM",
            "timeOfSample":"2019-11-11T21:20:52.32Z",
            "uncertaintyInMilliseconds":0
          },
          {
             "namespace": "Alexa.Cooking",
             "name": "cookingMode",
             "value": "PRESET",
             "timeOfSample": "2019-11-11T21:20:52.32Z",
             "uncertaintyInMilliseconds": 0
          },
          {
             "namespace": "Alexa.Cooking",
             "name": "foodItem",
             "value":{
                "foodName": "Salmon",
                "foodQuantity":{
                   "@type": "Weight",
                   "value": 5.5,
                   "unit": "POUND"
                }
             },
             "timeOfSample": "2019-11-11T21:20:52.32Z",
             "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:52.32Z",
              "uncertaintyInMilliseconds": 0
          }
        ]
      }
    }
  },
   "context": {
    "namespace": "Alexa.EndpointHealth",
    "name": "connectivity",
    "value": {
      "value": "OK"
    },
    "timeOfSample": "2019-11-11T21:10:05.12Z",
    "uncertaintyInMilliseconds": 0
  }
}
}

Was this page helpful?

Last updated: Aug 23, 2024