Mode

devices.capabilities.mode

Switching device operation modes (for example, switching between air conditioner temperature modes: “Cooling”, “Heating”, or “Auto”).

  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 the fan to automatic.

  2. Yasmina, turn on the vacuum cleaner in express mode.

  3. Yasmina, set the speed to turbo.

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
modes Array of mode objects
The array of mode objects describing the function's modes. Minimum number of modes in the array: 1.
Restriction.

When resending the mode object array for the same device, keep in mind the order of modes. The order must be the same as in the latest array sent.

Yes
The mode object that is a part of the modes array
value String The value of the function operating mode processed on the provider side. You can find the acceptable values on the List of operating modes. Yes
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
modes Array of mode objects
The array of mode objects describing the function's modes. Minimum number of modes in the array: 1.
Restriction.

When resending the mode object array for the same device, keep in mind the order of modes. The order must be the same as in the latest array sent.

Yes
The mode object that is a part of the modes array
value String The value of the function operating mode processed on the provider side. You can find the acceptable values on the List of operating modes. Yes

Example of use

Yango Smart Home requests the details of user devices from the provider. The provider responds that the user has an air conditioner with different temperature modes.

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 String The value of the function operating mode processed on the provider side. You can find the acceptable values on the List of operating modes. 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 String The value of the function operating mode processed on the provider side. You can find the acceptable values on the List of operating modes. 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": "ac-001-xdc",
            "custom_data": {
                "api_location": "rus"
            } 
        }
      ]
    }' 
Copied to clipboard

Change the state of the device capability

The structure is used in the 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 result of changing the state of the capability. Yes
state object
instance String Function name for this capability. You can find the acceptable values in the List of functions section. Yes
action_result Object Result of changing the state of the device capability. No
action_result object
status String Status of the device capability state change. Acceptable values:
  • DONE: The state of the device capability state changed.
  • ERROR: An error occurred when changing the state of the device capability.
Yes
error_code String An error code from the list of errors. If status:"ERROR", the parameter is required. No
error_message String Extended human-readable description of a possible error. It is displayed only in the Testing section of the developer console. No
Parameter Type Description Required
type String Type of capability. Yes
state Object An object that describes the result of changing the state of the capability. Yes
state object
instance String Function name for this capability. You can find the acceptable values in the List of functions section. Yes
action_result Object Result of changing the state of the device capability. No
action_result object
status String Status of the device capability state change. Acceptable values:
  • DONE: The state of the device capability state changed.
  • ERROR: An error occurred when changing the state of the device capability.
Yes
error_code String An error code from the list of errors. If status:"ERROR", the parameter is required. No
error_message String Extended human-readable description of a possible error. It is displayed only in the Testing section of the developer console. 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": "ac-001-xdc",
            "custom_data": {
                "api_location": "rus"
            },
            "capabilities": [{
                "type": "devices.capabilities.mode",
                "state": {
                    "instance": "thermostat",
                    "value": "heat"
                }
            }]
        }]
      }
    }'
Copied to clipboard

Support