Alexa.Cooking.FoodTemperatureSensor Interface 3
Implement the Alexa.Cooking.FoodTemperatureSensor
interface in your Alexa skill for devices that sense the current temperature of a food that's cooking. For example, a temperature probe that's 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 details about cooking skills, see Build Smart Home Skills for Cooking Appliances.
For the list of languages that the FoodTemperatureSensor
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.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.
Reportable 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.
cookingTemperature
property and the TemperatureSensor interface instead.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 an oven that supports the FoodTemperatureSensor
, FoodTemperatureController, and Cooking interfaces.
{
"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.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 details about state reports, see Understand State Reporting.
OFF
, include the cooking mode property but no other properties in your StateReport
response.StateReport response example
{
"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:52.32Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.Cooking.FoodTemperatureSensor",
"name": "foodTemperature",
"value": {
"value": 125,
"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
}
]
}
}
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 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.
OFF
, include the cooking mode property but no other properties in your ChangeReport
.ChangeReport event example
{
"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:52.32Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.Cooking.FoodTemperatureSensor",
"name": "foodTemperature",
"value": {
"value": 125,
"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.12Z",
"uncertaintyInMilliseconds": 0
}
]
}
}
},
"context": {
"namespace": "Alexa.EndpointHealth",
"name": "connectivity",
"value": {
"value": "OK"
},
"timeOfSample": "2019-11-11T21:00:52.12Z",
"uncertaintyInMilliseconds": 0
}
}
}
Related topics
- Alexa.Cooking.PresetController
- Alexa.Cooking.TemperatureController
- Alexa.Cooking.TimeController
- Alexa.TimeHoldController
Last updated: Aug 23, 2024