Multiple-conditions Management
Create a multiple-conditions
- API intent: config.event.create
- Description: This interface is used to customize trigger conditions (Conditions), and supports multiple combinations of "AND" and "OR" conditions to trigger. After querying the condition parameter description through the "query.ifttt.trigger" interface, then create a condition set through this interface.
- Request parameters
Name |
Type |
Is required? |
Description |
name |
String |
Yes |
Multiple-conditions name |
positionId |
String |
No |
Position ID, default position when the value is empty |
relation |
Integer |
Yes |
0: AND 1: OR Default is 0 |
condition |
Array(Object) |
Yes |
Trigger condition content, see condition content description for details |
condition description
Name |
Type |
Is required? |
Description |
subjectId |
string |
No |
Subject ID (Such as device id, scene id) (must be filled in with model or subjectid) |
model |
String |
No |
Object model |
triggerDefinitionId |
String |
Yes |
Trigger id |
beginTime |
String |
No |
Begin time. The format is as follows. |
endTime |
String |
No |
End time. The format is as follows. |
params |
Array(Object) |
No |
Parameters, see params description for details |
Note: Timing time format: “min hour day month week”.
- “min”: The value ranges from 0 to 59. The value \ indicates that the minute is not limited.*
- “hour”: The value ranges from 0 to 23. The value \ indicates that the hour is not limited.*
- “day”: The value ranges from 1-31, and the value \ indicates no limit to the day, any day.*
- “month”: The value ranges from 1 to 12, and the value \ indicates no limit to the month, any month.*
- “week”: The value range is 0-8, 0 means Sunday, 1-6 means Monday-Saturday, 7 means holiday, 8 means working day, value \ indicates no limit to the week*.
For example:
- “10 11 * * 1,2,3,4,5,6,0” means 11:10 am every day
- “20 18 * * 1,4,6” means 18:20 pm every Monday, Thursday and Saturday
params description
Name |
Type |
Is required? |
Description |
paramId |
string |
No |
Parameter id |
value |
String |
No |
value |
paramType |
String |
No |
Parameter Type |
paramUnit |
String |
No |
Parameter Unit |
{
"intent": "config.event.create",
"data": {
"positionId":"real1.832621257077604352",
"name": "name1",
"relation": "0",
"condition": [
{
"subjectId": "virtual2.55793119265827",
"triggerDefinitionId": "TD.lumi.gateway.light_on"
},
{
"subjectId": "virtual2.55793119265827",
"triggerDefinitionId": "TD.lumi.gateway.illumination_more_than",
"params": [
{
"paramId": "PD.illumination",
"value": "20"
}
]
}
]
}
}
Name |
Type |
Description |
eventId |
string |
Multiple-conditions ID |
{
"code": 0,
"message": "Success",
"msgDetails": "",
"requestId": "",
"result": {
"eventId": "CL.842499037874565120"
}
}
Update multiple-conditions
- API intent: config.event.update
- Description: This interface is used to modify the parameter configuration and name of the multiple-conditions.
- Request parameters
Name |
Type |
Is required? |
Description |
eventId |
String |
Yes |
Multiple-conditions ID |
name |
String |
Yes |
Multiple-conditions name |
positionId |
String |
No |
Position ID, default position when the value is empty |
relation |
Integer |
Yes |
0: AND 1: OR Default is 0 |
condition |
Array(Object) |
Yes |
Trigger condition content, see condition content description for details |
enable |
Integer |
Yes |
Whether multiple-conditions is available, 0: disable 1: enable |
condition description
Name |
Type |
Is required? |
Description |
subjectId |
string |
No |
Subject ID (Such as device id, scene id) (must be filled in with model or subjectid) |
model |
String |
No |
Object model |
triggerDefinitionId |
String |
Yes |
Trigger id |
beginTime |
String |
No |
Begin time |
endTime |
String |
No |
End time |
params |
Array(Object) |
No |
Parameters, see params description for details |
params description
Name |
Type |
Is required? |
Description |
paramId |
string |
No |
Parameter id |
value |
String |
No |
value |
paramType |
String |
No |
Parameter Type |
paramUnit |
String |
No |
Parameter Unit |
{
"intent": "config.event.update",
"data": {
"eventId": "CL.842499037874565120",
"enable":0,
"positionId":"real1.832621257077604352",
"name": "name1",
"relation": 0,
"condition": [
{
"subjectId": "virtual2.55793119265827",
"triggerDefinitionId": "TD.lumi.gateway.light_on"
},
{
"subjectId": "virtual2.55793119265827",
"triggerDefinitionId": "TD.lumi.gateway.illumination_more_than",
"params": [
{
"paramId": "PD.illumination",
"value": "20"
}
]
}
]
}
}
Name |
Type |
Description |
eventId |
string |
Multiple-conditions ID |
{
"code": 0,
"message": "Success",
"msgDetails": "",
"requestId": "",
"result": {
"eventId": "CL.842499037874565120"
}
}
Delete multiple-conditions
- API intent: config.event.delete
- Description: This interface is used to delete the multiple-conditions.
- Request parameters
Name |
Type |
Is required? |
Description |
eventId |
String |
Yes |
Multiple-conditions ID |
{
"intent": "config.event.delete",
"data": {
"eventId": "CL.842499037874565120"
}
}
Response parameters:NA
Response demo
{
"code": 0,
"message": "Success",
"msgDetails": "",
"requestId": "",
"result": ""
}
- API intent: query.event.detail
- Description: This interface is used to query the configuration details of each condition of the multiple-conditions.
- Request parameters
Name |
Type |
Is required? |
Description |
eventId |
String |
Yes |
Multiple-conditions id |
{
"intent": "query.event.detail",
"data": {
"eventId": "CL.842499037874565120"
}
}
Name |
Type |
Description |
eventId |
string |
Multiple-conditions ID |
name |
String |
Multiple-conditions name |
enable |
int |
Whether multiple-conditions is available, 0: disable 1: enable |
triggerType |
int |
0-transient, 1-state, 2-both |
eventType |
int |
0-edge trigger, 1-flat trigger |
localizd |
int |
0:Cloud execution 1:Local execution 3:Clouding 4: Localizing |
abnormal |
int |
Is it abnormal. 0-normal, 1-abnormal |
positionId |
String |
Position Id |
createTime |
long |
Create Time |
updateTime |
long |
Update Time |
{
"code": 0,
"message": "Success",
"msgDetails": "",
"requestId": "",
"result": {
"eventId": "CL.842499037874565120",
"localizd": 0,
"abnormal": 0,
"positionId": "real1.832621257077604352",
"createTime": 1620908886829,
"enable": 0,
"name": "name1",
"updateTime": 1620908886829,
"eventType": 1,
"triggerType": 0
}
}
Query multiple-conditions based on subject Id
- API intent: query.event.listBySubjectId
- Description: This interface can query the list of condition sets associated with the object based on the object ID.
- Request parameters
Name |
Type |
Is required? |
Description |
subjectId |
String |
Yes |
Subject Id |
{
"intent": "query.event.listBySubjectId",
"data": {
"subjectId": "virtual2.55793119265827"
}
}
Name |
Type |
Description |
eventId |
string |
Multiple-conditions ID |
name |
String |
Multiple-conditions name |
enable |
int |
0: disable 1: enable |
model |
String |
Subject model |
localizd |
int |
0:Cloud execution 1:Local execution 3:Clouding 4: Localizing |
{
"code": 0,
"message": "Success",
"msgDetails": null,
"requestId": "",
"result": [
{
"eventId": "CL.862291336538177536",
"localizd": 0,
"enable": 1,
"name": "name1",
"model": "app.event.v1"
},
{
"eventId": "CL.848949449934348288",
"localizd": 0,
"enable": 1,
"name": "name4",
"model": "app.event.v1"
}
]
}
Query multiple-conditions based on location
- API intent: query.event.listByPositionId
- Description: This interface is used to query the list of multiple-conditions at the specified location.
- Request parameters
Name |
Type |
Is required? |
Description |
positionId |
String |
No |
Position ID, if it is empty, query all multiple-conditions under the user |
pageNum |
Int |
No |
Page number, default value 1 |
pageSize |
Int |
No |
The number of items per page, the default value is 50 |
{
"intent": "query.event.listByPositionId",
"data": {
"positionId": "real1.832621257077604352",
"pageSize": 50,
"pageNum": 1
}
}
Name |
Type |
Description |
data |
Array |
Multiple-conditions information |
totalCount |
int |
Total number of multiple-conditions |
data description
Name |
Type |
Description |
eventId |
string |
Multiple-conditions id |
name |
String |
Multiple-conditions name |
enable |
int |
Whether multiple-conditions is available, 0: disable 1: enable |
model |
String |
Subject model |
positionId |
String |
Postion id |
localizd |
int |
0:Cloud execution 1:Local execution 3:Clouding 4: Localizing |
{
"code": 0,
"message": "Success",
"msgDetails": null,
"requestId": "5478.133.16248472111841629",
"result": {
"data": [
{
"eventId": "CL.844588721212261248",
"localizd": 1,
"positionId": "real1.720222961122087808",
"enable": 0,
"name": "name1111",
"model": "app.event.v1"
}
],
"totalCount": 1
}
}