[Event Rule] distinguish different softwareTriggerEvent
AnsweredI have already created event rules by SystemAPI /ec2/saveEventRule.
There are three software trigger buttons, trigger different commands separately.
But when I click one of the buttons, these three different commands will be triggered at the same time.
How can I solve this problem?
Here is one of event rule data.
{
"actionParams": "{\"allUsers\":false,\"authType\":\"authBasicAndDigest\",\"durationMs\":5000,\"forced\":true,\"fps\":10,\"httpMethod\":\"GET\",\"needConfirmation\":false,\"playToClient\":true,\"recordAfter\":0,\"recordBeforeMs\":1000,\"streamQuality\":\"highest\",\"url\":\"https://192.168.0.228:443/ASWeb/WebService.srf?username=1&password=1&module=monitor&is_nx=1&action=DOOR_OPERATION&operation=UNLOCK_DOOR&dvg_id=0&ctrl_id=1&dr_id=0\",\"useSource\":false}",
"actionResourceIds": [],
"actionType": "execHttpRequestAction",
"aggregationPeriod": 0,
"comment": "ASManager Software Trigger Event",
"disabled": false,
"eventCondition": "{\"caption\":\"GV-AS810-Join - Door 1 - Unlock Door\",\"description\":\"_door_opened\",\"eventTimestampUsec\":\"0\",\"eventType\":\"undefinedEvent\",\"inputPortId\":1001,\"metadata\":{\"allUsers\":true,\"level\":\"\"},\"omitDbLogging\":false,\"progress\":0,\"reasonCode\":\"none\"}",
"eventResourceIds": [
"{01357f1b-0e0d-e85c-a0a7-e07b816cb748}",
"{67bb95bd-66dc-f753-c1ba-f399faf82e95}"
],
"eventState": "Undefined",
"eventType": "softwareTriggerEvent",
"id": "{bd17e476-a25d-451f-9d8c-3f873c36e4e1}",
"schedule": "",
"system": false
}
-
Marked as "answered" since the problem has been discussed and resolved in the ticket system.
---The problem was caused by the incorrect format for the value of \"inputPortId\".
You need to add the double quotes and slash to the value as well. The most important is to assign a unique value for each soft trigger rule.Please check the content from the manual-created rule of a soft trigger event below. It will assign a unique ID with the correct format \"inputPortId\":\"82a87f8e-ffde-4739-8181-3acae585556c\"
{
"actionParams": "{\"allUsers\":false,\"authType\":\"authBasicAndDigest\",\"durationMs\":5000,\"forced\":true,\"fps\":10,\"httpMethod\":\"GET\",\"needConfirmation\":false,\"playToClient\":true,\"recordAfter\":0,\"recordBeforeMs\":1000,\"streamQuality\":\"highest\",\"url\":\"https://adminapi:admin1234@localhost:7001/api/createEvent?source=manual\",\"useSource\":false}",
"actionResourceIds": [],
"actionType": "execHttpRequestAction",
"aggregationPeriod": 0,
"comment": "",
"disabled": false,
"eventCondition": "{\"caption\":\"Manual create\",\"description\":\"_bell_on\",\"eventTimestampUsec\":\"0\",\"eventType\":\"undefinedEvent\",\"inputPortId\":\"82a87f8e-ffde-4739-8181-3acae585556c\",\"metadata\":{\"allUsers\":false,\"instigators\":[\"{00000000-0000-0000-0000-100000000000}\"],\"level\":\"\"},\"omitDbLogging\":false,\"progress\":0,\"reasonCode\":\"none\"}",
"eventResourceIds": [
"{583b52ef-c669-396b-d043-ea1e59f07302}"
],
"eventState": "Undefined",
"eventType": "softwareTriggerEvent",
"id": "{ddbecffd-66a3-4916-ad29-6c5c90f1864f}",
"schedule": "",
"system": false
}
Please sign in to leave a comment.
Comments
1 comment