Thank you for your visit. This page is only available in English at this time.

Alexa.Cooking.PresetController Interface

Implement the Alexa.Cooking.PresetController capability interface so that users can control cooking appliances that cook with preset settings, such as a microwave with a popcorn setting. You must use the PresetController interface in conjunction with the Alexa.Cooking interface. For more information about cooking skills, see Build Smart Home Skills for Cooking Appliances.

For the list of locales that are supported for the PresetController interface, see List of Capability Interfaces and Supported Locales.

Utterances

When you use the Alexa.Cooking.PresetController interface, the voice interaction model is already built for you. The following examples show some user 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 that you provide to the Alexa team. Catalogs can vary by brand, appliance type, and model. You identify the catalog that your device uses in your discover response. Items from the catalog are sent to your skill in the CookByPreset directive.

To submit a preset cooking catalog for Alexa to use, send an email to alexa-kitchen-presets@amazon.com. In the subject line provide the appliance brand, the appliance type, and the appliance model.

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*

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.
  • The ID for your preset catalog.

    • The ID is between 3 and 63 characters long, and contains only 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 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 more information, see preset catalogs. String Yes
supportsRemoteStart True if Alexa can start the device after a customer's 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. Other cooking modes can be supported by the same appliance through other interfaces. An array of cookingMode strings. Yes

Discover response example

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

{
  "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 more information, 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. This field is only included if the user specifies it. A foodDoneness object.
foodItem The food to cook. This field is only included if the user specifies it. A foodItem object.

CookByPreset directive example

{
  "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

{
  "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 though some of the properties are defined by other interfaces.

Example Response

{
  "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 information about state reports, see Understand State Reporting.

StateReport response event example

{
  "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 information about change reports, see Understand State Reporting.

ChangeReport event example

{  
  "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": {}
}