物模型管理及物映射管理API

Download OpenAPI specification:Download

4.物映射后台管理API

发布语音脚本

Request Body schema: application/json
productKey
required
string

Responses

Request samples

Content type
application/json
{
  • "productKey": "fjksdlfjldsjfkls"
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": true
}

发布脚本

Request Body schema: application/json
object
empty
boolean
property name*
additional property
object

Responses

Request samples

Content type
application/json
{
  • "productKey": "test.001"
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": true
}

调试脚本

Request Body schema: application/json
object
empty
boolean
property name*
additional property
object

Responses

Request samples

Content type
application/json
{
  • "productKey": "test.001"
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": true
}

保存产品语音lua信息

Request Body schema: application/json
productKey
required
string
productId
required
string
fileContent
required
string
modifier
required
string

Responses

Request samples

Content type
application/json
{
  • "productId": "midea.zb2485.001",
  • "productKey": "fjksdlfjldsjfkls",
  • "modifier": "张三",
  • "fileContent": "print hello"
}

Response samples

Content type
*/*

正常值返回

{
  "code": 200,
  "message": "ok"
}

历史记录语音脚本分页查询

Request Body schema: application/json
productKey
required
string
pageNo
required
integer <int32>
pageSize
required
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "productKey": "fjksdlfjldsjfkls",
  • "pageNo": 1,
  • "pageSize": 10
}

Response samples

Content type
*/*

正常值返回

{
  "message": "Ok",
  "code": 200,
  "data": {
    "total": 1,
    "records": [
      {
        "id": {
          "timestamp": 1653119803,
          "date": "2022-05-21T07:56:43.000+0000"
        },
        "productId": "midea.zb2485.001",
        "fileName": "d12",
        "fileSize": 17,
        "tmVersion": 1,
        "filePath": "https://mideazy-test-public.oss-cn-hangzhou.aliyuncs.com/file/upload/iot/20220521/1653120767266/d12.lua",
        "md5sum": "2fe370e83fee3b7a829b3850079178e8",
        "modifier": "张三",
        "modifyTime": "2022-05-21T08:12:47.416+0000",
        "createTime": "2022-05-21T07:56:43.281+0000"
      }
    ],
    "pageNo": 1,
    "pageSize": 10
  }
}

测试lua脚本

Request Body schema: application/json
object
empty
boolean
property name*
additional property
object

Responses

Request samples

Content type
application/json

执行无参数方法

{
  • "fileContent": "--input=\"input\"\n--output=\"hello_input\"\nfunction hello(input) \n print ('hello'..input)\n end \n"
}

Response samples

Content type
*/*

正常值返回

{
  "code": 200,
  "message": "ok",
  "data": {
    "output": "output message"
  }
}

运行lua脚本

Request Body schema: application/json
object
empty
boolean
property name*
additional property
object

Responses

Request samples

Content type
application/json
Example

执行无参数方法

{
  • "fileContent": "function hello() \n print 'hello'\n end \n",
  • "functionName": "hello"
}

Response samples

Content type
application/json
Example

正常值返回

{
  • "code": 200,
  • "message": "ok",
  • "data": "zigbee"
}

保存产品lua信息

Request Body schema: application/json
productKey
required
string
productId
required
string
fileContent
required
string
modifier
required
string
productBase
string
deviceType
integer <int32>
version
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "productId": "midea.zb2485.001",
  • "productKey": "122162155",
  • "modifier": "张三",
  • "fileContent": "print hello"
}

Response samples

Content type
application/json

正常值返回

{
  • "code": 200,
  • "message": "ok"
}

历史记录分页查询

Request Body schema: application/json
productKey
required
string
pageNo
required
integer <int32>
pageSize
required
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "productKey": "midea.zb2485.001",
  • "pageNo": 1,
  • "pageSize": 10
}

Response samples

Content type
application/json

正常值返回

{
  • "message": "Ok",
  • "code": 200,
  • "data": {
    }
}

获取Lua文件内容

Request Body schema: application/json
filePath
required
string

Responses

Request samples

Response samples

Content type
*/*

正常值返回

{
  "code": 200,
  "message": "ok",
  "data": {
    "fileContent": "just do it"
  }
}

获取产品语音lua最新信息详情

path Parameters
productKey
required
string

所实现的设备产品的ID

Responses

Response samples

Content type
*/*

正常值返回

{
    "message": "Ok",
    "code": 200,
    "data": {
        "fileName": "zigbee_woshuai.switch.001_1.lua",
        "modifyTime": "2022-05-10T01:30:31.076+0000",
        "productId": "woshuai.switch.001",
        "createTime": "2022-05-06T03:34:53.252+0000",
        "fileSize": 7088,
        "md5sum": "a5ecb181ce48f2e98bd690a9f7ce0111",
        "modifier": null,
        "version": 1,
        "fileContent": "print hello world",
    }
}

获取产品语音lua版本信息详情

path Parameters
productKey
required
string

所实现的设备产品的ID

tmVersion
required
string

版本

Responses

Response samples

Content type
*/*

正常值返回

{
    "message": "Ok",
    "code": 200,
    "data": {
        "fileName": "zigbee_woshuai.switch.001_1.lua",
        "modifyTime": "2022-05-10T01:30:31.076+0000",
        "productId": "woshuai.switch.001",
        "createTime": "2022-05-06T03:34:53.252+0000",
        "fileSize": 7088,
        "md5sum": "a5ecb181ce48f2e98bd690a9f7ce0111",
        "modifier": null,
        "version": 1,
        "fileContent": "print hello world",
    }
}

获取产品lua信息详情

path Parameters
productKey
required
string

所实现的设备产品的ID

query Parameters
debug
required
boolean

是否调试脚本

Responses

Response samples

Content type
application/json

正常值返回

{
  • "message": "Ok",
  • "code": 200,
  • "data": {
    }
}

获取产品lua信息详情

path Parameters
productKey
required
string

所实现的设备产品的ID

version
required
string

版本

Responses

Response samples

Content type
application/json

正常值返回

{
  • "message": "Ok",
  • "code": 200,
  • "data": {
    }
}

获取lua脚本模板

Responses

Response samples

Content type
*/*

正常值返回

{
  "message": "Ok",
  "code": 200,
  "data": {
    "fileContent": "print hello world"
  }
}

获取productBase列表

Responses

Response samples

Content type
application/json
{
  • "message": "Ok",
  • "code": 200,
  • "data": [
    ]
}

获取lua脚本方法列表

Responses

Response samples

Content type
application/json
{
  • "message": "Ok",
  • "code": 200,
  • "data": [
    ]
}

获取deviceType列表

Responses

Response samples

Content type
application/json
{
  • "message": "Ok",
  • "code": 200,
  • "data": [
    ]
}

3.物模型后台管理API

修改标准功能

Request Body schema: application/json
id
string
firstCategory
required
string
secondCategory
required
string
firstCategoryId
required
integer <int32>
secondCategoryId
required
integer <int32>
configType
required
string
tdKey
required
string
title
required
string
functionLabel
required
string
type
string
defaultValue
object
Array of objects (EnumInfoDto)
maxLen
integer <int32>
min
integer <int32>
max
integer <int32>
step
integer <int32>
ratio
integer <int32>
readWrite
string
sceneCare
string
description
required
string
object
object

Responses

Request samples

Content type
application/json
{
  • "sceneCare": "full",
  • "defaultValue": 0,
  • "description": "开关",
  • "readWrite": "rw",
  • "type": "enumInt",
  • "title": "开关",
  • "enum": [
    ]
}

启用标准功能列表

path Parameters
id
required
string

Responses

禁用标准功能列表

path Parameters
id
required
string

Responses

发布物模型

header Parameters
tokenInfo
string
Request Body schema: application/json
productKey
required
string

Responses

Request samples

Content type
application/json
{
  • "productKey": "test.001"
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": true
}

物模型删除功能

header Parameters
tokenInfo
string
Request Body schema: application/json
productKey
required
string
configType
required
string
tdKey
required
string
createMan
required
string

Responses

Request samples

Content type
application/json

删除功能

{
  • "productId": "ming.test.001",
  • "createMan": "admin",
  • "configType": "properties",
  • "tdKey": "power_1"
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200
}

调试物模型

header Parameters
tokenInfo
string
Request Body schema: application/json
productKey
required
string

Responses

Request samples

Content type
application/json
{
  • "productKey": "test.001"
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": true
}

校验标准功能key

Request Body schema: application/json
id
string
firstCategory
required
string
secondCategory
required
string
tdKey
required
string

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "firstCategory": "string",
  • "secondCategory": "string",
  • "tdKey": "string"
}

standardFunctionRepair

Request Body schema: application/json
object
empty
boolean
property name*
additional property
object

Responses

Request samples

Content type
application/json
{
  • "innerMap": {
    },
  • "empty": true,
  • "property1": { },
  • "property2": { }
}

获取标准功能列表

Request Body schema: application/json
keyword
string
secondCategory
string
secondCategoryId
integer <int32>
type
Array of strings
pageNo
integer <int32>
pageSize
integer <int32>
enabled
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "keyword": "设备的panel个数",
  • "type": [
    ],
  • "secondCategory": "智能空开"
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": {
    "total": 290,
    "pages": 290,
    "list": [
      {
        "tdValue": {
          "min": 11,
          "secondCategory": "热水器",
          "max": 22,
          "firstCategory": "家电",
          "readWrite": "rw",
          "step": 22,
          "id": "632045f61082be2188c7dbca",
          "configType": "properties",
          "title": "09135",
          "type": "rangeInt",
          "tdKey": "09135",
          "ratio": 1
        },
        "secondCategory": "热水器",
        "name": "家电/热水器",
        "firstCategory": "家电",
        "readWrite": "rw",
        "id": "632045f61082be2188c7dbca",
        "configType": "properties",
        "title": "09135",
        "tdKey": "09135",
        "enabled": 0
      }
    ]
  }
}

获取标准功能列表

Request Body schema: application/json
keyword
string
secondCategory
string
secondCategoryId
integer <int32>
type
Array of strings
pageNo
integer <int32>
pageSize
integer <int32>
enabled
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "keyword": "设备的panel个数",
  • "type": [
    ],
  • "secondCategory": "智能空开"
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": [
    {
      "tdValue": {
        "sceneCare": "full",
        "defaultValue": 0,
        "description": "开关",
        "readWrite": "rw",
        "type": "enumInt",
        "title": "开关",
        "enum": [
          {
            "description": "合闸",
            "value": 1
          },
          {
            "description": "分闸",
            "value": 0
          }
        ]
      }
    }
  ]
}

增加标准功能

Request Body schema: application/json
id
string
firstCategory
required
string
secondCategory
required
string
firstCategoryId
required
integer <int32>
secondCategoryId
required
integer <int32>
configType
required
string
tdKey
required
string
title
required
string
functionLabel
required
string
type
string
defaultValue
object
Array of objects (EnumInfoDto)
maxLen
integer <int32>
min
integer <int32>
max
integer <int32>
step
integer <int32>
ratio
integer <int32>
readWrite
string
sceneCare
string
description
required
string
object
object

Responses

Request samples

Content type
application/json
{
  • "sceneCare": "full",
  • "defaultValue": 0,
  • "description": "开关",
  • "readWrite": "rw",
  • "type": "enumInt",
  • "title": "开关",
  • "enum": [
    ]
}

checkTdRevise

header Parameters
tokenInfo
string
Request Body schema: application/json
productKey
required
string

Responses

Request samples

Content type
application/json
{
  • "productKey": "string"
}

物模型导入

query Parameters
productKey
required
string
header Parameters
tokenInfo
string
Request Body schema: application/json
file
required
string <binary>

Responses

Request samples

Content type
application/json
{
  • "file": "string"
}

物模型导出

Request Body schema: application/json
productKey
string
dataVersion
string

Responses

Request samples

Content type
application/json
{
  • "productKey": "string",
  • "dataVersion": "string"
}

queryPropertiesByModelId

query Parameters
productKey
required
string
tdKey
required
string

Responses

queryByModelIdList

query Parameters
productKeys
required
Array of strings

Responses

获取物模型分页

Request Body schema: application/json
productKey
required
string
pageNo
required
integer <int32>
pageSize
required
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "productKey": "",
  • "pageNo": 1,
  • "pageSize": 10
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": {
    "total": 1,
    "records": [
      {
        "id": "urn:midea-iot-spec-v1:thing-p:0000:TV:heiman.tv.ir",
        "td": {
          "description": "",
          "title": "电视红外遥控器WS2IRC",
          "version": {
            "td": "1.0.0"
          }
        }
      }
    ],
    "pageNo": 1,
    "pageSize": 2
  }
}

获取版本日志分页

Request Body schema: application/json
productKey
required
string
dataVersion
required
integer <int32>
pageNo
required
integer <int32> >= 1
pageSize
required
integer <int32> >= 1

Responses

Request samples

Content type
application/json
{
  • "dataVersion": 1,
  • "productKey": "f63bc6588a28410b833a82d3a303b7ef",
  • "pageSize": 10,
  • "pageNo": 1
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": {
    "total": 7,
    "records": [
      {
        "functionName": "设备的panel个数11122",
        "productKey": "c61bb402952646c29350c9700d07142e",
        "dataVersion": 1,
        "createMan": "admin",
        "createTime": "2022-07-01T07:15:21.767+0000",
        "tdKey": "panelQty2",
        "title": null,
        "operationType": "del",
        "operationTypeName": "删除",
        "fieldName": null,
        "oldValue": null,
        "currentValue": null,
        "batchNo": "18a323df0fc745c0a3f3d3d71da16b32"
      },
      {
        "functionName": "设备的panel个数11122",
        "productKey": "c61bb402952646c29350c9700d07142e",
        "dataVersion": 1,
        "createMan": "admin",
        "createTime": "2022-07-01T07:12:38.769+0000",
        "tdKey": "panelQty2",
        "title": "功能点名称",
        "operationType": "edit",
        "operationTypeName": "编辑",
        "fieldName": "title",
        "oldValue": "设备的panel个数",
        "currentValue": "设备的panel个数2",
        "batchNo": "6dec0c93e2d64236911bd1f14789e69a"
      }
    ],
    "pageNo": 1,
    "pageSize": 2
  }
}

queryByModelIds

Request Body schema: application/json
modelIds
Array of strings

Responses

Request samples

Content type
application/json
{
  • "modelIds": [
    ]
}

检查标识符是否重复,true为重复

Request Body schema: application/json
productKey
required
string
required
Array of objects (FunctionBaseVo)

Responses

Request samples

Content type
application/json
{
  • "productKey": "test.001",
  • "functionList": [
    ]
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": true
}

物模型功能修改

header Parameters
tokenInfo
string
Request Body schema: application/json
productId
required
string
productKey
required
string
required
Array of objects (FunctionInfoDto)
createMan
required
string
oldTdKey
required
string

Responses

Request samples

Content type
application/json
{
  • "productId": "统一sinye.valve.201",
  • "productKey": "f63bc6588a28410b833a82d3a303b7ef",
  • "createMan": "admin",
  • "oldTdKey": "dada",
  • "functionList": [
    ]
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200
}

物模型保存

header Parameters
tokenInfo
string
Request Body schema: application/json
object
empty
boolean
property name*
additional property
object

Responses

Request samples

Content type
application/json
{
  • "productId": "ming.test.001",
  • "productKey": "212515254415244",
  • "functionList": [
    ]
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200
}

物模型新增功能

header Parameters
tokenInfo
string
Request Body schema: application/json
productId
required
string
productKey
required
string
required
Array of objects (FunctionInfoDto)
createMan
required
string

Responses

Request samples

Content type
application/json
{
  • "productId": "统一sinye.valve.201",
  • "productKey": "f63bc6588a28410b833a82d3a303b7ef",
  • "createMan": "admin",
  • "functionList": [
    ]
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200
}

queryTdCustomFunctionSelectList

Request Body schema: application/json
keyword
string
secondCategory
string
secondCategoryId
integer <int32>
type
Array of strings
pageNo
integer <int32>
pageSize
integer <int32>
enabled
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "keyword": "string",
  • "secondCategory": "string",
  • "secondCategoryId": 0,
  • "type": [
    ],
  • "pageNo": 0,
  • "pageSize": 0,
  • "enabled": 0
}

customFunctionRepair

Request Body schema: application/json
object
empty
boolean
property name*
additional property
object

Responses

Request samples

Content type
application/json
{
  • "innerMap": {
    },
  • "empty": true,
  • "property1": { },
  • "property2": { }
}

获取自定义物模型功能

Request Body schema: application/json
tdKey
required
string
productKey
string
configType
required
string
pageNo
required
integer <int32> >= 1
pageSize
required
integer <int32> >= 1

Responses

Request samples

Content type
application/json
{
  • "tdKey": "pan",
  • "productKey": "2df95fd281a34ca9810ad397e2208231",
  • "configType": "actions",
  • "pageSize": 10,
  • "pageNo": 1
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": {
    "total": 1,
    "records": [
      {
        "_id": {
          "timestamp": 1656924635,
          "date": "2022-07-04T08:50:35.000+0000"
        },
        "configType": "properties",
        "productKey": "2125232",
        "createTime": 13465465,
        "tdKey": "panelQty",
        "tdValue": {
          "defaultValue": 1,
          "sceneCare": "none",
          "readWrite": "r",
          "title": "设备的panel个数",
          "type": "integer"
        }
      }
    ],
    "pageNo": 1,
    "pageSize": 10
  }
}

获取自定义物模型功能

Request Body schema: application/json
tdKey
string
configType
required
string

Responses

Request samples

Content type
application/json
{
  • "tdKey": "pan",
  • "configType": "actions"
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": {
    "records": [
      {
        "_id": {
          "timestamp": 1656924635,
          "date": "2022-07-04T08:50:35.000+0000"
        },
        "configType": "properties",
        "productKey": "2125232",
        "createTime": 13465465,
        "tdKey": "panelQty",
        "tdValue": {
          "defaultValue": 1,
          "sceneCare": "none",
          "readWrite": "r",
          "title": "设备的panel个数",
          "type": "integer"
        }
      }
    ]
  }
}

根据productKey集合获取物模型自动化标识集合

Request Body schema: application/json
Array
string

Responses

Request samples

Content type
application/json
[
  • "string"
]

Response samples

Content type
*/*
{
    "message": "Ok",
    "code": 200,
    "data": [{
        "productKey": "1",
        "actions": {},
        "properties": {
            "power_1": {
                "sceneCare": "full" 
            },
        "events": {}
    }]
}

importSeceneTdFromTd

Responses

物模型自动化标识修改

Request Body schema: application/json
productId
required
string
productKey
required
string
required
Array of objects (SceneFunctionInfoDto)
createMan
required
string
oldTdKey
required
string
isOld
boolean

Responses

Request samples

Content type
application/json
{
  • "productId": "0826test",
  • "productKey": "cfb568894d854b9ea279d7d41fc95847",
  • "createMan": "iot_developer",
  • "oldTdKey": "11",
  • "functionList": [
    ]
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200
}

queryStandardFunctionBase

path Parameters
secondCategoryId
required
integer <int32>

Responses

根据productKey获取物模型详情

path Parameters
productKey
required
string

Responses

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": {
    "security": [
      "nosec_sc"
    ],
    "description": "",
    "id": "urn:midea-iot-spec-v1:thing-p:0000:remac.air.001",
    "title": "新风线控器(A3Z-XFWK-01)",
    "actions": {},
    "tdVersion": "1.0.0",
    "securityDefinitions": {
      "nosec_sc": {
        "scheme": "nosec"
      }
    },
    "@context": [
      "https://www.w3.org/2019/wot/td/v1"
    ],
    "properties": {
      "curTemper": {
        "min": -5000,
        "max": 5000,
        "defaultValue": 0,
        "sceneCare": "none",
        "description": "室内温度",
        "readWrite": "rw",
        "step": 10,
        "title": "室内温度",
        "type": "rangeInt",
        "ratio": 100
      },
      "power_1": {
        "sceneCare": "full",
        "defaultValue": 0,
        "description": "",
        "readWrite": "rw",
        "type": "enumInt",
        "title": "开关",
        "enum": [
          {
            "description": "打开",
            "value": 1
          },
          {
            "description": "关闭",
            "value": 0
          }
        ]
      },
      "windSpeed": {
        "sceneCare": "actionOnly",
        "defaultValue": 0,
        "description": "",
        "readWrite": "rw",
        "type": "enumInt",
        "title": "风速",
        "enum": [
          {
            "description": "低风",
            "value": 0
          },
          {
            "description": "中风",
            "value": 1
          },
          {
            "description": "高风",
            "value": 2
          }
        ]
      },
      "version": {
        "sceneCare": "none",
        "readWrite": "r",
        "title": "设备版本",
        "type": "string",
        "maxLen": 50
      }
    },
    "events": {}
  }
}

根据productKey获取物模型详情

path Parameters
productKey
required
string
version
required
string

Responses

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": {
    "security": [
      "nosec_sc"
    ],
    "description": "",
    "id": "urn:midea-iot-spec-v1:thing-p:0000:remac.air.001",
    "title": "新风线控器(A3Z-XFWK-01)",
    "actions": {},
    "tdVersion": "1.0.0",
    "securityDefinitions": {
      "nosec_sc": {
        "scheme": "nosec"
      }
    },
    "@context": [
      "https://www.w3.org/2019/wot/td/v1"
    ],
    "properties": {
      "curTemper": {
        "min": -5000,
        "max": 5000,
        "defaultValue": 0,
        "sceneCare": "none",
        "description": "室内温度",
        "readWrite": "rw",
        "step": 10,
        "title": "室内温度",
        "type": "rangeInt",
        "ratio": 100
      },
      "power_1": {
        "sceneCare": "full",
        "defaultValue": 0,
        "description": "",
        "readWrite": "rw",
        "type": "enumInt",
        "title": "开关",
        "enum": [
          {
            "description": "打开",
            "value": 1
          },
          {
            "description": "关闭",
            "value": 0
          }
        ]
      },
      "windSpeed": {
        "sceneCare": "actionOnly",
        "defaultValue": 0,
        "description": "",
        "readWrite": "rw",
        "type": "enumInt",
        "title": "风速",
        "enum": [
          {
            "description": "低风",
            "value": 0
          },
          {
            "description": "中风",
            "value": 1
          },
          {
            "description": "高风",
            "value": 2
          }
        ]
      },
      "version": {
        "sceneCare": "none",
        "readWrite": "r",
        "title": "设备版本",
        "type": "string",
        "maxLen": 50
      }
    },
    "events": {}
  }
}

queryByProductKey

path Parameters
productKey
required
string

Responses

获取物模型标识符类型

Responses

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": [
    {
      "code": "integer",
      "name": "整型"
    },
    {
      "code": "string",
      "name": "字符串"
    },
    {
      "code": "rangeInt",
      "name": "范围值"
    },
    {
      "code": "enumStr",
      "name": "枚举(字符串)"
    },
    {
      "code": "enumInt",
      "name": "枚举(整型)"
    }
  ]
}

根据productKey获取物模型自动化标识详情

path Parameters
productKey
required
string

Responses

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": {
    "productKey": "cfb568894d854b9ea279d7d41fc95847",
    "td": {
      "properties": {
        "panelQty": {
          "title": "设备的panel个数",
          "sceneCare": "conditionOnly",
          "description": "设备的pane"
        },
        "maxTemper": {
          "title": "最大设置温度",
          "sceneCare": "none",
          "description": "最大设置温度"
        }
      },
      "actions": {},
      "events": {}
    }
  }
}

getTdByProductKey

path Parameters
productKey
required
string

Responses

校验标准功能key

path Parameters
id
required
string

Responses

7.功能集管理API

upset

header Parameters
tokenInfo
string
Request Body schema: application/json
productKey
required
string
configType
required
string
tdKey
required
string
title
required
string
type
string
defaultValue
object
Array of objects (EnumInfoDto)
maxLen
integer <int32>
min
integer <int32>
max
integer <int32>
step
integer <int32>
ratio
integer <int32>
sceneCare
string
description
required
string
readWrite
string
object
object
isCustom
string
lastUpdateTime
integer <int64>
functionLabel
string
isRequired
boolean

Responses

Request samples

Content type
application/json
{
  • "productKey": "string",
  • "configType": "string",
  • "tdKey": "string",
  • "title": "string",
  • "type": "string",
  • "defaultValue": { },
  • "enumList": [
    ],
  • "maxLen": 0,
  • "min": 0,
  • "max": 0,
  • "step": 0,
  • "ratio": 0,
  • "sceneCare": "string",
  • "description": "string",
  • "readWrite": "string",
  • "input": {
    },
  • "output": {
    },
  • "isCustom": "string",
  • "lastUpdateTime": 0,
  • "functionLabel": "string",
  • "isRequired": true
}

get

path Parameters
productKey
required
string

Responses

get_1

path Parameters
productKey
required
string
tdKey
required
string

Responses

del

Request Body schema: application/json
productKey
required
string
tdKey
required
string

Responses

Request samples

Content type
application/json
{
  • "productKey": "string",
  • "tdKey": "string"
}

2.物映射管理API

设置物映射方式及其参数(包括物映射Lua文件)

path Parameters
tdId
required
string

所实现物模型TD的Id

productBase
required
string

所实现的设备产品的产品库

productId
required
string

所实现的设备产品的ID

Request Body schema: application/json
object
empty
boolean
property name*
additional property
object

Responses

Request samples

Content type
application/json
Example

美的IoT物模型平台

{
  • "method": "third-party-MideaIoT"
}

产品的物映射是否启用

path Parameters
productBase
required
string

所实现的设备产品的产品库

productId
required
string

所实现的设备产品的ID

Responses

启用产品的物映射

path Parameters
productBase
required
string

所实现的设备产品的产品库

productId
required
string

所实现的设备产品的ID

Responses

禁用产品的物映射

path Parameters
productBase
required
string

所实现的设备产品的产品库

productId
required
string

所实现的设备产品的ID

Responses

saveTd

Request Body schema: application/json
object (ObjectId)
productBase
string
productId
string
productKey
string
fileName
string
fileSize
integer <int64>
deviceType
integer <int32>
version
integer <int32>
filePath
string
md5sum
string
modifier
string
modifyTime
string <date-time>
createTime
string <date-time>
tmVersion
integer <int32>
debug
boolean
lastestVersion
boolean
type
string

Responses

Request samples

Content type
application/json
{
  • "id": {
    },
  • "productBase": "string",
  • "productId": "string",
  • "productKey": "string",
  • "fileName": "string",
  • "fileSize": 0,
  • "deviceType": 0,
  • "version": 0,
  • "filePath": "string",
  • "md5sum": "string",
  • "modifier": "string",
  • "modifyTime": "2019-08-24T14:15:22Z",
  • "createTime": "2019-08-24T14:15:22Z",
  • "tmVersion": 0,
  • "debug": true,
  • "lastestVersion": true,
  • "type": "string"
}

Response samples

Content type
application/json
"string"

产品的物映射是否启用

path Parameters
productBase
required
string

所实现的设备产品的产品库

productId
required
string

所实现的设备产品的ID

Responses

产品的物映射文件查询

path Parameters
productBase
required
string
Example: remac-smartLife

所实现的设备产品的产品库

query Parameters
productId
required
Array of strings
Example: productId=light.001,light.002

所实现的设备产品的ID

identifier
string
Example: identifier=000016111MSGWG139A70FBF2167F0000

网关序列号

Responses

Response samples

Content type
*/*
[
  {
    "id": {
      "timestamp": 1648545381,
      "date": "2022-03-29T09:16:21.000+0000"
    },
    "productBase": "remac-smartLife",
    "productId": "light.001",
    "fileName": null,
    "fileSize": null,
    "deviceType": 1,
    "version": 1,
    "filePath": "https://mideazy-public.oss-cn-hangzhou.aliyuncs.com/luaFile/test.lua",
    "md5sum": "f2d2043faea3654a289dcd22a8a9536d",
    "modifier": null,
    "modifyTime": null
  }
]

设置物映射方式及其参数(包括物映射Lua文件)

path Parameters
productBase
required
string

所实现的设备产品的产品库

productId
required
string

所实现的设备产品的ID

Responses

1.物模型管理API

设置外部对象与TD的关联

  • 设置关联后可使用/thingDesc/kind-{kind}/{fk}系列接口 - 为支持一个TD被多个不同类型的外部对象所关联,需传递kind参数,表示外部对象的类型 - 某类型的一个外部对象,只能关联一个TD - 若一个外部对象已经关联TD A,当再次调用此接口关联TD B,则移除与TD A的关联
path Parameters
tdId
required
string
kind
required
string

关联类型

fk
required
string

关联对象的标识符

Responses

获取TD的属性,并按条件过滤属性

path Parameters
tdId
required
string
Request Body schema: application/json
object
empty
boolean
property name*
additional property
object

Responses

Request samples

Content type
application/json
Example

查询可读属性

{
  • "simpleFilters": {
    }
}

Response samples

Content type
application/json
"string"

获取TD的操作,并按条件过滤操作

path Parameters
tdId
required
string
Request Body schema: application/json
object
empty
boolean
property name*
additional property
object

Responses

Request samples

Content type
application/json
Example

查询带输入参数的操作

{
  • "simpleFilters": {
    }
}

Response samples

Content type
application/json
"string"

fetchReplaceModelIdList

Request Body schema: application/json
modelId
string
debug
boolean
actions
Array of strings
coditions
Array of strings
functionCollections
Array of strings

Responses

Request samples

Content type
application/json
{
  • "modelId": "string",
  • "debug": true,
  • "actions": [
    ],
  • "coditions": [
    ],
  • "functionCollections": [
    ]
}

Response samples

Content type
application/json
{ }

fetchReplaceModelIdListBatch

Request Body schema: application/json
object
empty
boolean
property name*
additional property
object

Responses

Request samples

Content type
application/json
{
  • "innerMap": {
    },
  • "empty": true,
  • "property1": { },
  • "property2": { }
}

Response samples

Content type
application/json
{ }

fetchReplaceMaterialCodeList

Request Body schema: application/json
materialCode
string
debug
boolean
actions
Array of strings
coditions
Array of strings

Responses

Request samples

Content type
application/json
{
  • "materialCode": "string",
  • "debug": true,
  • "actions": [
    ],
  • "coditions": [
    ]
}

Response samples

Content type
application/json
{ }

获取能匹配动作条件符合的品类产品

Request Body schema: application/json
productKey
string
debug
boolean
actions
Array of strings
coditions
Array of strings
functionCollections
Array of strings

Responses

Request samples

Content type
application/json

产品key

{
  • "productKey": "b1a98426a8b64d579719a1f8f2b04730",
  • "debug": false
}

Response samples

Content type
application/json
[
  • {
    }
]

获取TD实例列表

Request Body schema: application/json
tdIdList
required
Array of strings
identifier
string
debugTd
integer <int32>
sceneCare
string

Responses

Request samples

Content type
application/json
Example

已发布物模型

{
  • "tdIdList": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

获取TD实例列表

Request Body schema: application/json
productKeyList
required
Array of strings
debugTd
integer <int32>

Responses

Request samples

Content type
application/json
Example

已发布物模型

{
  • "productKeyList": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

根据型号ID列表获取TD实例列表

Request Body schema: application/json
modelIdList
required
Array of strings
debugTd
integer <int32>
identifier
string
sceneCare
string

Responses

Request samples

Content type
application/json
Example

已发布物模型

{
  • "modelIdList": [
    ],
  • "identifier": "000016111MSGWG04BC325FBD22D70000",
  • "sceneCare": "none"
}

Response samples

Content type
application/json
"string"

获取TD的属性,并按条件过滤

参数样例参考/thingDesc/{tdId}/filterProperties

path Parameters
kind
required
string

关联类型

fk
required
string

关联对象的标识符

Request Body schema: application/json
object
empty
boolean
property name*
additional property
object

Responses

Request samples

Content type
application/json
{
  • "innerMap": {
    },
  • "empty": true,
  • "property1": { },
  • "property2": { }
}

Response samples

Content type
application/json
"string"

获取TD的操作,并按条件过滤

参数样例参考/thingDesc/{tdId}/filterActions

path Parameters
kind
required
string

关联类型

fk
required
string

关联对象的标识符

Request Body schema: application/json
object
empty
boolean
property name*
additional property
object

Responses

Request samples

Content type
application/json
{
  • "innerMap": {
    },
  • "empty": true,
  • "property1": { },
  • "property2": { }
}

Response samples

Content type
application/json
"string"

获取TD列表

query Parameters
keyword
string

搜索关键字,作用于id、title、description

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

根据tdId获取TD实例,入参debugTd为1时获取调试中的物模型

path Parameters
tdId
required
string
query Parameters
debugTd
integer <int32>

Responses

Response samples

Content type
application/json
Example

带属性和事件的TD

{
  • "id": "urn:midea-iot-spec-v1:thing-p:0000:09:E00000M3",
  • "title": "美的智能门锁",
  • "description": "美的智能门锁:M3,modelId=midea.doorlock.031",
  • "properties": {
    },
  • "actions": { },
  • "events": {
    },
  • "version": {
    },
  • "@context": [
    ]
}

获取TD的所有属性

path Parameters
tdId
required
string

Responses

Response samples

Content type
application/json
"string"

获取TD的单个属性

path Parameters
tdId
required
string
propertyName
required
string

Responses

Response samples

Content type
application/json
"string"

获取TD的所有操作

path Parameters
tdId
required
string

Responses

Response samples

Content type
application/json
"string"

获取TD的单个操作

path Parameters
tdId
required
string
actionName
required
string

Responses

Response samples

Content type
application/json
"string"

根据ModelId获取TD实例,入参debugTd为1时获取调试中的物模型

path Parameters
modelId
required
string
query Parameters
debugTd
integer <int32>

Responses

Response samples

Content type
application/json
"string"

获取TD实例

path Parameters
kind
required
string

关联类型

fk
required
string

关联对象的标识符

Responses

Response samples

Content type
application/json
"string"

移除外部对象与TD的关联

path Parameters
kind
required
string

关联类型

fk
required
string

关联对象的标识符

Responses

获取TD的所有属性

path Parameters
kind
required
string

关联类型

fk
required
string

关联对象的标识符

Responses

Response samples

Content type
application/json
"string"

获取TD的单个属性

path Parameters
kind
required
string

关联类型

fk
required
string

关联对象的标识符

propertyName
required
string

Responses

Response samples

Content type
application/json
"string"

获取TD的所有操作

path Parameters
kind
required
string

关联类型

fk
required
string

关联对象的标识符

Responses

Response samples

Content type
application/json
"string"

获取TD的单个操作

path Parameters
kind
required
string

关联类型

fk
required
string

关联对象的标识符

actionName
required
string

Responses

Response samples

Content type
application/json
"string"

model模板查询接口

query Parameters
modelId
required
string

modelId

Responses

Response samples

Content type
application/json
"string"

获取从美的IoT同步的TD实例

path Parameters
tdId
required
string

Responses

Response samples

Content type
application/json
"string"

物模型网关调试API

下发写属性接口

path Parameters
thingId
required
string
query Parameters
requestId
required
string

调试ID

Request Body schema: application/json
object
empty
boolean
property name*
additional property
object

Responses

Request samples

Content type
application/json
{
  • "msgId": "消息ID",
  • "productId": "设备型号",
  • "data": {
    },
  • "extras": {
    }
}

下发执行动作接口

path Parameters
thingId
required
string
actionName
required
string
query Parameters
requestId
required
string

调试ID

Request Body schema: application/json
object
empty
boolean
property name*
additional property
object

Responses

Request samples

Content type
application/json
{
  • "msgId": "消息ID",
  • "productId": "设备型号",
  • "input": {
    },
  • "extras": {
    }
}

新增配网添加设备接口

path Parameters
gatewaySn
required
string
query Parameters
requestId
required
string

调试ID

Request Body schema: application/json
object
empty
boolean
property name*
additional property
object

Responses

Request samples

Content type
application/json
{
  • "msgId": "消息ID"
}

Response samples

Content type
*/*
{
   "code":200    "msg":"success"    "data":{} }

网关开关调试模式接口

Request Body schema: application/json
object
empty
boolean
property name*
additional property
object

Responses

Request samples

Content type
application/json
{
  • "msgId": "消息ID",
  • "devCode": "网关devCode",
  • "switch": "Int类型:1开启、0关闭"
}

推送脚本接口

Request Body schema: application/json
msgId
string
gatewaySn
required
string
tmId
required
string

Responses

Request samples

Content type
application/json
{
  • "msgId": "消息ID",
  • "gatewaySn": "产品库代号",
  • "productId": "产品ID",
  • "tmId": "lua脚本ID"
}

Response samples

Content type
*/*
{
   "code":200    "msg":"success"    "data":{} }

新增查询子设备列表接口

path Parameters
gatewaySn
required
string
query Parameters
requestId
Array of strings

设备型号

Responses

获取网关开关调试模式接口

query Parameters
devCode
required
string

网关devCode

Responses

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": {
    "debugSwitch": 1
  }
}

查询控制结果日志接口

query Parameters
requestId
required
string

控制网关的时候将该requestId发送给网关,查询日志的时候使用相同requestId查询对应的控制结果

Responses

6.白名单后台管理API

添加白名单

Request Body schema: application/json
identifier
required
string000016111MSGWG\d{2}[0-9A-Z]{12}0000
modelIds
Array of strings [ 1 .. 2147483647 ] items
validate
boolean

Responses

Request samples

Content type
application/json
{
  • "identifier": "identifier.001",
  • "validate": true,
  • "modelIds": [
    ]
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": {}
}

查询白名单

path Parameters
modelId
required
string
query Parameters
keyword
string
Example: keyword=112233

搜索关键字

Responses

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": {
    "whitelist": [
      {
        "identifier": "12345",
        "modelIds": [
          "zigbee.001"
        ]
      }
    ]
  }
}

查询最新物模型

path Parameters
productKey
required
string

Responses

清空白名单

path Parameters
modelId
required
string

Responses

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": {}
}

删除白名单

path Parameters
identifier
required
string
modelId
required
string

Responses

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": {}
}

5.文件管理API

多媒体文件上传

Request Body schema: multipart/form-data
file
string <binary>

Responses

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": {
    "fileSzie": 1000,
    "filePath": "http://www.midea.com/hello.txt",
    "md5sum": "c5c834c80e257a6f4dcf03210c74fc"
  }
}

上传base64转换成pdf文件下载

Request Body schema: application/json
businessId
required
string
businessType
required
string
fileName
string
remoteFilename
string
fileExt
string
contentType
string
fileServer
string
privacy
string
businessGetUri
string
businessServiceName
string
fileBase64Content
required
string

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "businessType": "string",
  • "fileName": "string",
  • "remoteFilename": "string",
  • "fileExt": "string",
  • "contentType": "string",
  • "fileServer": "string",
  • "privacy": "string",
  • "businessGetUri": "string",
  • "businessServiceName": "string",
  • "fileBase64Content": "string"
}

上传base64转换成pdf文件下载

Request Body schema: application/json
businessId
required
string
businessType
required
string
fileName
string
remoteFilename
string
fileExt
string
contentType
string
fileServer
string
privacy
string
businessGetUri
string
businessServiceName
string
fileBase64Content
required
string

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "businessType": "string",
  • "fileName": "string",
  • "remoteFilename": "string",
  • "fileExt": "string",
  • "contentType": "string",
  • "fileServer": "string",
  • "privacy": "string",
  • "businessGetUri": "string",
  • "businessServiceName": "string",
  • "fileBase64Content": "string"
}

文件上传

Request Body schema: application/json
businessId
required
string
businessType
required
string
fileName
string
remoteFilename
string
fileExt
string
contentType
string
fileServer
string
privacy
string
businessGetUri
string
businessServiceName
string
fileBase64Content
required
string

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "businessType": "string",
  • "fileName": "string",
  • "remoteFilename": "string",
  • "fileExt": "string",
  • "contentType": "string",
  • "fileServer": "string",
  • "privacy": "string",
  • "businessGetUri": "string",
  • "businessServiceName": "string",
  • "fileBase64Content": "string"
}

Response samples

Content type
*/*
{
  "message": "Ok",
  "code": 200,
  "data": {
    "filePath": "http://www.midea.com/hello.txt",
    "md5sum": "c5c834c80e257a6f4dcf03210c74fc"
  }
}

导出数据API

下载sql

Request Body schema: application/json
object
empty
boolean
property name*
additional property
object

Responses

Request samples

Content type
application/json
{
  • "innerMap": {
    },
  • "empty": true,
  • "property1": { },
  • "property2": { }
}

产品认证证书

path Parameters
approvalId
required
integer <int32>
query Parameters
fileName
string

Responses