Range

devices.capabilities.range

Control of device parameters that have a range of values. For example, the brightness of a lamp, the volume of sound, or the temperature of a heater.

  1. Common voice commands
  2. Description of capability
  3. Current capability state
  4. Change the state of the device capability

Common voice commands

  1. Yasmina, set humidity in the nursery at 55%.

  2. Yasmina, turn down the light in the bedroom.

  3. Yasmina, turn up the volume by 10.

  4. Yasmina, put the TV on the second channel.

Description of capability

The structure is used in the response to the Information about user devices operation.

  1. Capability parameters
  2. Example of use

Capability parameters

Parameter Type Description Required
type String Type of capability. Yes
retrievable Boolean If it's possible to request the state of this device capability. Acceptable values:
  • true: A state request is available for the capability. Default value.
  • false: A state request is not available for the capability.
No
reportable Boolean Indicates that the notification service reports the capability state change. Acceptable values:
  • true: Notification is enabled. The manufacturer notifies Yango Smart Home of every change in the capability state.
  • false: Notification is disabled. The manufacturer doesn't notify Yango Smart Home of the capability state change. Default value.
No
parameters Object parameters object. Yes
parameters object
instance String Function name for this capability. You can find the acceptable values in the List of functions section. Yes
unit String Function value units. You can find the acceptable values in the List of functions section. No
random_access Boolean

Setting arbitrary function values. If this feature is disabled, the user can only change the values gradually, either up or down. For example, turning the TV volume up or down via an IR remote.

Acceptable values:

  • true: Setting arbitrary values is enabled.
  • false: The feature is disabled.

Default value: true.

No
range Object Object that describes the range of function values. No
range object
min Float Minimum acceptable value. The value varies depending on the function of the skill. Read more on the List of functions. No
max Float Maximum acceptable value. The value varies depending on the capability function. Read more on the List of functions. No
precision Float The minimum step between values in the range. The default value is 1. No
Parameter Type Description Required
type String Type of capability. Yes
retrievable Boolean If it's possible to request the state of this device capability. Acceptable values:
  • true: A state request is available for the capability. Default value.
  • false: A state request is not available for the capability.
No
reportable Boolean Indicates that the notification service reports the capability state change. Acceptable values:
  • true: Notification is enabled. The manufacturer notifies Yango Smart Home of every change in the capability state.
  • false: Notification is disabled. The manufacturer doesn't notify Yango Smart Home of the capability state change. Default value.
No
parameters Object parameters object. Yes
parameters object
instance String Function name for this capability. You can find the acceptable values in the List of functions section. Yes
unit String Function value units. You can find the acceptable values in the List of functions section. No
random_access Boolean

Setting arbitrary function values. If this feature is disabled, the user can only change the values gradually, either up or down. For example, turning the TV volume up or down via an IR remote.

Acceptable values:

  • true: Setting arbitrary values is enabled.
  • false: The feature is disabled.

Default value: true.

No
range Object Object that describes the range of function values. No
range object
min Float Minimum acceptable value. The value varies depending on the function of the skill. Read more on the List of functions. No
max Float Maximum acceptable value. The value varies depending on the capability function. Read more on the List of functions. No
precision Float The minimum step between values in the range. The default value is 1. No

Example of use

Yango Smart Home requests the details of user devices from the provider. The provider responds that the user has a light bulb with brightness control.

curl -i -X GET 'https://example.com/v1.0/user/devices' \
-H 'Authorization: Bearer 123qwe456a...' \
-H 'X-Request-Id: ff36a3cc-ec...'
Copied to clipboard

Current capability state

The structure is used in the response to the Information about the states of user devices operation and in the request body of the Notification about device state change operation.

  1. Capability parameters
  2. Example of use

Capability parameters

Parameter Type Description Required
type String Type of capability. Yes
state Object Capability state parameters. Yes
state object
instance String Function name for this capability. You can find the acceptable values in the List of functions section. Yes
value Float Function value for this capability. Yes
Parameter Type Description Required
type String Type of capability. Yes
state Object Capability state parameters. Yes
state object
instance String Function name for this capability. You can find the acceptable values in the List of functions section. Yes
value Float Function value for this capability. Yes

Example of use

Yango Smart Home requests the provider to change the state of the user device. The provider responds with the state of the user device.

curl -i -X POST 'https://example.com/v1.0/user/devices/query' \
-H 'Authorization: Bearer 123qwe456a...' \
-H 'X-Request-Id: ff36a3cc-ec...' \
-H 'Content-Type: application/json' \
-d '{
      "devices": 
      [
        {
            "id": "lamp-001-xdl",
            "custom_data": {
                "api_location": "rus"
            } 
        }
      ]
    }' 
Copied to clipboard

Change the state of the device capability

The structure is used in the request/response to the Change device state operation.

Capability parameters

Parameter Type Description Required
type String Type of capability. Yes
state Object An object that describes the necessary changes for the capability state. Yes
state object
instance String Function name for this capability. You can find the acceptable values in the List of functions section. Yes
value Float Function value for this capability. Yes
relative Boolean
The method to calculate the function value for the skill.
  • true: The new function value is calculated from the current value by incrementing it by value.
  • false: The skill function is set to value.
By default: false.
No
Parameter Type Description Required
type String Type of capability. Yes
state Object An object that describes the necessary changes for the capability state. Yes
state object
instance String Function name for this capability. You can find the acceptable values in the List of functions section. Yes
value Float Function value for this capability. Yes
relative Boolean
The method to calculate the function value for the skill.
  • true: The new function value is calculated from the current value by incrementing it by value.
  • false: The skill function is set to value.
By default: false.
No

Example of use

Yango Smart Home requests the provider to change the state of the user's devices. The provider responds with the result of user device state change.

curl -i -X POST 'https://example.com/v1.0/user/devices/action' \
-H 'Authorization: Bearer 123qwe456a...' \
-H 'X-Request-Id: ff36a3cc-ec...' \
-H 'Content-Type: application/json' \
-d '{
      "payload": {
        "devices": [{
                "id": "lamp-001-xdl",
                "custom_data": {
                    "api_location": "rus"
                },
                "capabilities": [{
                    "type": "devices.capabilities.range",
                    "state": {
                        "instance": "brightness",
                        "value": 50
                    }
                }]
            },
            {
                "id": "lamp-002-xdl",
                "custom_data": {
                    "api_location": "rus"
                },
                "capabilities": [{
                    "type": "devices.capabilities.range",
                    "state": {
                        "instance": "brightness",
                        "relative": true,
                        "value": 10
                    }
                }]
            }
        ]
      }
    }'
Copied to clipboard

Support