设备控制


电源类的操作


设备打开

  "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度摆动angle30,60(默认60 度) , 90
OpenUpSwing开启向上X度摆动angle30,60(默认60 度) , 90
OpenDownSwing开启向下X度摆动angle30,60(默认60 度) , 90
OpenLeftAndRightSwing开启左右X度摆动angle30,60(默认60 度) , 90
OpenLeftSwing开启向左X度摆动angle30,60(默认60 度) , 90
OpenRightSwing开启向右X度摆动angle30,60(默认60 度) , 90
OpenForwardAndBackSwing开启前后X度摆动angle30,60(默认60 度) , 90
OpenForwardSwing开启向前X度摆动angle30,60(默认60 度) , 90
OpenBackSwing开启向后X度摆动angle30,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.5pm2.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_INVALIDATEaccess_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