Alexa.Cooking.FoodTemperatureController Interface 3


Implement the Alexa.Cooking.FoodTemperatureController interface in your Alexa skill so that users can control appliances that cook specific food items at specific food temperatures. If you want users to control appliances that cook by appliance temperature, use the TemperatureController interface instead.

Typically you use the FoodTemperatureController interface in conjunction with the FoodTemperatureSensor (optional) and Cooking (mandatory) interfaces. For more details about cooking skills, see Build Smart Home Skills for Cooking Appliances.

For the list of languages that the FoodTemperatureController 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

When you use the Alexa.Cooking.FoodTemperatureController interface, the voice interaction model is already built for you. The following examples show some customer utterances:

Alexa, cook my roast to 125 degrees.
Alexa, reheat my chicken to 160 degrees.

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

Reportable properties

The Alexa.Cooking.FoodTemperatureController interface uses the targetFoodTemperature property as the primary property. The targetFoodTemperature property represents the target temperature of a food item that is cooking.

Discovery

You describe endpoints that support Alexa.Cooking.FoodTemperatureController 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 FoodTemperatureController, include a configuration object that contains the following fields.

Field Description Type Required
supportsRemoteStart True if Alexa can start the device after a customer's voice command. When false, Alexa sends the Alexa.CookByFoodTemperature 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. Other cooking modes can be supported by the same appliance through other interfaces. Array of CookingMode values Yes
supportedFoodTemperatureRange The range of temperatures that the device supports for the food. The range is an object that contains a minimumValue and a maximumValue, each of which is a temperature object. If you specify this range in your configuration, Alexa validates the temperature that the user requests. If you don't specify this range, you must validate the temperature that the user requests in your skill. Object No

Discover response example

The following example shows a Discover.Response message for a microwave that supports the FoodTemperatureController, FoodTemperatureSensor, 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": "Oven",
          "displayCategories": ["OVEN"],
          "cookie": {},
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.Cooking.FoodTemperatureController",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "targetFoodTemperature"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              },
              "configuration": {
                "supportsRemoteStart": false,
                "supportedCookingModes": [
                  "BAKE",
                  "ROAST"
                ],
                "supportedFoodTemperatureRange": {
                  "minimumValue": {
                    "value": 90,
                    "scale": "FAHRENHEIT"
                  },
                  "maximumValue": {
                    "value": 210,
                    "scale": "FAHRENHEIT"
                  }
                }
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.Cooking.FoodTemperatureSensor",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "foodTemperature"
                  }
                ],
                "proactivelyReported": false,
                "retrievable": 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", "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.FoodTemperatureController interface directives to your skill.

CookByFoodTemperature directive

Support the Alexa.CookByFoodTemperature directive so that customers can start a cooking session and specify the temperature of the food.

The following examples show customer utterances:

Alexa, bake my roast to 125 degrees.
Alexa, reheat my chicken to 160 degrees.

CookByFoodTemperature directive example

The following example illustrates a Alexa.CookByFoodTemperature directive that Alexa sends to your skill.

{
  "directive": {
    "header": {
      "namespace": "Alexa.Cooking.FoodTemperatureController",
      "name": "CookByFoodTemperature",
      "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": {
      "targetFoodTemperature": {
          "value": 125,
          "scale": "FAHRENHEIT"
      },
      "cookingMode": {
        "BAKE"
      },
      "foodItem": {
          "foodName": "Roast"
      }
    }
  }
}

CookByFoodTemperature directive payload

The following table shows the payload details for the SetTemperatureScale directive that Alexa sends to your skill.

Property Description Type Required

targetFoodTemperature

Target temperature that the food must reach.

Temperature object

Yes

cookingMode

Mode for the cooking session, such as BROIL. Included only if the user specifies it. If not present, choose the default cooking mode for the device, such as BAKE.

CookingMode object

No

foodItem

Food to cook. Included only if the user specifies it.

FoodItem object

No

CookByFoodTemperature response

If you handle a Alexa.CookByFoodTemperature 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 Alexa.CookByFoodTemperature 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.

You must include the cookingMode property. You must include the targetFoodTemperature property unless the cookingMode is OFF.

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.FoodTemperatureController",
          "name": "targetFoodTemperature",
          "value": {
              "value": 125,
              "scale": "FAHRENHEIT"
          },
          "timeOfSample": "2019-11-11T21:20:45Z",
          "uncertaintyInMilliseconds": 0
      },
      {
        "namespace": "Alexa.Cooking.FoodTemperatureSensor",
        "name": "foodTemperature",
        "value": {
          "value": 125,
          "scale": "FAHRENHEIT"
        },
        "timeOfSample": "2019-11-11T21:20:45Z",
        "uncertaintyInMilliseconds": 0
      },
      {
         "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
      }
    ]
  }
}

CookByFoodTemperature directive error handling

If you can't handle a Alexa.CookByFoodTemperature 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 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.FoodTemperatureController",
          "name": "targetFoodTemperature",
          "value": {
              "value": 125,
              "scale": "FAHRENHEIT"
          },
          "timeOfSample": "2019-11-11T21:20:45Z",
          "uncertaintyInMilliseconds": 0
      },
      {
        "namespace": "Alexa.Cooking.FoodTemperatureSensor",
        "name": "foodTemperature",
        "value": {
          "value": 125,
          "scale": "FAHRENHEIT"
        },
        "timeOfSample": "2019-11-11T21:20:45Z",
        "uncertaintyInMilliseconds": 0
      },
      {
         "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
      }
    ]
  }
}

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": "PERIODIC_POLL"
        },
        "properties": [
          {
              "namespace": "Alexa.Cooking.FoodTemperatureController",
              "name": "targetFoodTemperature",
              "value": {
                  "value": 125,
                  "scale": "FAHRENHEIT"
              },
              "timeOfSample": "2019-11-11T21:20:45Z",
              "uncertaintyInMilliseconds": 0
          },
          {
            "namespace": "Alexa.Cooking.FoodTemperatureSensor",
            "name": "foodTemperature",
            "value": {
              "value": 125,
              "scale": "FAHRENHEIT"
            },
            "timeOfSample": "2019-11-11T21:20:45Z",
            "uncertaintyInMilliseconds": 0
          },
          {
             "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
          }
        ]
      }
    }
  },
  "context": {
    "namespace": "Alexa.EndpointHealth",
    "name": "connectivity",
    "value": {
      "value": "OK"
    },
    "timeOfSample": "2019-11-11T21:20:45Z",
    "uncertaintyInMilliseconds": 0
  }
}
}

AddOrUpdateReport

You must proactively send an Alexa.Discovery.AddOrUpdateReport message if the feature support of your endpoint changes. For example, if the user changes the temperature scale from FAHRENHEIT to CELSIUS, or vice-versa, you must send an AddOrUpdateReport message. For more details, see AddOrUpdateReport event.

AddOrUpdateReport event example

Copied to clipboard.

{
  "event": {
    "header": {
      "namespace": "Alexa.Discovery",
      "name": "AddOrUpdateReport",
      "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": "Oven",
          "displayCategories": ["OVEN"],
          "cookie": {},
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.Cooking.FoodTemperatureController",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "targetFoodTemperature"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              },
              "configuration": {
                "supportsRemoteStart": false,
                "supportedCookingModes": [
                  "BAKE",
                  "ROAST"
                ],
                "supportedFoodTemperatureRange": {
                  "minimumValue": {
                    "value": 30,
                    "scale": "CELSIUS"
                  },
                  "maximumValue": {
                    "value": 100,
                    "scale": "CELSIUS"
                  }
                }
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.Cooking.FoodTemperatureSensor",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "foodTemperature"
                  }
                ],
                "proactivelyReported": false,
                "retrievable": true
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.Cooking",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "cookingMode"
                  },
                  {
                    "name": "cookingTimeInterval"
                  },
                  {
                    "name": "foodItem"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              },
              "configuration": {
                "supportsRemoteStart": false,
                "supportedCookingModes": ["REHEAT", "DEFROST", "OFF"]
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa",
              "version": "3"
            }
          ]
        }
      ]
    }
  }
}

Was this page helpful?

Last updated: Nov 22, 2023