The Senfi platform offers several options for integrations with external systems. This document aims to provide all of the information needed for developers to use Senfi's resources.
Senfi API uses OAuth2 to authenticate requests. Authenticating via OAuth2 requires the following steps:
Create an API Key in Senfi CMS. This is a one-time operation. You will be provided your API key and its Secret. Please note this information down, as they will be required for the next step.
After you have created your API key, you must make a call to obtain an access token using the Token API call operation. The operation requires the following parameters:
client_id
- Your API Keyclient_secret
- The Secret of your API Keygrant_type
- This must be set to client_credentials
On successful authentication, the response will return an access token and specify how long the token is valid for. You should reuse the bearer token until it is expired. When the token is expired, make the Token API call again to generate a new one.
{
"access_token": "eea7f833-3117-4615-b5c5-04917bfa7e50",
"expires_in": 3599,
".expire": "2020-10-20T07:18:34.009Z"
}
For subsequent API calls, you will need to set request headers with the OAuth2 access token to authenticate yourself.
{
"Authorization": "Bearer eea7f833-3117-4615-b5c5-04917bfa7e50"
}
All URLs referenced in the documentation have the following base:
Most of the parameters and data accompanying your requests will be contained in the body of the HTTP request.
The Senfi API accepts JSON in the HTTP request body. No other data format (e.g., XML) are supported.
After receiving your request, the API sends back an HTTP code and a response in JSON.
The API uses standard HTTP status codes to indicate the success or failure of the API call.
In cases of failure, the body of the response contain an error code with a corresponding error message to indicate details of the error:
{
"success": "false",
"errcode": "invalid_argument",
"errmsg": "Invalid arguments"
}
The Senfi Subscription API allow you to integrate to Senfi and receive on-going data, event, alarms, log, and command updates. The updates from Senfi are push notifications that will be sent to webhook callback URLs.
Subscriptions and webhooks are tied to the API Key you used to authenticate the subscription and webhook requests. You can only set one Webhook per API Key, and all subscriptions made with the API Key will be sent to that webhook.
You will need a server that:
After you have created your webhook, you must make a call to the Set or Remove Webhook API call to register your webhook with Senfi.
To unregister your webhook from Senfi, make the call with webhook
set to `null.
Use the following subscription endpoints to subscribe data to be received by your webhook
The format of subscribed data that Senfi will send to your webhook are documented in the Callback section of the respective subscribe endpoints and also the Data Structure section.
An official SDK library for Senfi API is available for Node.js. However, no SDK is required to use the API.
Installation and usage instructions can be found in the senf-node Github repository . SDK code examples are included in these docs.
Obtain an OAuth2 access token to be used as a Bearer authentication token for subsequent API calls.
client_id required | string Your Senfi API Key |
client_secret required | string The Secret of your Senfi API Key |
grant_type required | string Value: "client_credentials" OAuth2 grant type. This should be |
client_id=my_api_key&client_secret=my_api_secret&grant_type=client_credentials
{- "access_token": "eea7f833-3117-4615-b5c5-04917bfa7e50",
- "expires_in": 3599,
- ".expire": "2020-10-20T07:18:34.009Z"
}
Get token information of OAuth2 access token
access_token required | string Example: access_token=my_api_key Access token to get the information of |
// Not available yet
{- "client_id": "my_api_key",
- "access_token": "eea7f833-3117-4615-b5c5-04917bfa7e50",
- "expires_in": 3599,
- ".expire": "2020-10-20T07:18:34.009Z"
}
Send an email
to required | Array of strings |
title required | string |
content required | string |
{- "to": [
- "user@example.com"
], - "title": "My notification title",
- "content": "Content of email notification"
}
{- "success": true
}
Send an sms
to required | Array of strings |
content required | string |
{- "to": [
- "+651234567"
], - "content": "Content of email notification"
}
{- "success": true
}
Send a telegram notification
to required | Array of strings |
content required | string |
{- "to": [
- "+651234567"
], - "content": "Content of email notification"
}
{- "success": true
}
Send notification to a webhook
to required | Array of strings |
content required | string |
webhook_method | string Enum: "post" "get" "put" |
webhook_header | object |
{- "to": [
- "www.example.com/webhook"
], - "content": "Content of email notification",
- "webhook_method": "post",
- "webhook_header": {
- "Authorization": "Basic ABCDEF"
}
}
{- "success": true
}
Subscribe to alarm. Alarms can be subscribed with the following filters:
event_def_id
site_id
asset_id
You should only filter by one of the above each subscription request.
Choose the appropriate request body schema depending on your subscription requirements.
{ }
{- "success": true,
- "token": "123e4567-e89b-12d3-a456-426614174000"
}
{- "type": "alarm",
- "data": {
- "alarm_def_id": 2445,
- "alarm_data": {
- "alarm_id": "28-24",
- "alarm_def_id": 1234,
- "org_id": 28,
- "name": "alarm",
- "name_localized": { },
- "description": "an alarm",
- "description_localized": { },
- "priority": 5,
- "status": "unacknowledged",
- "defined_flags": [
- "resolved"
], - "settable_by_operator_flags": [ ],
- "flagged_flags": [ ],
- "required_flags": [ ],
- "tm_raised": 1592794445155,
- "raised_by_event_def_id": 1234,
- "raised_by_event_id": "28-35",
- "raised_by_event": {
- "event_id": "28-35",
- "event_def_id": 1234,
- "etc": "..."
}
}
}, - "tm_generated": 0
}
Unsubscribe from alarm
token required | string Subscription token of the subscription to unsubscribe. |
{- "token": "123e4567-e89b-12d3-a456-426614174000"
}
{- "success": true
}
Retrieve asset list
{ }
{- "success": true,
- "assets": [
- {
- "asset_id": 9,
- "name": "Main Lift",
- "site_id": 1000,
- "tags": [
- {
- "measurement_code": "powerlogic_pm5100_v2",
- "tag": {
- "lsid": "LKWE-LKE",
- "country": "SG"
}
}, - {
- "measurement_code": "tms_controller_v1",
- "tag": {
- "lsid": "LKWE-LKE",
- "country": "SG"
}
}
]
}
]
}
Retrieve detailed information about asset
asset_id required | Array of integers |
{- "asset_id": 10244
}
{- "success": true,
- "assets": [
- {
- "asset_id": 8,
- "site_id": 10750,
- "name": "CH_GROUP A1/5",
- "name_localized": { },
- "description": "A Device from T27 Data Centre",
- "description_localized": { },
- "is_virtual": false,
- "has_lift": false,
- "has_movable": false,
- "measurement": [
- {
- "measurement_code": "bearp19_line_intrusion_v1",
- "tag": {
- "camera_code": "1111"
}
}, - {
- "measurement_code": "bearp19_illegal_parking_v1",
- "tag": {
- "camera_code": "1111"
}
}, - {
- "measurement_code": "bearp19_blacklist_face_recognition_v1",
- "tag": {
- "camera_code": "1111"
}
}
], - "stream": [
- {
- "stream_id": "43bd4f1d-09ce-47a1-a901-6cafd2126817",
- "can_ptz": true
}
], - "attribute": [
- {
- "name": "name",
- "value": "Chiller Group A1/5",
- "value_localized": {
- "zh_CN": "冷水机组 A1/5"
}
}
], - "location": {
- "point_2d": null,
- "point_3d": [
- -33.6097869873047,
- 27.5077838897705,
- 37.3557090759277
], - "zone_id": [
- 5729,
- 6248,
- 5871
]
}
}
]
}
Retrieve asset attribute information
asset_id required | integer |
attribute_name required | string |
locale | string |
{- "asset_id": 10244,
- "attribute_name": "my_attribute",
- "locale": "zh_CN"
}
{- "success": true,
- "value": "english_attr_val"
}
Subscribe to command. Commands can be subscribed with the following filters:
measurement_code
You should only filter by one of the above each subscription request.
Choose the appropriate request body schema depending on your subscription requirements.
{ }
{- "success": true,
- "token": "123e4567-e89b-12d3-a456-426614174000"
}
{- "type": "command",
- "data": {
- "measurement_code": "example_command_v3",
- "command_data": {
- "message_id": "16026440932085_0",
- "priority": "4",
- "timeout": 10,
- "data": {
- "measurement_code": "my_command_v1",
- "device_id": "command_device_1",
- "on_off_status": false
}
}
}, - "tm_generated": 0
}
Unsubscribe from command
token required | string Subscription token of the subscription to unsubscribe. |
{- "token": "123e4567-e89b-12d3-a456-426614174000"
}
{- "success": true
}
Send a command request
request_id required | string |
measurement_code required | string |
priority required | integer |
ttl | integer |
timeout | integer |
data required | object |
{- "request_id": "request-id-1234",
- "measurement_code": "test_command_v1",
- "priority": 4,
- "ttl": 10,
- "timeout": 10,
- "data": {
- "device_id": "command_device_1",
- "on_off_status": false,
- "tm_source": 1603087311100
}
}
{- "success": true,
- "request_id": "request-id-1234",
- "warn_messages": [
- {
- "message": "invalid or not-writable metrics discarded",
- "discardedMetrics": {
- "tm_source": 1602644375208
}
}
], - "acknowledgement_data": {
- "command_success": true,
- "specific_data": "my_specific_data",
- "dt_sent": "2020-10-14T02:54:48.594Z"
}
}
Acknowledge a command
message_id | string |
measurement_code | string |
data | object |
{- "message_id": "message-id-1234",
- "measurement_code": "test_command_v1",
- "data": {
- "command_success": true,
- "specific_data": "my_specific_data"
}
}
{- "success": true
}
Subscribe to event. Events can be subscribed with the following filters:
event_def_id
site_id
asset_id
tag
event_source
You should only filter by one of the above each subscription request.
Choose the appropriate request body schema depending on your subscription requirements.
{ }
{- "success": true,
- "token": "123e4567-e89b-12d3-a456-426614174000"
}
{- "type": "event",
- "data": {
- "event_def_id": 12134,
- "event_data": {
- "event_id": "1-3552",
- "event_def_id": 191,
- "org_id": 1,
- "name": "On Chiller Trip",
- "name_localized": {
- "en_US": "On Chiller Trip"
}, - "description": "CH Trip/Fault event",
- "description_localized": {
- "en_US": "CH Trip/Fault event"
}, - "inputs": {
- "device_id": "CH-1"
}, - "tm_generated": 1631245147944,
- "related_asset": [
- 13436
], - "generated_by": "api-services",
- "generated_by_data": {
- "type": "measurement",
- "asset": [
- {
- "asset_id": 13436,
- "measurement": [
- {
- "measurement_code": "psa_ch_v1",
- "tag": {
- "device_id": "ch-2"
}, - "optional_tag": { },
- "metric": [
- {
- "metric_code": "refrigerant_alarm",
- "value": false,
- "generated_event": false
}, - {
- "metric_code": "inc_power_failure_alarm",
- "value": false,
- "generated_event": false
}, - {
- "metric_code": "chw_discharge_temperature",
- "value": 27.12934378288525,
- "generated_event": false
}, - {
- "metric_code": "chw_suction_temperature",
- "value": 9.168886358161457,
- "generated_event": false
}, - {
- "metric_code": "on_off_status",
- "value": true,
- "generated_event": false
}, - {
- "metric_code": "chw_discharge_pressure",
- "value": 552.6258287773038,
- "generated_event": false
}, - {
- "metric_code": "chw_suction_pressure",
- "value": 974.2186075352602,
- "generated_event": false
}, - {
- "metric_code": "switch_mode_auto_manual",
- "value": true,
- "generated_event": false
}, - {
- "metric_code": "chw_valve_open_close_status",
- "value": true,
- "generated_event": false
}, - {
- "metric_code": "trip_fault_alarm",
- "value": false,
- "generated_event": true
}
], - "tm_source": 1631245147812
}
]
}
]
}
}
}, - "tm_generated": 0
}
Unsubscribe from event
token required | string Subscription token of the subscription to unsubscribe. |
{- "token": "123e4567-e89b-12d3-a456-426614174000"
}
{- "success": true
}
Generate an event
event_def_id required | integer |
input_json required | object |
type required | string Value: "measurement" |
required | Array of objects |
required | Array of objects |
{- "event_def_id": 209,
- "input_json": {
- "<input_name>": "<input_value>"
}, - "type": "measurement",
- "metric_caused": [
- {
- "measurement_code": "va_cctv_v1",
- "metric_code": "motion_detected",
- "asset_id": 13440
}
], - "measurement_snapshot": [
- {
- "measurement_code": "va_cctv_v1",
- "cctv_id": "ms_cctv_1",
- "motion_detected": true,
- "tm_source": 1592794445155
}
]
}
{- "success": true,
- "warn_message": ""
}
Retrieve event definitions
{ }
{- "success": true,
- "event_defs": [
- {
- "event_def_id": 205,
- "name": "On Motion Detected",
- "name_localized": { },
- "type": "user_defined",
- "input": [
- "cctv_id"
]
}, - {
- "event_def_id": 209,
- "name": "On Blacklisted Face Detected",
- "name_localized": { },
- "type": "user_defined",
- "input": [
- "camera_code",
- "tm_occurred",
- "matched_person_name",
- "similarity"
]
}
]
}
Create an external event definition
name required | string |
description required | string |
required_tagfield required | Array of strings |
input required | Array of strings |
{- "name": "My event definition",
- "description": "Description of my event",
- "required_tagfield": [
- "source_id"
], - "input": [
- "my_input_1",
- "my_input_2"
]
}
{- "success": true,
- "event_def_id": 221
}
Update external event definition
eventDefId required | integer Event definition ID of the event definition to be updated |
name required | string |
description required | string |
required_tagfield required | Array of strings |
input required | Array of strings |
{- "name": "My event definition",
- "description": "Description of my event",
- "required_tagfield": [
- "source_id"
], - "input": [
- "my_input_1",
- "my_input_2"
]
}
{- "success": true
}
Delete external event definition
eventDefId required | integer Event definition ID of the event definition to be deleted |
senfi.eventdef.delete(123) .then(response => console.log('response', response)) .catch(error => console.error('error', error));
{- "success": true
}
Subscribe to log. Subscription are made for specific component(s) and minimum severity.
Subscription parameters. component
can be a single string or array depending on your subscription requirements.
component | Array of strings Items Enum: "b-gen2" "metric-proc-v2" "metric-saver" "mqtt-in" "mqtt-man" "cmd-proc" |
severity | string Enum: "error" "warn" "info" "debug" |
{- "component ": "b-gen2",
- "severity": "error"
}
{- "success": true,
- "token": "123e4567-e89b-12d3-a456-426614174000"
}
{- "type": "log",
- "data": {
- "component": "metric-proc-v2",
- "severity": "warn",
- "log_data": {
- "log_id": 6252444,
- "org_id": 1,
- "component": "mqtt-in",
- "instance": "mqtt-deployment-5d7594c8df-nfmp4",
- "severity": "warn",
- "message": "Possible Invalid Data",
- "detail": "{\"mqttTopic\":\"ingestor/2/0/live/text/array/9rt9wJJDGJ/kone_apiv3_v1\",\"mqttMessage\":\"{\"data\":[{\"tm_source\":1600929372796,...}",
- "tm_generated": 1592794445155
}
}, - "tm_generated": 0
}
Unsubscribe from log
token required | string Subscription token of the subscription to unsubscribe. |
{- "token": "123e4567-e89b-12d3-a456-426614174000"
}
{- "success": true
}
Retrieve measurement list
{ }
{- "success": true,
- "measurements": [
- {
- "name": "My Measurement",
- "measurement_code": "my_measurement_v1"
}, - {
- "name": "Lift Measurement",
- "measurement_code": "lift_measurement_v1"
}
]
}
Publish a measurement
measurement_code required | string |
required | Array of objects (MeasurementDataIn) |
type required | string Enum: "live" "backlog" |
{- "measurement_code": "my_measurement_v1",
- "data": [
- {
- "my_metric_code1": "<value>",
- "my_metric_code2": "<value>",
- "my_tag1": "<tag_value>",
- "my_tag2": "<tag_value>",
- "tm_source": 1592794445155
}
], - "type": "live"
}
{- "success": true
}
Retrieve detailed information about measurement
measurement_code required | Array of strings |
{- "measurement_code": "my_measurement_v1"
}
{- "success": true,
- "measurements": [
- {
- "name": "GENSET",
- "name_localized": {
- "en_US": "GENSET"
}, - "measurement_code": "dev_genset_v1",
- "required_tagfield": [
- "device_id",
- "device_type"
], - "optional_tagfield": [ ],
- "is_computed": false
}
]
}
Retrieve metrics of measurement
measurement_code required | Array of strings |
{- "measurement_code": "my_measurement_v1"
}
{- "success": true,
- "metrics": [
- {
- "measurement_code": "dev_genset_v1",
- "name": "On Off Status",
- "name_localized": {
- "en_US": "On Off Status"
}, - "metric_code": "onoffstatus",
- "unit": "",
- "unit_localized": { },
- "type": "integer",
- "is_readable": true,
- "is_writable": true
}, - {
- "measurement_code": "dev_genset_v1",
- "name": "Engine Oil Temperature",
- "name_localized": {
- "en_US": "Engine Oil Temperature"
}, - "metric_code": "engineoiltemperature",
- "unit": "°C",
- "unit_localized": {
- "en_US": "°C"
}, - "type": "float",
- "is_readable": true,
- "is_writable": false
}
]
}
Retrieve measurement data
measurement_code required | string Measurement code. |
metrics | Array of strings Filter to retrieve only the specified metrics of the measurement. |
limit | integer Number of measurement data to retrieve per asset. If |
tm_start | integer Start timestamp of measurement data to be retrieved in UNIX epoch, in miliseconds. |
tm_end | integer End timestamp of measurement data to be retrieved in UNIX epoch, in miliseconds. If this is omitted with |
format required | string Enum: "csv" "json" Format of the retrieved measurement data |
encoding | string Value: "gzip" Return data compressed as gzip. |
{- "measurement_code": "my_measurement_v1",
- "metrics": [
- "metric1",
- "metric2"
], - "limit": 1,
- "tm_start": 1630803600000,
- "tm_end": 1630905400000,
- "format": "csv",
- "encoding": "gzip"
}
[- {
- "on_off_status": true,
- "trip_fault_alarm": false,
- "device_id": "ch-2",
- "asset_id": 13436,
- "tm_source": "2021-09-06T23:26:56.834Z"
}
]
Subscribe to measurement. Measurements can be subscribed with the following filters:
measurement_code
You should only filter by one of the above each subscription request.
Choose the appropriate request body schema depending on your subscription requirements.
{ }
{- "success": true,
- "token": "123e4567-e89b-12d3-a456-426614174000"
}
{- "type": "measurement",
- "data": {
- "measurement_code": "tms_controller_v1",
- "measurement_data": [
- {
- "measurement_code": "t27_chiller_v1",
- "asset_id": 11323,
- "site_id": 10750,
- "device_id": "CH-1",
- "device_type": "CHILLER",
- "onoffstatus": 0,
- "trip": 0,
- "chwfr": 82,
- "chwrt": 22.5,
- "chwst": 13.9,
- "tm_source": 1603177043565
}
]
}, - "tm_generated": 0
}
Unsubscribe from measurement
token required | string Subscription token of the subscription to unsubscribe. |
{- "token": "123e4567-e89b-12d3-a456-426614174000"
}
{- "success": true
}
senfi.site.get() .then(response => console.log('response', response)) .catch(error => console.error('error', error));
{- "success": true,
- "sites": [
- {
- "site_id": 1000,
- "name": "ABC Research Institute"
}
]
}
Retrieve detailed information about site
site_id required | Array of integers |
{- "site_id": 1000
}
{- "success": true,
- "sites": [
- {
- "site_id": 1000,
- "name": "My Site Name",
- "name_localized": {
- "en_US": "ABC Research Institute",
- "zh_CN": "ABC研究中心"
}, - "description": "ABC Research Institute",
- "description_localized": {
- "en_US": "ABC Research Institute"
}, - "address": "10 Innovation Lane 1, Singapore 100001, Singapore",
- "address_localized": {
- "en_US": "10 Innovation Lane 1, Singapore 100001, Singapore"
}, - "country_code": "SG",
- "geolocation": [
- 103.703161,
- 1.454285
]
}
]
}
senfi.subscription.get() .then(response => console.log('response', response)) .catch(error => console.error('error', error));
{- "success": true,
- "subscriptions": [
- {
- "token": "f4560097-24e4-4915-8093-c8564aaca248",
- "type": "event",
- "data": {
- "requestData": {
- "site_id": [
- 10850
]
}
}
}
]
}
senfi.webhook.get() .then(response => console.log('response', response)) .catch(error => console.error('error', error));
{- "success": true,
}
Set webhook to receive subscribed data. Overrides existing webhook. Unset an existing webhook by setting null.
webhook required | string or null Fully qualified URL of the webhook to be set; Null to unset webhook. |
{
}
{- "success": true
}
Query if an asset is inside a zone
zone_id required | integer |
asset_id required | integer |
{- "zone_id": 6248,
- "asset_id": 10510
}
{- "success": true,
- "zone_result": true
}
Query if an asset is above a zone
zone_id required | integer |
asset_id required | integer |
{- "zone_id": 6248,
- "asset_id": 10510
}
{- "success": true,
- "zone_result": true
}
Query if an asset is below a zone
zone_id required | integer |
asset_id required | integer |
{- "zone_id": 6248,
- "asset_id": 10510
}
{- "success": true,
- "zone_result": true
}
Query if a point is inside a zone
zone_id required | integer |
pos_x required | number |
pos_y required | number |
pos_z required | number |
{- "zone_id": 6248,
- "pos_x": 10.24,
- "pos_y": 2,
- "pos_z": -124.2
}
{- "success": true,
- "zone_result": true
}
Query if a point is above a zone
zone_id required | integer |
pos_x required | number |
pos_y required | number |
pos_z required | number |
{- "zone_id": 6248,
- "pos_x": 10.24,
- "pos_y": 2,
- "pos_z": -124.2
}
{- "success": true,
- "zone_result": true
}
Query if a point is below a zone
zone_id required | integer |
pos_x required | number |
pos_y required | number |
pos_z required | number |
{- "zone_id": 6248,
- "pos_x": 10.24,
- "pos_y": 2,
- "pos_z": -124.2
}
{- "success": true,
- "zone_result": true
}
Get list of zones containing an asset
asset_id required | integer |
{- "asset_id": 10510
}
{- "success": true,
- "zone_result": [
- 1000,
- 1001,
- 1005
]
}
Get list of zones in a site containing a point
site_id required | integer |
pos_x required | number |
pos_y required | number |
pos_z required | number |
{- "site_id": 10854,
- "pos_x": 10.24,
- "pos_y": 2,
- "pos_z": -124.2
}
{- "success": true,
- "zone_result": [
- 1000,
- 1001,
- 1005
]
}
Format of alarm data sent by Senfi to webhook.
alarm_id | string |
alarm_def_id | integer |
org_id | integer |
name | string |
name_localized | object |
description | string |
description_localized | object |
priority | integer |
status | string |
defined_flags | Array of strings |
settable_by_operator_flags | Array of strings |
flagged_flags | Array of strings |
required_flags | Array of strings |
tm_raised | integer UNIX timestamp of the measurement, in miliseconds. |
raised_by_event_def_id | integer |
raised_by_event_id | string |
object (EventData) Event data. See Event Data |
{- "alarm_id": "28-24",
- "alarm_def_id": 1234,
- "org_id": 28,
- "name": "alarm",
- "name_localized": { },
- "description": "an alarm",
- "description_localized": { },
- "priority": 5,
- "status": "unacknowledged",
- "defined_flags": [
- "resolved"
], - "settable_by_operator_flags": [ ],
- "flagged_flags": [ ],
- "required_flags": [ ],
- "tm_raised": 1592794445155,
- "raised_by_event_def_id": 1234,
- "raised_by_event_id": "28-35",
- "raised_by_event": {
- "event_id": "28-35",
- "event_def_id": 1234,
- "etc": "..."
}
}
Format of command inform data sent by Senfi to webhook.
message_id | string |
priority | integer |
timeout | integer |
object (MeasurementDataOut) Measurement data. See Measurement Data (from Senfi) |
{- "message_id": "16026440932085_0",
- "priority": "4",
- "timeout": 10,
- "data": {
- "measurement_code": "my_command_v1",
- "device_id": "command_device_1",
- "on_off_status": false
}
}
Format of event data sent by Senfi to webhook.
event_id | string |
event_def_id | integer |
org_id | integer |
name | string |
name_localized | object |
description | string |
description_localized | object |
inputs | object |
input_mapping | object For generated_by expression-evaluator only |
tm_generated | integer UNIX timestamp of the measurement, in miliseconds. |
related_asset | Array of integers |
generated_by | string Enum: "expression-evaluator" "api-services" |
EventGeneratedByExpressionEvaluator (object) or EventGeneratedByApi (object) |
{- "event_id": "1-3552",
- "event_def_id": 191,
- "org_id": 1,
- "name": "On Chiller Trip",
- "name_localized": {
- "en_US": "On Chiller Trip"
}, - "description": "CH Trip/Fault event",
- "description_localized": {
- "en_US": "CH Trip/Fault event"
}, - "inputs": {
- "device_id": "CH-1"
}, - "tm_generated": 1631245147944,
- "related_asset": [
- 13436
], - "generated_by": "api-services",
- "generated_by_data": {
- "type": "measurement",
- "asset": [
- {
- "asset_id": 13436,
- "measurement": [
- {
- "measurement_code": "psa_ch_v1",
- "tag": {
- "device_id": "ch-2"
}, - "optional_tag": { },
- "metric": [
- {
- "metric_code": "refrigerant_alarm",
- "value": false,
- "generated_event": false
}, - {
- "metric_code": "inc_power_failure_alarm",
- "value": false,
- "generated_event": false
}, - {
- "metric_code": "chw_discharge_temperature",
- "value": 27.12934378288525,
- "generated_event": false
}, - {
- "metric_code": "chw_suction_temperature",
- "value": 9.168886358161457,
- "generated_event": false
}, - {
- "metric_code": "on_off_status",
- "value": true,
- "generated_event": false
}, - {
- "metric_code": "chw_discharge_pressure",
- "value": 552.6258287773038,
- "generated_event": false
}, - {
- "metric_code": "chw_suction_pressure",
- "value": 974.2186075352602,
- "generated_event": false
}, - {
- "metric_code": "switch_mode_auto_manual",
- "value": true,
- "generated_event": false
}, - {
- "metric_code": "chw_valve_open_close_status",
- "value": true,
- "generated_event": false
}, - {
- "metric_code": "trip_fault_alarm",
- "value": false,
- "generated_event": true
}
], - "tm_source": 1631245147812
}
]
}
]
}
}
Format of log data sent by Senfi to webhook.
log_id | integer ID of log entry. |
org_id | integer ID of the organization which the log entry is attributed to. This should be the ID of your organization. |
component | string Enum: "b-gen2" "metric-proc-v2" "metric-saver" "mqtt-in" "mqtt-man" "cmd-proc" Senfi component which generated the log entry. |
instance | string Instance of the component which generated the log entry. |
severity | string Enum: "error" "warn" "info" "debug" Severity of log entry. |
message | string Log message. |
detail | object Detailed log information. |
tm_generated | integer UNIX timestamp of the log, in miliseconds. |
{- "log_id": 6252444,
- "org_id": 1,
- "component": "mqtt-in",
- "instance": "mqtt-deployment-5d7594c8df-nfmp4",
- "severity": "warn",
- "message": "Possible Invalid Data",
- "detail": "{\"mqttTopic\":\"ingestor/2/0/live/text/array/9rt9wJJDGJ/kone_apiv3_v1\",\"mqttMessage\":\"{\"data\":[{\"tm_source\":1600929372796,...}",
- "tm_generated": 1592794445155
}
Format of measurement data published to Senfi, or sent by Senfi to webhook.
In the example below, device_id
and device_type
are tags; onoffstatus
, trip
, chwfr
, chwrt
and chwst
are metrics.
<tag> required | string One or more user-defined tags identifying the measurement in combination with the measurement's measurement code. |
<metric> required | any One or more metrics in the meaurement. |
tm_source required | integer UNIX timestamp of the measurement, in miliseconds. |
{- "device_id": "CH-1",
- "device_type": "CHILLER",
- "onoffstatus": 0,
- "trip": 0,
- "chwfr": 82,
- "chwrt": 22.5,
- "chwst": 13.9,
- "tm_source": 1603177043565
}
Format of measurement data sent by Senfi to webhook.
In the example below, device_id
and device_type
are tags; onoffstatus
, trip
, chwfr
, chwrt
and chwst
are metrics.
measurement_code required | string Measurement code of the measurement. The property is populated by Senfi for convenience. |
asset_id required | integer ID of asset which the measurement belongs to, if any. This property is generated by Senfi. |
site_id required | integer ID of site which the measurement belongs to, if any. This property is generated by Senfi. |
<tag> required | string One or more user-defined tags identifying the measurement in combination with the measurement's measurement code. |
<metric> required | any One or more metrics in the meaurement. |
tm_source required | integer UNIX timestamp of the measurement, in miliseconds. |
{- "measurement_code": "t27_chiller_v1",
- "asset_id": 11323,
- "site_id": 10750,
- "device_id": "CH-1",
- "device_type": "CHILLER",
- "onoffstatus": 0,
- "trip": 0,
- "chwfr": 82,
- "chwrt": 22.5,
- "chwst": 13.9,
- "tm_source": 1603177043565
}