Merci de votre visite. Cette page est disponible en anglais uniquement.

Alexa.Cooking.FoodTemperatureSensor Interface

Implement the Alexa.Cooking.FoodTemperatureSensor capability interface for endpoints that sense the current temperature of a food that is cooking, such as when a temperature probe is inserted into food and then placed into an oven. If you want to sense the current temperature of a cooking appliance, use the TemperatureSensor interface instead. Typically you use the FoodTemperatureSensor interface in conjunction with the FoodTemperatureController (optional) and Cooking (mandatory) interfaces. For more information about cooking skills, see Build Smart Home Skills for Cooking Appliances.

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

Utterances

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

Alexa, what's the probe temperature in the oven?
Alexa, what's the chicken temperature?

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

Properties

The Alexa.Cooking.FoodTemperatureSensor interface uses the foodTemperature as the primary property. The foodTemperature property represents the current temperature of a food that is cooking.

Discovery

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

Discover response example

The following example shows a Discover.Response message for a endpoint that supports the FoodTemperatureSensor, FoodTemperatureController, 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": "Oven",
          "displayCategories": ["OVEN"],
          "cookie": {},
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.Cooking.FoodTemperatureSensor",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "foodTemperature"
                  }
                ],
                "proactivelyReported": false,
                "retrievable": true
              }
            },
            {
              "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",
              "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",
              "version": "3"
            }
          ]
        }
      ]
    }
  }
}

State reporting

Support the ReportState directive so that customers can ask about the temperature of their cooking appliance.

The following example shows a customer utterance:

Alexa, what's the chicken temperature?

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.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",
            "foodCategory": "MEAT",
            "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
      }
    ]
  }
}

ReportState error handling

If you can't handle a ReportState directive successfully, such as when the temperature sensor is unable to sense the food temperature, 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.

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