NB-IoT Suite Product Introduction QuickStart User Guide Device Development Guide Application Development Guide Best Practices FAQ Service agreement Update Log

Add new trigger

Request format: POST

URL: http(s)://api.heclouds.com/triggers

I only want to see examples!!!

http request parameter

Parameter NameFormatRequired?Description
titlestringYesTrigger name
ds_idstringNoOptional, data flow name; the data flow name is composed of {obj_id}_{obj_inst_id}_{res_id}
dev_idsarray-stringNoOptional, device ID
ds_uuidsarray-stringNoOptional, data flow uuid
urlstringYesAlarm notification address
typestringYesTrigger conditions. See the type description list.
thresholdYesThreshold value of trigger conditions, used together with type; see type description list.
Parameter description
1. Trigger meaning: when the data point within the specified range meets the trigger condition
2. The trigger has three trigger modes.
   1)If ds_id is separately specified in the request parameter, and other parameters are not included, under the current item, all data will enter the trigger judgment logic;
   2)If ds_uuids data array is separately specified in the request parameter, only the specified data flows will enter the trigger judgment logic;
   3)If ds_id and dev_ids are specified in the request parameter, only the data flow of the specified devices will enter the trigger judgment logic;
type description table
typeDescription
>The threshold must be a number.
<The threshold must be a number.
>=The threshold must be a number.
<=< td="">The threshold must be a number.
inoutIf threshold is set to be{"lolmt" 40 "uplmt" 52}, this means it will be triggered when the data value enters or leaves the closed interval [ 40, 52].
changethreshold parameters need not be transferred; the alarm will be triggered when the uploaded value is changed.
frozenThe threshold is a value specifying the seconds within which data are not reported and the alarm is triggered, and meanwhile, the monitored object is frozen.
liveThe threshold is a numeric value, specifying the time required to trigger an alarm after data reporting

Return Parameters

NameFormatDescription
errnointCall error code, where 0 means success.
error stringError description, where "succ" means success.
datajsonDevice dependent message returned after the interface is successfully invoked; see Data Description Table
Data Description Table
NameFormatDescription
trigger_idintTrigger ID

Example of request header

POST http://api.heclouds.com/triggers HTTP/1.1
api-key: YHC**************VqKA=

Example of request parameter

{
    "title": "trigger",
    "ds_id": "gps",
    "url": "http://aoic.choqf.com",
    "type": ">",
    "threshold": 100
}

Return example

{
    "errno":0,
    "data": {
        "trigger_id":123809
    },
    "error":"succ"
}

Example of trigger data

{
    "trigger": {
        "id": 123809,
        "threshold": 9.0,
        "type": ">"
    },
    "current_data": [{
            "dev_id": "2656",
            "ds_id": "gps",
            "ds_uuid": "FWEF-ZFW-ZFW-ZFWW",
            "at": "2009-09-07T12:16:02.001403Z",
            "value": 100
        }
    ]
}

< query device history command

update trigger >

个搜索结果,搜索内容 “

    0 个搜索结果,搜索内容 “