Alexa.Cooking.TemperatureSensor Interface 3


Implement the Alexa.Cooking.TemperatureSensor interface in your Alexa skill for devices 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 details about cooking skills, see Build Smart Home Skills for Cooking Appliances.

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

Reportable 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 device that supports the TemperatureSensor, TemperatureController, 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.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"]
              }
            }
          ]
        }
      ]
    }
  }
}

Directives

The Alexa.Cooking.TemperatureSensor interface doesn't define any directives.

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 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.TemperatureController",
          "name": "targetCookingTemperature",
          "value": {
              "value": 325,
              "scale": "FAHRENHEIT"
          },
          "timeOfSample": "2019-11-11T21:20:52.32Z",
          "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:52.32Z",
          "uncertaintyInMilliseconds": 0
      },
      {
        "namespace": "Alexa.Cooking.TemperatureSensor",
        "name": "cookingTemperature",
        "value": {
          "value": 325,
          "scale": "FAHRENHEIT"
        },
        "timeOfSample": "2019-11-11T21:20:52.32Z",
        "uncertaintyInMilliseconds": 0
      },
      {
         "namespace": "Alexa.Cooking",
         "name": "cookingMode",
         "value": "BAKE",
         "timeOfSample": "2019-11-11T21:20:52.32Z",
         "uncertaintyInMilliseconds": 0
      },
      {
         "namespace": "Alexa.Cooking",
         "name": "foodItem",
         "value":{
            "foodName": "Roast",
            "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": "PERIODIC_POLL"
        },
        "properties": [
          {
              "namespace": "Alexa.Cooking.TemperatureController",
              "name": "targetCookingTemperature",
              "value": {
                  "value": 325,
                  "scale": "FAHRENHEIT"
              },
              "timeOfSample": "2019-11-11T21:20:52.32Z",
              "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:52.32Z",
              "uncertaintyInMilliseconds": 0
          },
          {
            "namespace": "Alexa.Cooking.TemperatureSensor",
            "name": "cookingTemperature",
            "value": {
              "value": 325,
              "scale": "FAHRENHEIT"
            },
            "timeOfSample": "2019-11-11T21:20:52.32Z",
            "uncertaintyInMilliseconds": 0
          },
          {
             "namespace": "Alexa.Cooking",
             "name": "cookingMode",
             "value": "BAKE",
             "timeOfSample": "2019-11-11T21:20:52.32Z",
             "uncertaintyInMilliseconds": 0
          },
          {
             "namespace": "Alexa.Cooking",
             "name": "foodItem",
             "value":{
                "foodName": "Roast",
                "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:00:02.12Z",
    "uncertaintyInMilliseconds": 0
  }
}
}

Was this page helpful?

Last updated: Aug 23, 2024