终端能力与状态

优质
小牛编辑
130浏览
2023-12-01

1.1.1. 目录

1.1.2. 终端能力

终端能力 Interface 代表终端具备的变化状态值。

当这个能力可以问询时(isRetrievable),除了可以通过向若琪控制:"帮我把灯调为红色",将 Color 设置为红色,还可以通向若琪问询:"这个现在是什么颜色",若琪播报"这个灯现在是红色"。当这个能力会主动推送状态时(isProactivelyReported),那么就可以将这个终端状态作为一个自动化操作的触发器, 如一个自动化操作是"当在早上家门关闭时, 关闭家里所有灯",那么就需要有一个家门的开关(Switch )可以主动推送状态( isProactivelyReported),当在早上它的值设为Switch.Off时, 该自动化操作就会被触发。类似的,如果我们有一个温度传感器,而且他的温度( Temperature)能够主动推送( isProactivelyReported)我们就可以设置一个自动化场景:"当室内高于25摄氏度时,开启电风扇"。

终端能力的状态值可以是 number 与 enum 或者特殊描述符类型;

  • Number类型接口: 可以具有 Set 和 Adjust 控制命令;Set 为设为绝对期望值, Adjust为 delta 如 +1, -1 等相对值
    • Percentage: 取值 0 到 100, Adjust 默认步长为 10
    • RGB: 取值 0 到 0xFFFFFF
      • Enum 类型接口: 具体的 Enum 值即为命令(相当于 Set 但是枚举了所有值)
      • 描述符类型接口:是值的说法无法枚举、也不是 Number 类型的类型, 如歌曲、电视频道, 具有 Set控制命令

Beta 版尚不支持向若琪问询终端状态

Switch 开关状态

类型: Enum

可对应说法: 若琪, 开灯;若琪, 关灯

命令描述
Switch.On打开终端
Switch.Off关闭终端

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Switch.On",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}

MotionSwitch 行为状态

类型: Enum

可对应说法: 若琪, 开灯;若琪, 关灯

可以与 Switch 组合成:若琪,开窗;(窗户正在打开,3秒后) 若琪,停下

命令描述
MotionSwitch.On终端开始运动
MotionSwitch.Off终端停止运动

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "MotionSwitch.On",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}

Position 位置百分比状态

类型: percentage

可对应说法: 若琪, 把窗户开到一半

命令描述
Position.Set设置为指定值
Position.Adjust通过相对值调整
Set Payload
字段类型描述
valuenumber百分比

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Position.Set",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
    "value": 20
  }
}
Adjust Payload
字段类型描述
deltanumber相对值

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Position.Adjust",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
    "delta": -1
  }
}

Color 颜色状态

类型: Number

可对应说法: 若琪, 把灯调为红色

命令描述
Color.Set设置为指定值
Color.SetRandom由 Skill 设置一个随机色值
Set Payload
字段类型描述
valuenumber颜色 RGB (0x000000-0xFFFFFF) 对应的十进制数值

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Color.Set",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
    "value": 255
  }
}
SetRandom Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Color.SetRandom",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}

ColorTemperature 色温状态

类型: percentage

可对应说法: 若琪, 把灯颜色调暖点;若琪, 把灯调为冷色

命令描述
ColorTemperature.Set
ColorTemperature.SetMax
ColorTemperature.SetMin
ColorTemperature.Adjust
Set Payload
字段类型描述
valuenumber百分比

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "ColorTemperature.Set",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
    "value": 20
  }
}
SetMax Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "ColorTemperature.SetMax",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}
SetMin Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "ColorTemperature.SetMin",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
    "delta": -1
  }
}
Adjust Payload
字段类型描述
deltanumber相对值

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "ColorTemperature.Adjust",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
    "delta": -1
  }
}

Brightness 亮度状态

类型: percentage

可对应说法: 若琪, 把灯调亮点;若琪, 把灯亮度设到百分之五十

命令描述
Brightness.Set
Brightness.SetMax
Brightness.SetMin
Brightness.Adjust
Set Payload
字段类型描述
valuenumber百分比

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Brightness.Set",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
    "value": 20
  }
}
SetMax Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Brightness.SetMax",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}
SetMin Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Brightness.SetMin",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}
Adjust Payload
字段类型描述
deltanumber相对值

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Brightness.Adjust",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
    "delta": -1
  }
}

Mode 模式状态

类型: enum

可对应说法: 若琪, 把空调设为制冷模式

命令描述
Mode.Auto自动模式
Mode.Manual手动模式
Mode.Cool制冷模式
Mode.Heat制热模式
Mode.Dry除湿模式
Mode.Fan送风模式
Mode.Silent静音模式
Mode.Energy省电模式
Mode.Sleep睡眠模式

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Mode.Auto",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}

SwingMode 转向状态

类型: enum

可对应说法: 若琪, 打开风扇转向

命令描述
SwingMode.Auto
SwingMode.On
SwingMode.Off
SwingMode.Horizon
SwingMode.HorizonOff
SwingMode.Vertical
SwingMode.VerticalOff

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "SwingMode.Auto",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}

Humidity 湿度状态

类型: percentage, unit: relative humidity

可对应说法: 若琪, 加湿器调大点;若琪, 加湿器设到五十

命令描述
Humidity.Set
Humidity.SetMax
Humidity.SetMin
Humidity.Adjust
Set Payload
字段类型描述
valuenumber百分比

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Humidity.Set",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
    "value": 20
  }
}
SetMax Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Humidity.SetMax",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}
SetMin Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Humidity.SetMin",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}
Adjust Payload
字段类型描述
deltanumber相对值

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Humidity.Adjust",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
    "delta": -1
  }
}

Temperature 温度状态

类型: number, Unit: Celsius

可对应说法: 若琪, 空调调高点

命令描述
Temperature.Set
Temperature.SetMax
Temperature.SetMin
Temperature.Adjust
Set Payload
字段类型描述
valuenumber百分比

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Temperature.Set",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
    "value": 20
  }
}
SetMax Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Temperature.SetMax",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}
SetMin Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Temperature.SetMin",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}
Adjust Payload
字段类型描述
deltanumber相对值

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Temperature.Adjust",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
    "delta": -1
  }
}

FanSpeed 风速状态

类型: percentage

可对应说法: 若琪, 空调风大点

命令描述
FanSpeed.Set设置风速到指定百分比
FanSpeed.SetMax调到最大风速
FanSpeed.SetMin设置最低风速
FanSpeed.Adjust调整风速
FanSpeed.SetHigh调到高风模式
FanSpeed.SetLow调到低风模式
FanSpeed.SetMedium调到中风模式
Set Payload
字段类型描述
valuenumber百分比

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "FanSpeed.Set",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
    "value": 20
  }
}
SetMax Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "FanSpeed.SetMax",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}
SetMin Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "FanSpeed.SetMin",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}
Adjust Payload
字段类型描述
deltanumber相对值

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "FanSpeed.Adjust",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
    "delta": -1
  }
}
SetHigh Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "FanSpeed.SetHigh",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}
SetLow Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "FanSpeed.SetLow",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}
SetMedium Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "FanSpeed.SetMedium",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}

Mute 静音状态

类型: enum

可对应说法: 若琪, 电视静音; 若琪,电视取消静音。

命令描述
Mute.On设置静音
Mute.Off取消静音
On Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Mute.On",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
  }
}
Off Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Mute.Off",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
  }
}

Volume 音量状态

类型: percentage

可对应说法: 若琪, 电视音量大点

命令描述
Volume.Set设置音量
Volume.SetMax调到最大音量
Volume.SetMin调到最小音量
Volume.Adjust调节音量
Set Payload
字段类型描述
valuenumber百分比

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Volume.Set",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
    "value": 20
  }
}
SetMax Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Volume.SetMax",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}
SetMin Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Volume.SetMin",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}
Adjust Payload
字段类型描述
deltanumber相对值

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Volume.Adjust",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
    "delta": -1
  }
}

Media.TVChannel 频道状态

类型: channel descriptor

可对应说法: 若琪, 湖南卫视

当前的播放频道, 可以预置一系列的频道码, 如 CCTV第一频道 为 CCTV1

命令描述
Media.TVChannel.Next
Media.TVChannel.Previous
Media.TVChannel.Set
字段名类型描述
tvChannel.namestring
tvChannel.codestring
Set Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Media.TVChannel.Set",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {
    "tvChannel": {
      "name": "芒果台",
      "code": "123"
    }
  }
}
Previous Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Media.TVChannel.Previous",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}
Next Payload

命令示例:

{
  "header": {
    "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    "namespace": "Rokid.Control",
    "name": "Media.TVChannel.Next",
    "payloadVersion": "v1",
    "authorization": {
      "type": "BearerToken",
      "token": "a-token-from-skill"
    }
  },
  "endpoint": {
    "endpointId": "开发者自己定义的终端Id",
    "additionalInfo": {
      "key": "value"
    },
    "states": []
  },
  "payload": {}
}

Media.Music 音乐控制

类型: song descriptor 型: song descriptor

可对应说法: 若琪, 想听Don't You Worry Child

当前播放的媒体信息, 或者没有在播放

命令描述
Media.Music.Next
Media.Music.Previous
Media.Music.Stop
Media.Music.Set
字段名类型描述
music.namestring
music.artiststring
music.albumstring
music.genrestring
music.sourcestring

PlaybackControl 媒体播放状态

类型: enum

可对应说法: 若琪, 暂停音乐

当前播放状态, 如暂停, 正在播放

命令描述
PlaybackControl.Play
PlaybackControl.Pause

PlaybackMode 媒体播放模式状态

类型: enum

可对应说法: 若琪, 单曲循环

当前播放模式, 如列表循环, 随机, 重复单曲, 顺序播放

命令描述
PlaybackMode.RepeatAll
PlaybackMode.RepeatOne
PlaybackMode.Shuffle
PlaybackMode.Order