设备控制
电源类的操作
设备打开
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"TurnOn", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"powerstate", "value":"on", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应:
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"TurnOnResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
异常响应:
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"ErrorResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234", "errorCode":"DEVICE_NOT_SUPPORT_FUNCTION", "message":"device not support" } }
关闭设备
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"TurnOff", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"powerstate", "value":"off", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"TurnOffResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
频道类的切换
按照频道名称切换
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SelectChannel", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceType":"XXX", "deviceId":"34234", "attribute":"channel", "value":"浙江卫视", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SelectChannelResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
异常响应:
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"ErrorResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234", "errorCode":"DEVICE_NOT_SUPPORT_FUNCTION", "message":"device not support" } }
按照频道号切台
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SelectChannel", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceType":"XXX", "deviceId":"34234", "attribute":"number", "value":"1", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SelectChannelResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
声音类的控制
按照步长控制音量(加大或减少,默认步长为1)
调大声音
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustUpVolume", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"volumeStep", "value":"1", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustUpVolumeResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
调小声音
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustDownVolume", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"volumeStep", "value":"1", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustDownVolumeResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
直接设置音量达到指定值
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetVolume", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"volume", "value":"20", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetVolumeResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
声音设置成最值(最大、最小)
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetVolume", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"volume", "value":"max", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetVolumeResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
最值 | 说明 |
max | 对应最大值 |
min | 对应最小值 |
静音设置
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetMute", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234" } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetMuteResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
取消静音设置
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"CancelMute", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234" , "deviceType":"XXX", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"CancelMuteResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
播放类的控制
播放
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"Play", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"PlayResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
暂停
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"Pause", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"PauseResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
继续播放
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"Continue", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"ContinueResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
下一首或者下一台
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"Next", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"NextResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
上一首或者上一台
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"Previous", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"PreviousResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
快进播放
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"FastForward", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"forward", "value":"30", // 快进到多少分钟 "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"FastForwardResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
亮度的控制
亮度设置指定值
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetBrightness", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"brightness", "value":"30", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetBrightnessResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
亮度调成最值(最大、最小)
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetBrightness", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"brightness", "value":"max", "extensions":{ "extension1":"", "extension2":"" } } }
最值 | 说明 |
max | 对应最大值 |
min | 对应最小值 |
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetBrightnessResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
步长设置亮度(默认步长 25)
调亮
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustUpBrightness", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"brightnessStep", "value":"25", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustUpBrightnessResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
调暗
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustDownBrightness", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"brightnessStep", "value":"10" , "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustDownBrightnessResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
温度的控制
温度设置指定值
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetTemperature", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"temperature", "value":"27", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetTemperatureResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
温度设置最值(最大、最小)
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetTemperature", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"temperature", "value":"max", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetTemperatureResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
最值 | 说明 |
max | 对应最大值 |
min | 对应最小值 |
步长设置温度(默认步长为1)
调高温度
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustUpTemperature", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"temperatureStep", "value":"1" , "extensions":{ "extension1":"", "extension2":"" } } }
响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustUpTemperatureResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
调低温度
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustDownTemperature", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"temperatureStep", "value":"10", "extensions":{ "extension1":"", "extension2":"" } } }
响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustDownTemperatureResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
湿度的控制
湿度设置指定值
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetHumidity", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"humidity", "value":"27", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetHumidityResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
湿度设置最值(最大、最小)
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetHumidity", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"humidity", "value":"max", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetHumidityResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
最值 | 说明 |
max | 对应最大值 |
min | 对应最小值 |
湿度调整(按照默认步长 1 调整)
湿度增加
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustUpHumidity", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"humidityStep", "value":"1", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustUpHumidityResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
湿度减少
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustDownHumidity", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"humidityStep", "value":"1" , "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustDownHumidityResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
风速的控制
风速的控制
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetWindSpeed", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"windspeed", "value":"1" , "extensions":{ "extension1":"", "extension2":"" } } }
风扇类的风速对应值
风速值 | 说明 |
1 | 对应风速 1档 |
2 | 对应风速 2档 |
3 | 对应风速 3档 |
4 | 对应风速 4档 |
空调类的风速对应值
风速值 | 说明 |
auto | 自动风 |
low | 低风 |
medium | 中风 |
high | 高风 |
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetWindSpeedResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
风速设置最值(最大、最小)
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetWindSpeed", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"windspeed", "value":"max" , "extensions":{ "extension1":"", "extension2":"" } } }
最值 | 说明 |
max | 对应最大值 |
min | 对应最小值 |
风速的步长调整(默认步长为1)
调大风速
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustUpWindSpeed", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"windspeedStep", "value":"1", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustUpWindSpeedResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
调小风速
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustDownWindSpeed", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"windspeedStep", "value":"1" , "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustDownWindSpeedResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
风向的控制
开启摆风
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"OpenSwing", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"OpenSwingResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
关闭摆风
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"CloseSwing", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "extensions":{ "extension1":"", "extension2":"" } } }
按照角度摆风
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"XXX", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"angle", "value":"30", // 度为单位 "extensions":{ "extension1":"", "extension2":"" } } }
按照角度的摆风name 列表取值以及属性如下:
name名称 | 参数说明 | 属性 | 属性值枚举 |
OpenUpAndDownSwing | 开启上下X度摆动 | angle | 30,60(默认60 度) , 90 |
OpenUpSwing | 开启向上X度摆动 | angle | 30,60(默认60 度) , 90 |
OpenDownSwing | 开启向下X度摆动 | angle | 30,60(默认60 度) , 90 |
OpenLeftAndRightSwing | 开启左右X度摆动 | angle | 30,60(默认60 度) , 90 |
OpenLeftSwing | 开启向左X度摆动 | angle | 30,60(默认60 度) , 90 |
OpenRightSwing | 开启向右X度摆动 | angle | 30,60(默认60 度) , 90 |
OpenForwardAndBackSwing | 开启前后X度摆动 | angle | 30,60(默认60 度) , 90 |
OpenForwardSwing | 开启向前X度摆动 | angle | 30,60(默认60 度) , 90 |
OpenBackSwing | 开启向后X度摆动 | angle | 30,60(默认60 度) , 90 |
模式的控制
模式的设置
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetMode", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token" "deviceId":"34234", "deviceType":"XXX", "attribute":"mode", "value":"auto", "extensions":{ "extension1":"", "extension2":"" } } }
mode取值表
模式名称 | 参数说明 |
auto | 自动模式 |
cold | 制冷模式 |
heat | 制热模式 |
ventilate | 通风模式 |
airsupply | 送风模式 |
dehumidification | 除湿模式 |
reading | 阅读模式 |
movie | 影院模式 |
sleep | 睡眠模式 |
live | 生活模式 |
manual | 手动模式 |
silent | 静音模式 |
energy | 省电模式 |
normalWind | 正常风模式 |
natureWind | 自然风模式 |
sleepWind | 睡眠风模式 |
quietWind | 静音风模式 |
comfortableWind | 舒适风模式 |
babyWind | 宝宝风模式 |
cottons | 棉织物模式 |
synthetics | 化纤模式 |
wool | 羊毛模式 |
hygiene | 除菌模式 |
drumClean | 筒清洁模式 |
silk | 丝绸模式 |
holiday | 假日模式 |
smart | 智能模式 |
music | 音乐模式 |
zeroGravity | 零重力模式 |
snoreStop | 止鼾模式 |
diffuse | 多人模式 |
swing | 摇摆模式 |
power | 强效模式 |
common | 普通模式 |
work | 工作模式 |
cool | 速冷模式 |
frozen | 速冻模式 |
microDry | 微干模式 |
fullDry | 全干模式 |
superDry | 超干模式 |
summer | 夏季模式 |
winter | 冬季模式 |
standard | 标准模式 |
fastWash | 快洗模式 |
babyWash | 婴童洗模式 |
singleDehydration | 单脱水模式 |
energySaveWash | 节能洗模式 |
night | 夜间模式 |
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetModeResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
颜色的设置
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetColor", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"color", "value":"Red", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetColorResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
颜色对应表参考本页中设备状态查询的颜色对应表
XX功能的开关
打开XX功能
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"OpenFunction", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"function", "value":"XXX", // 功能值如下功能属性值表所示 "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"OpenFunctionResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
关闭XX功能
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"CloseFunction", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"function", "value":"XXX", // 功能值如下功能属性值表所示 "extensions":{ "extension1":"", "extension2":"" } } }
取消类操作
取消操作
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"Cancel", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"CancelResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
取消模式
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"CancelMode", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"mode", "value":"XXX", // 参考模式取值表 "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"CancelModeResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
模式表参考本页章节10.1 中的mode取值表
色温控制
色温设置指定值
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetColorTemperature", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"colorTemperature", "value":"27", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"SetColorTemperatureResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
步长设置色温(默认步长为100)
色温调冷
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustUpColorTemperature", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"colorTemperatureStep", "value":"100", "extensions":{ "extension1":"", "extension2":"" } } }
色温调暖
{ "header":{ "namespace":"AliGenie.Iot.Device.Control", "name":"AdjustDownColorTemperature", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "attribute":"colorTemperatureStep", "value":"100", "extensions":{ "extension1":"", "extension2":"" } } }
设备状态查询
所有属性的查询
{ "header":{ "namespace":"AliGenie.Iot.Device.Query", "name":"Query", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token", "deviceId":"34234", "deviceType":"XXX", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应:
{ "properties":[ { "name":"powerstate", // 电源状态 "value":"on" }, { "name":"color", "value":"Red" }, { "name":"temperature", "value":"27" //标准单位 摄氏度 },{ "name":"humidity", "value":"20" },{ "name":"windspeed", "value":"2" // 1对应 1档, 2对应2档, 3 对应 3档 },{ "name":"humidity", "value":"23" },{ "name":"pm2.5", "value":"20" } ,{ "name":"direction", // 摆向方向 "value":"left" } ,{ "name":"angle", // 角度 "value":"60" } ], "header":{ "namespace":"AliGenie.Iot.Device.Query", "name":"QueryResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
注: Query 请求电源状态(powerstate)必须返回,其他属性的返回与否视设备自身情况而定
单个属性的查询(例:温度属性)
{ "header":{ "namespace":"AliGenie.Iot.Device.Query", "name":"QueryTemperature", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token" "deviceId":"34234", "deviceType":"XXX", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "properties":[ { "name":"temperature", "value":"27" } ], "header":{ "namespace":"AliGenie.Iot.Device.Query", "name":"QueryTemperatureResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
血压属性的查询(需返回舒张压和收缩压)
{ "header":{ "namespace":"AliGenie.Iot.Device.Query", "name":"QueryBloodPressure", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "accessToken":"access token" "deviceId":"34234", "deviceType":"XXX", "extensions":{ "extension1":"", "extension2":"" } } }
正常响应
{ "properties":[ { "name":"systolicPressure", "value":"80" } , { "name":"diastolicPressure", "value":"120" } ], "header":{ "namespace":"AliGenie.Iot.Device.Query", "name":"QueryBloodPressureResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234" } }
目前支持的查询属性如下:
属性 | 说明 | 属性值参考 | AliGenie 所支持的对应单位 |
powerstate | 电源状态 | on(打开),off(关闭) | 无 |
color | 颜色 | 参考颜色对应表 | 无 |
temperature | 温度 | 数值 | 摄氏度 |
windspeed | 风速 | 数值 | 档 |
brightness | 亮度 | 数值 | 无 |
fog | 雾量 | 数值 | 无 |
humidity | 湿度 | 数值 | 无 |
pm2.5 | pm2.5 | 数值 | 无 |
channel | 电视频道 | 标准的频道名称 | 无 |
number | 电视频道号 | 数值 | 无 |
direction | 方向 | 取值left,right,forward,back,up,down | 无 |
angle | 角度 | 数值 | 度 |
anion | 负离子功能 | on(打开),off(关闭) | 无 |
effluent | 出水功能 | on(打开),off(关闭) | 无 |
mode | 模式 | 参考mode 设置中的mode取值表 | 无 |
lefttime | 剩余时间 | 数值 | 无 |
remotestatus | 设备远程状态 | on(打开),off(关闭) | 无 |
onlinestate | 设备在线状态 | online(在线),offline(离线) | 无 |
colorTemperature | 色温 | 数值 | 无 |
RO | 滤水芯寿命RO值 | 数值 | 无 |
PCB | 滤水芯寿命PCB值 | 数值 | 无 |
TDS | 水质TDS值 | 数值 | 无 |
systolicPressure | 收缩压 | 数值 | 无 |
diastolicPressure | 舒张压 | 数值 | 无 |
bloodGlucose | 血糖 | 数值 | 无 |
heartRate | 心率 | 数值 | 无 |
支持控制的颜色对应表
AliGenie支持控制的颜色 | 对应中文描述 |
Red | 红色 |
Yellow | 黄色 |
Blue | 蓝色 |
Green | 绿色 |
White | 白色 |
Black | 黑色 |
Cyan | 青色 |
Purple | 紫色 |
Orange | 橙色 |
支持查询的颜色对应表(上述支持控制的颜色对应表同样支持,这里不再列出)
AliGenie支持查询的颜色 | 对应中文描述 |
Pink | 粉红 |
Violet | 紫罗兰 |
Magenta | 洋红 |
Indigo | 靛青 |
SlateBlue | 蓝灰色 |
DarkBlue | 深蓝色 |
SkyBlue | 天蓝色 |
DarkCyan | 深青色 |
Beige | 浅褐色 |
Brown | 棕色 |
请厂商适配上述颜色,若颜色对应表中无,请近似匹配
响应信息
错误响应
{ "header":{ "namespace":"AliGenie.Iot.Device.XXXX", "name":"ErrorResponse", "messageId":"1bd5d003-31b9-476f-ad03-71d471922820", "payLoadVersion":1 }, "payload":{ "deviceId":"34234", "errorCode":"DEVICE_NOT_SUPPORT_FUNCTION", "message":"device not support" } }
错误响应header协议中name为ErrorResponse
错误响应payload 协议如下
参数 | 说明 |
deviceId | 设备ID |
errorCode | 错误码,详见 3.2章节 |
message | 错误信息 |
异常响应的信息列表
错误码 errorCode | 错误码说明 | 对应message |
INVALIDATE_CONTROL_ORDER | 控制指令不正确 | invalidate control order |
SERVICE_ERROR | 服务异常 | 服务错误原因(方便观察原因) |
DEVICE_NOT_SUPPORT_FUNCTION | 设备不支持该操作 | device not support |
INVALIDATE_PARAMS | 请求参数有误 | invalidate params |
DEVICE_IS_NOT_EXIST | 设备未找到 | device is not exist |
IOT_DEVICE_OFFLINE | 设备离线状态 | device is offline |
ACCESS_TOKEN_INVALIDATE | access_token 无效(包括失效) | access_token is invalidate |
注意事项:
1.请求响应response header 的Content-Type 头部需要是 application/json 格式
2. 天猫精灵云端请求厂商服务接口目前设置的超时时间为2秒,如果出现服务不可用的情况,请接入方进行优化
3. messageId 是不重复的消息id
4. 通用协议的请求都是POST请求
5.app 上显示产品icon有问题时请注意icon链接是https以及大小是160*160