Skip to content

queryAllScenesInfo

调用该接口查询所有场景联动详情信息。

使用说明

此接口是按创建时间倒序查询所有场景联动详情信息。

接口地址

/gateway/openapi

请求方式

POST

请求参数

请求头

名称类型描述
tokenauthorizationString平台颁发的token
apiCodeString固定值:queryAllScenesInfo

请求参数

返回数据说明

名称类型描述
codeString调用成功,返回0,调用失败,查看错误信息。
msgString调用成功,提示"操作成功",调用失败,查看错误信息。
dataList返回结果列表。结果内容详情,查看下方示例。

QueryScenesResponse

名称类型是否必选描述
scenesIdString场景唯一标识
nameString场景名称
descriptionString场景描述
conditionLogicString场景逻辑,可选值如下:
or:满足任意条件;
and:满足所有条件
onekey:一键执行
conditionRuleListList<ConditionRule>场景条件,如果conditionLogic=onekey,则场景条件为空
actionRuleListList<ActionRule>场景执行动作
statusInteger启用状态,0:未启用,1:已启用

ConditionRule

名称类型是否必选描述
idString场景条件id
typeString场景触发类型,可选值如下:
property 设备属性触发
event 设备事件触发
timing 定时触发
productKeyString产品key
productIdString产品id
deviceNameString设备名称
deviceDescString设备备注名
timingDataString定时数据,当type=timing时,才有值。
格式:星期+时间,周一至周日分别对应数字1-7,时间HH:mm
举例:周一周二周日10点触发,1,2,7,10:00
dataList<ConditionDataRule>具体属性条件

ConditionDataRule

名称类型是否必选描述
pidString设备属性pid,对应物模型里的pid
nameString设备属性名字,对应物模型里的pid的功能名称
compareString设备属性条件表达式,可选值如下:
>=
=
between
<=
<
!=
>
compareValueObject条件值,如果compare取值为between,则compareValue格式:30,50,表示温度在30-50之间,包含30和50

ActionRule

名称类型是否必选描述
productKeyString产品key
productIdString产品id
deviceNameString设备名称
deviceDescString设备备注名
pidString下发命令的pid,对应物模型里定义的命令pid
nameString下发命令的pid的名称,对应物模型里定义的命令pid的功能名称
commandIdString命令id
typeString动作类型,固定为command
orderNoInteger命令下发排序号
delayTimeInteger延时执行时间,单位:秒,范围:0-86400
dataObject命令下发数据,格式:{pid:value}
举例:给风机下发指令1,{"status":1}

示例

请求示例

返回示例

json
{
	"code": "0",
	"msg": "操作成功",
	"data": [
		{
			"scenesId": "585b3ccd50e0805d4195d7f8ad2bdd84",
			"name": "abcd",
			"description": "胡夺",
			"conditionLogic": "or",
			"conditionRuleList": [
				{
					"id": "c482e0d7e8f14de3beae517df00bc102",
					"type": "property",
					"productKey": "F4wg3MgrM",
					"productId": "ead030a5252442f68f9a65137508f862",
					"deviceName": "1233243",
					"deviceDesc": "1",
					"data": [
						{
							"pid": "status",
							"name": "状态",
							"compare": "=",
							"compareValue": 1
						}
					],
					"productDevice": {
						"productKey": "F4wg3MgrM",
						"deviceName": "1233243",
						"deviceId": null,
						"productDeviceStr": "F4wg3MgrM&1233243",
						"productDeviceSlashStr": "F4wg3MgrM/1233243"
					}
				}
			],
			"actionRuleList": [
				{
					"productKey": "44yw3jwqj",
					"productId": "808a38503f93434fb43dddfd03c8a8ec",
					"deviceName": "B4JmbNmyN",
					"deviceDesc": "洗碗机",
					"pid": "abcd",
					"name": "abcd",
					"commandId": "b5f851be7f8f4d60a53264361c749894",
					"type": "command",
					"data": {
						"eee": 10
					},
					"delayTime": 20
				},
				{
					"productKey": "44yw3jwqj",
					"productId": "808a38503f93434fb43dddfd03c8a8ec",
					"deviceName": "B4JmbNmyN",
					"deviceDesc": "洗碗机",
					"pid": "open",
					"name": "开机",
					"commandId": "f089a0b394ae421a97c78e11b271ab9c",
					"type": "command",
					"data": {
						"status": 1
					},
					"delayTime": 0
				}
			],
			"status": 0
		},
		{
			"scenesId": "3cd2ed96a7e3d80a7252fc79ef00b687",
			"name": "222",
			"description": "fds",
			"conditionLogic": "or",
			"conditionRuleList": [
				{
					"id": "08a41e9f13d14e80bc5bc1b94491c3d7",
					"type": "property",
					"productKey": "Y3KV1EVQE",
					"productId": "03e84cc821a645a2bf061faabbfe52a9",
					"deviceName": "Z3jY59Yf9",
					"deviceDesc": "2323ggg",
					"data": [
						{
							"pid": "ramUsage",
							"name": "内存使用率",
							"compare": "==",
							"compareValue": "55"
						}
					],
					"productDevice": {
						"productKey": "Y3KV1EVQE",
						"deviceName": "Z3jY59Yf9",
						"deviceId": null,
						"productDeviceStr": "Y3KV1EVQE&Z3jY59Yf9",
						"productDeviceSlashStr": "Y3KV1EVQE/Z3jY59Yf9"
					}
				}
			],
			"actionRuleList": [
				{
					"productKey": "44yw3jwqj",
					"productId": "808a38503f93434fb43dddfd03c8a8ec",
					"deviceName": "B4JmbNmyN",
					"deviceDesc": "洗碗机",
					"pid": "open",
					"name": "开机",
					"commandId": "f089a0b394ae421a97c78e11b271ab9c",
					"type": "command",
					"data": {
						"status": 1
					},
					"delayTime": 0
				}
			],
			"status": 0
		}
	]
}