Ti ringraziamo per la visita. Questa pagina è per il momento disponibile solo in inglese.

Alexa.Cooking.TemperatureSensor Interface

Implement the Alexa.Cooking.TemperatureSensor capability interface for endpoints that sense the current temperature of a cooking appliance, such as an oven. If you want to sense the current temperature of a food that is cooking, use the FoodTemperatureSensor interface instead. Typically you use the TemperatureSensor interface in conjunction with the TemperatureController (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.TemperatureSensor interface, see List of Capability Interfaces and Supported Locales.

Utterances

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

Alexa, what is the current temperature in the oven?

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

Properties

The Alexa.Cooking.TemperatureSensor interface uses the cookingTemperature as the primary property. The cookingTemperature property represents the current temperature of a cooking appliance.

Discovery

You describe endpoints that support Alexa.Cooking.TemperatureSensor 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 TemperatureSensor, TemperatureController, 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.TemperatureSensor",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "cookingTemperature"
                  }
                ],
                "proactivelyReported": false,
                "retrievable": true
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.Cooking.TemperatureController",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "targetCookingTemperature"
                  },
                  {
                    "name": "preheatTimeInterval"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              },
              "configuration": {
                "supportsRemoteStart": false,
                "supportedCookingModes": [
                  "BAKE",
                  "ROAST"
                ],
                "supportedCookingTemperatureRange": {
                  "minimumValue": "80 °C",
                  "maximumValue": "250 °C"
                }
              }
            },
            {
              "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 examples show customer utterances:

Alexa, what is the current temperature in the oven?

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.TemperatureController",
          "name": "targetCookingTemperature",
          "value": {
              "value": 325,
              "scale": "FAHRENHEIT"
          },
          "timeOfSample": "2019-11-11T21:20:45Z",
          "uncertaintyInMilliseconds": 0
      },
      {
          "namespace": "Alexa.Cooking.TemperatureController",
          "name": "preheatTimeInterval",
          "value": {
            "start": "2019-11-11T20:30:00Z",
            "end": "2019-11-11T21:00:00Z"
          },
          "timeOfSample": "2019-11-11T21:20:45Z",
          "uncertaintyInMilliseconds": 0
      },
      {
        "namespace": "Alexa.Cooking.TemperatureSensor",
        "name": "cookingTemperature",
        "value": {
          "value": 325,
          "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
      }
    ]
  }
}

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.TemperatureController",
              "name": "targetCookingTemperature",
              "value": {
                  "value": 325,
                  "scale": "FAHRENHEIT"
              },
              "timeOfSample": "2019-11-11T21:20:45Z",
              "uncertaintyInMilliseconds": 0
          },
          {
              "namespace": "Alexa.Cooking.TemperatureController",
              "name": "preheatTimeInterval",
              "value": {
                "start": "2019-11-11T20:30:00Z",
                "end": "2019-11-11T21:00:00Z"
              },
              "timeOfSample": "2019-11-11T21:20:45Z",
              "uncertaintyInMilliseconds": 0
          },
          {
            "namespace": "Alexa.Cooking.TemperatureSensor",
            "name": "cookingTemperature",
            "value": {
              "value": 325,
              "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": {}
}