位置模型場景聯動

1、查詢場景模版列表

http請求方式: POST

https://iot-cloudapi.clife.cn/v5x/open/api/scene/location/template/list

密鑰類型:僅限項目密鑰

參數說明

參數名稱是(yes)否必須字段類型參數說明
nodeCode是(yes)String位置節點
pagerPager分頁參數

返回結果

正确的(of)Json返回結果:

{
	"code": 0,
	"data": {
		"pager": {
			"hasPrevPage": false,
			"currPageRows": 10,
			"pageRows": 10,
			"paged": false,
			"pageStartRow": 0,
			"pageIndex": 1,
			"hasNextPage": true,
			"pageEndRow": 9,
			"totalPages": 6,
			"defaultPageRows": 20,
			"totalRows": 56
		},
		"list": [{
			"summary": "數聯02",
			"sceneType": 0,
			"sceneName": "數聯02",
			"pictureUrl": "",
			"sceneId": 1001,
			"sceneDeviceVOList": [{
				"deviceTypeId": 431,
				"productId": 11305,
				"productName": "西門子 10A 智能插座(2USB)/11305"
			}]
		}]
	},
	"msg": "成功"
}
	
字段名稱字段類型字段說明
pagerObject分頁相關信息
listList場景模版列表
summaryString場景簡介
sceneTypeInteger場景類型
sceneNameString場景名稱
pictureUrlString圖片地(land)址
sceneIdInteger場景ID
sceneDeviceVOListList場景設備列表
deviceTypeIdInteger設備類型ID
productIdInteger産品ID
productNameInteger産品名稱

2、查詢場景模版詳情

http請求方式: POST

https://iot-cloudapi.clife.cn/v5x/open/api/scene/location/template/detail

密鑰類型:僅限項目密鑰

參數說明

參數名稱是(yes)否必須字段類型參數說明
sceneId是(yes)Integer場景模版ID

返回結果

正确的(of)Json返回結果:

{
	"code": 0,
	"data": {
		"summary": "全部關全部關",
		"sceneName": "全部關",
		"pictureUrl": "",
		"sceneId": 1235,
		"detail": {
			"conditionInstances": [{
				"deviceTypeId": 12288,
				"conditionName": "海曼智能水浸探測器-狀态",
				"operatorName": "是(yes)",
				"conditionTypeId": 1,
				"conProductId": 12288,
				"deviceTypeName": "海曼智能水浸探測器",
				"conditionValueName": "是(yes)漏水",
				"condtionOptionId": 824,
				"conditionInstanceId": 7439
			}],
			"actions": [{
				"deviceTypeId": 13254,
				"actionsItems": [{
						"functionName": "三路開關",
						"unitCode": "無",
						"configDataField": "Switch_3_OnOff_Null",
						"functionParamName": "關"
					},
					{
						"functionName": "二路開關",
						"unitCode": "無",
						"configDataField": "Switch_2_OnOff_Null",
						"functionParamName": "關"
					},
					{
						"functionName": "一(one)路開關",
						"unitCode": "無",
						"configDataField": "Switch_1_OnOff_Null",
						"functionParamName": "關"
					}
				],
				"actionsType": 1,
				"deviceTypeName": "三路智能開關",
				"actionsId": 5130,
				"actProductId": 13254
			}]
		}
	},
	"msg": "成功"
}
	
字段名稱字段類型字段說明
pagerObject分頁相關信息
listList場景列表信息
summaryString場景簡介
sceneNameString場景名稱
pictureUrlString圖片地(land)址
sceneIdInteger場景模版ID
detailObject場景模版詳情
userConditionInstancesList場景詳情-條件列表
deviceTypeIdInteger設備類型ID
conditionNameString條件名稱
operatorNameString操作(do)名稱
conditionTypeIdInteger條件類型ID
conProductIdInteger産品ID
deviceTypeNameString條件類型名稱
conditionValueNameString條件值名稱
condtionOptionIdInteger條件選項名稱
conditionInstanceIdInteger條件實例ID
actionsList場景模版詳情-動作(do)列表
deviceTypeIdInteger設備類型ID
deviceTypeNameString設備類型名稱
actionsTypeInteger動作(do)類型
actionsIdString動作(do)Id
actProductIdString産品ID
actionsItemsList動作(do)明細
functionNameString方法名稱
unitCodeString單位
configDataFieldString配置數據列
functionParamNameString方法參數名稱

3、場景模版适配

http請求方式: POST

https://iot-cloudapi.clife.cn/v5x/open/api/scene/location/template/adapt

密鑰類型:僅限項目密鑰

參數說明

參數名稱是(yes)否必須字段類型參數說明
conDeviceIdsStrString條件對應傳入的(of)設備ID {"conditionInstanceId":"deviceId", ...}
actDeviceIdsStr是(yes)String動作(do)對應傳入的(of)設備ID {"actionsId":"deviceId", ...}
nodeCode是(yes)String位置節點
sceneId是(yes)Integer場景模版Id
userSceneName是(yes)String實例場景名稱

返回結果

正确的(of)Json返回結果:

{
	"code": 0,
	"data": {
		"summary": "C-Life,生(born)活本該如此,暢享智能場景!",
		"sceneId": 0,
		"validity": 1,
		"detail": {
			"userActions": [{
				"pictureUrl": "static/picture/a9283a016c2040b43ec70263eb025a45.png",
				"delayTime": 0,
				"deviceId": "77E5389FC3AD4DECE3C56FBCDCFC63FF",
				"deviceName": "天王蓋地(land)虎WIFI版(普通設備)",
				"userActionsType": 1,
				"userActionsId": 79674,
				"userActionsItems": [{
					"functionParamId": 4237,
					"unitCode": "",
					"configDataField": "Switch",
					"deviceFunctionId": 1623,
					"deviceFunctionName": "開關",
					"functionParamName": "開",
					"actionParamValue": "1"
				}]
			}],
			"userConditionInstances": [{
				"conditionOptionName": "定時(hour)時(hour)間",
				"conditionName": "定時(hour)參數",
				"conditionValueName": "07:00",
				"conditionTypeName": "定時(hour)時(hour)間",
				"repetition": "0,1,2,3,4,5,6,",
				"operatorName": "是(yes)",
				"conditionTypeId": 3,
				"conditionId": 25,
				"userConditionInstanceId": 31687,
				"unitCode": "",
				"conditionValue": "07:00|0,1,2,3,4,5,6,",
				"conditionTypeKey": "TIMMING",
				"timePoint": "07:00",
				"operatorId": 1
			}],
			"expression": "&&",
			"enableTime": "MON,TUE,WED,THU,FRI,SAT,SUN;00:00-23:59"
		},
		"userSceneId": "772303c4704e4906bc2c34401871a9b2",
		"userSceneName": "定時(hour)-07:00開啓設備",
		"runStatus": 1,
		"userSceneType": 0
	},
	"msg": "成功"
}
	
字段名稱字段類型字段說明
summaryString場景簡介
sceneIdInteger場景模闆ID
validityInteger場景是(yes)否有效
userSceneIdString實例場景ID
userSceneNameString實例場景名稱
runStatusInteger場景狀态
userSceneTypeInteger實例場景類型
detailObject實例場景詳情
userActionsList場景詳情-動作(do)列表
pictureUrlString圖片地(land)址
delayTimeString延遲時(hour)間
deviceIdString設備ID
deviceNameString設備名稱
userActionsTypeString動作(do)類型
userActionsIdString實例動作(do)Id
userActionsItemsList實例動作(do)明細
functionParamIdInteger方法參數ID
unitCodeString單位
configDataFieldString配置數據列
deviceFunctionIdInteger設備方法ID
deviceFunctionNameString設備方法名稱
functionParamNameString方法參數名稱
actionParamValueString動作(do)參數值
userConditionInstancesList場景詳情-條件列表
conditionOptionNameString條件選項名稱
conditionNameString條件名稱
conditionValueNameString條件值名稱
conditionTypeNameString條件類型名稱
repetitionString重複執行日期
operatorNameString操作(do)名稱
conditionTypeIdInteger條件類型ID
conditionIdInteger條件ID
userConditionInstanceIdInteger實例條件實例Id
unitCodeString單位
conditionValueString條件值
conditionTypeKeyString條件類型key
timePointString時(hour)間節點
operatorIdInteger操作(do)Id
expressionString條件表達式
enableTimeString場景開啓時(hour)間

4、查詢實例場景列表

http請求方式: POST

https://iot-cloudapi.clife.cn/v5x/open/api/scene/location/list

密鑰類型:僅限項目密鑰

參數說明

參數名稱是(yes)否必須字段類型參數說明
nodeCode是(yes)String位置節點
pagerPager分頁參數

返回結果

正确的(of)Json返回結果:

{
	"code":0,
	"data":{
		"pager":{
			"hasPrevPage":false,
			"currPageRows":5,
			"pageRows":10,
			"paged":false,
			"pageStartRow":0,
			"pageIndex":1,
			"hasNextPage":false,
			"pageEndRow":9,
			"totalPages":1,
			"defaultPageRows":20,
			"totalRows":5
		},
		"list":[
			{
				"summary":"C-Life,生(born)活本該如此,暢享智能場景!",
				"sceneId":0,
				"validity":1,
				"detail":{
					"userActions":[
						{
							"pictureUrl":"static/picture/a9283a016c2040b43ec70263eb025a45.png",
							"delayTime":0,
							"deviceId":"77E5389FC3AD4DECE3C56FBCDCFC63FF",
							"deviceName":"天王蓋地(land)虎WIFI版(普通設備)",
							"userActionsType":1,
							"userActionsId":79674,
							"userActionsItems":[
								{
									"functionParamId":4237,
									"unitCode":"",
									"configDataField":"Switch",
									"deviceFunctionId":1623,
									"deviceFunctionName":"開關",
									"functionParamName":"開",
									"actionParamValue":"1"
								}
							]
						}
					],
					"userConditionInstances":[
						{
							"conditionOptionName":"定時(hour)時(hour)間",
							"conditionName":"定時(hour)參數",
							"conditionValueName":"07:00",
							"conditionTypeName":"定時(hour)時(hour)間",
							"repetition":"0,1,2,3,4,5,6,",
							"operatorName":"是(yes)",
							"conditionTypeId":3,
							"conditionId":25,
							"userConditionInstanceId":31687,
							"unitCode":"",
							"conditionValue":"07:00|0,1,2,3,4,5,6,",
							"conditionTypeKey":"TIMMING",
							"timePoint":"07:00",
							"operatorId":1
						}
					],
					"expression":"&&",
					"enableTime":"MON,TUE,WED,THU,FRI,SAT,SUN;00:00-23:59"
				},
				"userSceneId":"772303c4704e4906bc2c34401871a9b2",
				"userSceneName":"定時(hour)-07:00開啓設備",
				"runStatus":1,
				"userSceneType":0
			}
		]
	},
	"msg":"成功"
}
	
字段名稱字段類型字段說明
pagerObject分頁相關信息
listList場景列表信息
summaryString場景簡介
sceneIdInteger場景模闆ID
validityInteger場景是(yes)否有效
userSceneIdString實例場景ID
userSceneNameString實例場景名稱
runStatusInteger場景狀态
userSceneTypeInteger實例場景類型
detailObject實例場景詳情
userActionsList場景詳情-動作(do)列表
pictureUrlString圖片地(land)址
delayTimeString延遲時(hour)間
deviceIdString設備ID
deviceNameString設備名稱
userActionsTypeString動作(do)類型
userActionsIdString實例動作(do)Id
userActionsItemsList實例動作(do)明細
functionParamIdInteger方法參數ID
unitCodeString單位
configDataFieldString配置數據列
deviceFunctionIdInteger設備方法ID
deviceFunctionNameString設備方法名稱
functionParamNameString方法參數名稱
actionParamValueString動作(do)參數值
userConditionInstancesList場景詳情-條件列表
conditionOptionNameString條件選項名稱
conditionNameString條件名稱
conditionValueNameString條件值名稱
conditionTypeNameString條件類型名稱
repetitionString重複執行日期
operatorNameString操作(do)名稱
conditionTypeIdInteger條件類型ID
conditionIdInteger條件ID
userConditionInstanceIdInteger實例條件實例Id
unitCodeString單位
conditionValueString條件值
conditionTypeKeyString條件類型key
timePointString時(hour)間節點
operatorIdInteger操作(do)Id
expressionString條件表達式
enableTimeString場景開啓時(hour)間

5、查詢實例場景詳情

http請求方式: POST

https://iot-cloudapi.clife.cn/v5x/open/api/scene/location/detail

密鑰類型:僅限項目密鑰

參數說明

參數名稱是(yes)否必須字段類型參數說明
nodeCode是(yes)String位置節點
userSceneId是(yes)Integer實例場景ID

返回結果

正确的(of)Json返回結果:

{
	"code": 0,
	"data": {
		"summary": "C-Life,生(born)活本該如此,暢享智能場景!",
		"sceneId": 0,
		"validity": 1,
		"detail": {
			"userActions": [{
				"pictureUrl": "static/picture/a9283a016c2040b43ec70263eb025a45.png",
				"delayTime": 0,
				"deviceId": "77E5389FC3AD4DECE3C56FBCDCFC63FF",
				"deviceName": "天王蓋地(land)虎WIFI版(普通設備)",
				"userActionsType": 1,
				"userActionsId": 79674,
				"userActionsItems": [{
					"functionParamId": 4237,
					"unitCode": "",
					"configDataField": "Switch",
					"deviceFunctionId": 1623,
					"deviceFunctionName": "開關",
					"functionParamName": "開",
					"actionParamValue": "1"
				}]
			}],
			"userConditionInstances": [{
				"conditionOptionName": "定時(hour)時(hour)間",
				"conditionName": "定時(hour)參數",
				"conditionValueName": "07:00",
				"conditionTypeName": "定時(hour)時(hour)間",
				"repetition": "0,1,2,3,4,5,6,",
				"operatorName": "是(yes)",
				"conditionTypeId": 3,
				"conditionId": 25,
				"userConditionInstanceId": 31687,
				"unitCode": "",
				"conditionValue": "07:00|0,1,2,3,4,5,6,",
				"conditionTypeKey": "TIMMING",
				"timePoint": "07:00",
				"operatorId": 1
			}],
			"expression": "&&",
			"enableTime": "MON,TUE,WED,THU,FRI,SAT,SUN;00:00-23:59"
		},
		"userSceneId": "772303c4704e4906bc2c34401871a9b2",
		"userSceneName": "定時(hour)-07:00開啓設備",
		"runStatus": 1,
		"userSceneType": 0
	},
	"msg": "成功"
}
	
字段名稱字段類型字段說明
summaryString場景簡介
sceneIdInteger場景模闆ID
validityInteger場景是(yes)否有效
userSceneIdString實例場景ID
userSceneNameString實例場景名稱
runStatusInteger場景狀态
userSceneTypeInteger實例場景類型
detailObject實例場景詳情
userActionsList場景詳情-動作(do)列表
pictureUrlString圖片地(land)址
delayTimeString延遲時(hour)間
deviceIdString設備ID
deviceNameString設備名稱
userActionsTypeString動作(do)類型
userActionsIdString實例動作(do)Id
userActionsItemsList實例動作(do)明細
functionParamIdInteger方法參數ID
unitCodeString單位
configDataFieldString配置數據列
deviceFunctionIdInteger設備方法ID
deviceFunctionNameString設備方法名稱
functionParamNameString方法參數名稱
actionParamValueString動作(do)參數值
userConditionInstancesList場景詳情-條件列表
conditionOptionNameString條件選項名稱
conditionNameString條件名稱
conditionValueNameString條件值名稱
conditionTypeNameString條件類型名稱
repetitionString重複執行日期
operatorNameString操作(do)名稱
conditionTypeIdInteger條件類型ID
conditionIdInteger條件ID
userConditionInstanceIdInteger實例條件實例Id
unitCodeString單位
conditionValueString條件值
conditionTypeKeyString條件類型key
timePointString時(hour)間節點
operatorIdInteger操作(do)Id
expressionString條件表達式
enableTimeString場景開啓時(hour)間

6、通過實例場景ID列表獲取場景

http請求方式: POST

https://iot-cloudapi.clife.cn/v5x/open/api/scene/location/list/ids

密鑰類型:僅支持項目密鑰

參數說明

參數名稱是(yes)否必須字段類型參數說明
userSceneIdList是(yes)String實例場景ID列表,如["4d677871", "4f9ebe395"]

返回結果

正确的(of)Json返回結果:

{
	"code":0,
	"data":[
		{
			"sceneId":0,
			"validity":0,
			"userSceneId":"5b1540488c864625a2b2c005008aeb1e",
			"userSceneName":"智能插座",
			"runStatus":0,
			"userSceneType":1
		},
		{
			"sceneId":873,
			"validity":0,
			"userSceneId":"ea38962f25b34f89a3ad53a087e0b077",
			"userSceneName":"艾美face場景1-用(use)戶離開",
			"runStatus":0,
			"userSceneType":1
		}
	],
	"msg":"成功"
}
		
字段名稱字段類型字段說明
sceneIdInteger場景模闆ID
validityInteger場景是(yes)否有效
userSceneIdString實例場景ID
userSceneNameString實例場景名稱
runStatusInteger場景狀态
userSceneTypeInteger實例場景類型

7、開啓場景

http請求方式: POST

https://iot-cloudapi.clife.cn/v5x/open/api/scene/location/start

密鑰類型:僅限項目密鑰

參數說明

參數名稱是(yes)否必須字段類型參數說明
userSceneId是(yes)String實例場景ID

返回結果

正确的(of)Json返回結果:

{
	"data": true,
	"code": 0
}
		

8、關閉場景

http請求方式: POST

https://iot-cloudapi.clife.cn/v5x/open/api/scene/location/stop

密鑰類型:僅限項目密鑰

參數說明

參數名稱是(yes)否必須字段類型參數說明
userSceneId是(yes)String實例場景ID

返回結果

正确的(of)Json返回結果:

{
	"data": true,
	"code": 0
}
		

9、删除場景

http請求方式: POST

https://iot-cloudapi.clife.cn/v5x/open/api/scene/location/delete

密鑰類型:僅限項目密鑰

參數說明

參數名稱是(yes)否必須字段類型參數說明
userSceneId是(yes)String實例場景ID

返回結果

正确的(of)Json返回結果:

{
	"data": {},
	"code": 0
}