Alexa.RangeController Interface 3


Implement the Alexa.RangeController interface in your Alexa skill so that users can control the device settings represented by numbers within a minimum and maximum range. You can use the Alexa.RangeController interface to model properties of a device that the user can set to one of a range of values, such as the speed settings on a blender or a fan. The Alexa.RangeController interface is a generic controller interface.

The Alexa.RangeController interface is highly configurable and enables you to model many different kinds of settings for many different kinds of devices. Use one of the following more specific interfaces if it's appropriate for your device:

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

The Alexa.RangeController interface uses the pre-built voice interaction model. After the user says one of the following utterances, Alexa sends a corresponding directive to your skill.

The following examples show some user utterances:

Alexa, set the bedroom fan speed to 7.
Alexa, set the fan speed on the bedroom fan to maximum.
Alexa, turn up the bedroom fan speed.
Alexa, decrease the fan speed on the bedroom fan by 3.
Alexa, what's the bedroom fan speed?

Alexa, stelle die Lüftergeschwindigkeit im Schlafzimmer auf 7.
Alexa, stelle die Lüftergeschwindigkeit auf dem Schlafzimmerventilator auf maximum.
Alexa, erhöhe die Geschwindigkeit des Schlafzimmerlüfters.
Alexa, verringere die Lüftergeschwindigkeit auf Schlafzimmerlüfter um drei.
Alexa, was ist die Lüftergeschwindigkeit im Schlafzimmer?

Alexa, règle la vitesse du ventilateur de la chambre à sept.
Alexa, règle la vitesse du ventilateur de la chambre au maximum.
Alexa, augmente la vitesse du ventilateur de la chambre.
Alexa, diminue la vitesse du ventilateur de la chambre de trois.
Alexa, quelle est la vitesse du ventilateur de la chambre?

Alexa, बेडरूम के पंखे की गति 7 पर सेट करें
Alexa, बेडरूम के पंखे पर पंखे की गति को अधिकतम पर सेट करें
Alexa, bedroom के पंखे की गति बढ़ाओ।
Alexa,बेडरूम के पंखे पर पंखे की गति 3 कम करें
Alexa,बेडरूम के पंखे की गति क्या है?

Alexa, imposta la velocità della ventola della camera da letto su 7.
Alexa, imposta al massimo la velocità della ventola della camera da letto.
Alexa, aumenta la velocità della ventola della camera da letto.
Alexa, riduci di 3 la velocità della ventola della camera da letto.
Alexa, qual è la velocità della ventola della camera da letto?

アレクサ、扇風機の風量を7にして
アレクサ、扇風機の風量を最大にして
アレクサ、扇風機の風量を上げて
アレクサ、扇風機の風量を3弱めて
アレクサ、扇風機の風量は?

Alexa, mude a velocidade do ventilador do quarto para 7.
Alexa, coloque a velocidade do ventilador do quarto ao máximo.
Alexa, aumente a velocidade do ventilador do quarto.
Alexa, diminua a velocidade do ventilador do quarto em 3.
Alexa, qual é a velocidade do ventilador do quarto?

Alexa, pon la velocidad del ventilador del dormitorio en 7.
Alexa, pon la velocidad del ventilador del dormitorio al máximo.
Alexa, sube la velocidad del ventilador del dormitorio.
Alexa, reduce la velocidad del ventilador del dormitorio en 3.
Alexa, reduce la velocidad del ventilador del dormitorio a 3.
Alexa, ¿cuál es la velocidad del ventilador del dormitorio?

You can optionally enable additional utterances by using semantics. The following examples show some additional user utterances:

Alexa, raise the living room blinds.
Alexa, lower the living room blinds.
Alexa, open the bedroom blinds.
Alexa, close the bedroom blinds.

Alexa, fahre die Rollläden im Wohnzimmer hoch.
Alexa, fahre die Rollläden im Wohnzimmer runter.
Alexa, öffne das Rollo in der Küche.
Alexa, schließe das Rollo in der Küche.

Alexa, monte les stores de la chambre.
Alexa, baisse les stores du salon.
Alexa, ouvre les stores de la chambre.
Alexa, ferme les stores de la chambre.

Alexa, लिविंग रूम ब्लाइंड्स उठाओ।
Alexa, लिविंग रूम ब्लाइंड्स को नीचे करो।
Alexa, बेडरूम ब्लाइंड्स खोलो।
Alexa, बेडरूम ब्लाइंड्स बंद करो।

Alexa, alza le tapparelle del soggiorno.
Alexa, abbassa le tapparelle del soggiorno.
Alexa, apri le persiane della camera da letto.
Alexa, chiudi le persiane della camera da letto.

アレクサ、ブラインドを上げて
アレクサ、ブラインドを下げて
アレクサ、カーテンを開いて
アレクサ、カーテンを閉じて

Alexa, suba as persianas do sala de estar.
Alexa, baixe as persianas da sala de estar.
Alexa, abra as persianas do quarto.
Alexa, feche as persianas do quarto.

Alexa, sube las persianas de la sala.
Alexa, baja las persianas de la sala.
Alexa, abre las persianas del dormitorio.
Alexa, cierra las persianas del dormitorio.

Properties and objects

The Alexa.RangeController interface defines the following properties and objects.

RangeValue property

The Alexa.RangeController interface uses the rangeValue property as the primary property. The property values are numbers, and you specify the minimum value, maximum value, and precision in your discover response. If you use the rangeValue property to represent a change, valid values include negative numbers.

An endpoint can support multiple range controllers. To distinguish between range controllers, you must always include the instance attribute for a rangeValue property. You identify your instance names in your discovery response.

The following example shows an instance of fan speed with a range .

Copied to clipboard.

{
  "namespace": "Alexa.RangeController",
  "instance": "Fan.Speed",
  "name": "rangeValue",
  "value": 10
}

Preset object

The Preset object represents a preset value for a range.

The following example shows three Preset objects in a presets array. The presets represent low, medium, and high values for a range of 1 — 10.

Copied to clipboard.

"presets": [
  {
    "value": 1,
    "presetResources": {
    }
  },
  {
    "value": 5,
    "presetResources": {
    }
  },
  {
    "value": 10,
    "presetResources": {
    }
  }
]
Field Description Type
rangeValue Value in the range for the preset. Integer
presetResources Friendly names that users can use to interact with the preset value. PresetResources object

PresetResources object

Use the PresetResources object to provide a set of friendly names that users can use to interact with preset values. The first friendly name is the name that appears in the Alexa app. For details, see Resources and Assets.

The following example shows the preset resources for the high setting on a fan. Users can say phrases like "Alexa, set the fan to fast."

Copied to clipboard.

"presetResources":
{
  "friendlyNames": [
    {
      "@type": "asset",
      "value": {
        "assetId": "Alexa.Value.Maximum"
      }
    },
    {
      "@type": "asset",
      "value": {
        "assetId": "Alexa.Value.High"
      }
    },
    {
      "@type": "text",
      "value": {
        "text": "Highest",
        "locale": "en-US"
      }
    },
    {
      "@type": "text",
      "value": {
        "text": "Fast",
        "locale": "en-US"
      }
    },
    {
      "@type": "text",
      "value": {
        "text": "Alta",
        "locale": "es-MX"
      }
    },
    {
      "@type": "text",
      "value": {
        "text": "Élevée",
        "locale": "fr-CA"
      }
    }
  ]
}

Semantics

Use semantics to enable additional features, such as additional user utterances and announcements when your device requires attention. To use semantics, include a semantics object in your discover response as described in the discovery section.

Use semantics to enable additional utterances

When you use the Alexa.RangeController interface, the voice interaction model is already built for you. Users can interact with your device by saying the standard Alexa.RangeController utterances. For details, see utterances.

You can optionally enable additional utterances by using semantics. When you use semantics, you manually map the phrases "open", "close", "raise", and "lower" to the Alexa.RangeController directives SetRangeValue and AdjustRangeValue. For example, if you have a controller for a window shade, you can map the phrase "raise" to the AdjustRangeValue directive.

Use semantics to enable announcements

You can use semantics to enable announcements to the user when your device requires attention. Announcements take the form, Your <device friendly name>'s <instance friendly name> is <state>. For example, when the bin of their automatic vacuum cleaner is full, Alexa notifies the user with the following announcement: "Your vacuum's bin is full."

To enable announcements, implement the Alexa.ProactiveNotificationSource interface in your Alexa skill. To indicate the states that you support, include a semantics object in your discovery response to map the rangeValue property to one of the Alexa.States values, such as Alexa.States.Full. You trigger announcements by sending an Alexa.ChangeReport to report a change in the device state. For more details about announcement text, see Alexa.ProactiveNotificationSource.

Discovery

You describe endpoints that support Alexa.RangeController by 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 connected vehicles that use Alexa user identification, include directiveConfigurations in your discovery response to configure the authentication confidence level and policy name. For details, see directiveConfigurations.

You can model properties of an endpoint that users can't change by setting nonControllable to true. Set nonControllable to true for range controller properties that you want to report to the user, but don't want the user to change.

For each Alexa.RangeController entry in the capabilities array, you can optionally include a semantics object. For details, see use semantics to enable additional utterances and use semantics to enable announcements.

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.

Capabilities array

In addition to the usual discovery response fields, for each Alexa.RangeController entry in the capabilities array, include the following fields.

Field Description Type
instance The name of the range.
For example: Fan.Speed, Camera.Pan, Camera.Tilt, Camera.Zoom
String
capabilityResources Friendly names that users can use to interact with the mode.
If you enable announcements for the instance friendly name, include @type set to text.
CapabilityResources object
configuration.
supportedRange.
minimumValue
The minimum value for the range. Number
configuration.
supportedRange.
maximumValue
The maximum value for the range. Number
configuration.
supportedRange.
precision
The amount by which the values change when moving through the range. This also serves as the default when a user asks to change the value but doesn't specify by how much. Number
unitOfMeasure The unit of measure for the range. unit of measure string
presets Named options that users can specify instead of numbers, such as "medium" or "maximum". Array of Preset objects

Discovery response examples

Fan example

The following example shows a Discover.Response message for a fan that supports the Alexa.RangeController and Alexa.PowerController interfaces.

Semantics for blinds example

The following example shows a Discover.Response message for blinds that support the Alexa.RangeController interface and uses semantics. Use the Alexa.RangeController interface for blinds that can raise and lower to a range of positions. If your blinds only fully open and fully close, use the ModeController interface instead.

You can use the Alexa.RangeController interface for your skills that control blinds in the following locales: de-DE, en-AU, en-CA, en-GB, en-IN, en-US, es-ES, es-MX, es-US, fr-CA, fr-FR, hi-IN, it-IT, ja-JP, pt_BR.

Range and toggle controllers example

The following example shows a Discover.Response message for a fan that supports the PowerController interface and both the Alexa.RangeController and ToggleController interfaces.

Directives

Alexa sends the following Alexa.RangeController interface directives to your skill.

SetRangeValue directive

Support the SetRangeValue directive so that users can set the level of features on devices.

The following examples show user utterances:

Alexa, set the bedroom fan speed to 7.
Alexa, set the fan speed on the bedroom fan to maximum.

Alexa, stelle die Lüftergeschwindigkeit im Schlafzimmer auf 7.
Alexa, stelle die Lüftergeschwindigkeit auf dem Schlafzimmerventilator auf maximum.

Alexa, règle la vitesse du ventilateur de la chambre à sept.
Alexa, règle la vitesse du ventilateur de la chambre au maximum.

Alexa, बेडरूम के पंखे की गति 7 पर सेट करें
Alexa, बेडरूम के पंखे पर पंखे की गति को अधिकतम पर सेट करें

Alexa, imposta la velocità della ventola della camera da letto su 7.
Alexa, imposta al massimo la velocità della ventola della camera da letto.

アレクサ、扇風機の風量を7にして
アレクサ、扇風機の風量を最大にして

Alexa, mude a velocidade do ventilador do quarto para 7.
Alexa, coloque a velocidade do ventilador do quarto ao máximo.

Alexa, pon la velocidad del ventilador del dormitorio en 7.
Alexa, pon la velocidad del ventilador del dormitorio al máximo.

SetRangeValue directive example

The following example shows a SetRangeValue directive that Alexa sends to your skill.

{
  "directive": {
    "header": {
      "namespace": "Alexa.RangeController",
      "instance": "Fan.Speed",
      "name": "SetRangeValue",
      "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": {
      "rangeValue": 7
    }
  }
}

SetRangeValue directive payload

Property Description Type Required

rangeValue

Value to set the feature of the device to.

Number

Yes

SetRangeValue response

If you handle a SetRangeValue directive successfully, respond with an Alexa.Response event. In the context object, include the values of all properties that changed. You can respond synchronously or asynchronously. If you respond asynchronously, include a correlation token and a scope with an authorization token.

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.RangeController",
        "instance": "Fan.Speed",
        "name": "rangeValue",
        "value": 7,
        "timeOfSample": "2017-02-03T16:20:50.52Z",
        "uncertaintyInMilliseconds": 500
      }
    ]
  }
}

SetRangeValue directive error handling

If you can't handle a SetRangeValue directive successfully, respond with an Alexa.ErrorResponse event. If your error is safety related, respond with an Alexa.Safety.ErrorResponse.

AdjustRangeValue directive

Support the AdjustRangeValue directive so that users can adjust the level of features on devices.

The following examples show user utterances:

Alexa, turn up the bedroom fan speed.
Alexa, decrease the fan speed on the bedroom fan by 3.

Alexa, erhöhe die Geschwindigkeit des Schlafzimmerlüfters.
Alexa, verringere die Lüftergeschwindigkeit auf Schlafzimmerlüfter um drei.

Alexa, augmente la vitesse du ventilateur de la chambre.
Alexa, diminue la vitesse du ventilateur de la chambre de trois.

Alexa, bedroom के पंखे की गति बढ़ाओ।.
Alexa,बेडरूम के पंखे पर पंखे की गति 3 कम करें

Alexa, aumenta la velocità della ventola della camera da letto.
Alexa, riduci di 3 la velocità della ventola della camera da letto.

アレクサ、扇風機の風量を上げて
アレクサ、扇風機の風量を3弱めて

Alexa, aumente a velocidade do ventilador do quarto.
Alexa, diminua a velocidade do ventilador do quarto em 3.

Alexa, sube la velocidad del ventilador del dormitorio.
Alexa, reduce la velocidad del ventilador del dormitorio a 3.
Alexa, reduce la velocidad del ventilador del dormitorio en 3.

AdjustRangeValue directive example

The following example shows an AdjustRangeValue directive that Alexa sends to your skill.

{
  "directive": {
    "header": {
      "namespace": "Alexa.RangeController",
      "instance": "Fan.Speed",
      "name": "AdjustRangeValue",
      "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": {
      "rangeValueDelta": -3,
      "rangeValueDeltaDefault": false
    }
  }
}

AdjustRangeValue directive payload

Property Description Type Required

rangeValueDelta

Amount by which to change the feature of the device. If the user doesn't specify the amount, the value defaults to precision.

Number

Yes

rangeValueDeltaDefault

Set to false, if the user specified the amount of the change.

Boolean

Yes

AdjustRangeValue response event

If you handle an AdjustRangeValue directive successfully, respond with an Alexa.Response event. In the context object, include the values of all properties that changed. You can respond synchronously or asynchronously. If you respond asynchronously, include a correlation token and a scope with an authorization token.

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.RangeController",
        "instance": "Fan.Speed",
        "name": "rangeValue",
        "value": 4,
        "timeOfSample": "2017-02-03T16:20:50.52Z",
        "uncertaintyInMilliseconds": 500
      }
    ]
  }
}

AdjustRangeValue directive error handling

If you can't handle an AdjustRangeValue directive successfully, respond with an Alexa.ErrorResponse event. If your error is safety related, respond with an Alexa.Safety.ErrorResponse.

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 the retrievable properties in the context object. You identify your retrievable properties in your discovery response. For details about state reports, see Understand State and Change Reporting.

Support the ReportState directive so that users can ask about the features of their devices.

The following examples show some user utterances:

Alexa, what's the fan speed?

Alexa, was ist die Lüftergeschwindigkeit im Schlafzimmer?

Alexa, quelle est la vitesse du ventilateur de la chambre?

Alexa, पंखे की गति क्या है?

Alexa, qual è la velocità della ventola della camera da letto?

アレクサ、扇風機の風量は?

Alexa, qual é a velocidade do ventilador do quarto?

Alexa, ¿cuál es la velocidad del ventilador del dormitorio?

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.RangeController",
        "instance": "Fan.Speed",
        "name": "rangeValue",
        "value": 4,
        "timeOfSample": "2017-02-03T16:20:50.52Z",
        "uncertaintyInMilliseconds": 500
      },
      {
        "namespace": "Alexa.PowerController",
        "name": "powerState",
        "value": "ON",
        "timeOfSample": "2017-02-03T16:20:50.52Z",
        "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 details about change reports, see Understand State and Change 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": "PHYSICAL_INTERACTION"
        },
        "properties": [
          {
            "namespace": "Alexa.RangeController",
            "instance": "Fan.Speed",
            "name": "rangeValue",
            "value": 10,
            "timeOfSample": "2017-02-03T16:20:50.52Z",
            "uncertaintyInMilliseconds": 500
          },
          {
            "namespace": "Alexa.PowerController",
            "name": "powerState",
            "value": "ON",
            "timeOfSample": "2017-02-03T16:20:50.52Z",
            "uncertaintyInMilliseconds": 0
          }
        ]
      }
    }
  },
  "context": {
    "namespace": "Alexa.EndpointHealth",
    "name": "connectivity",
    "value": {
      "value": "OK"
    },
    "timeOfSample": "2017-02-03T16:20:50.52Z",
    "uncertaintyInMilliseconds": 0
  }
}

Was this page helpful?

Last updated: Jan 26, 2024