Senfi API (1.1.0)

Download OpenAPI specification:Download

Overview

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.

Authentication

Senfi API uses OAuth2 to authenticate requests. Authenticating via OAuth2 requires the following steps:

  1. Create an API Key
  2. Generate a token
  3. Make authenticated requests to the Senfi API

Create an API Key

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.

Generate a token

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 Key
  • client_secret - The Secret of your API Key
  • grant_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"
}

Make authenticated requests to the Senfi API

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"
}

Request and Responses

Base URI

All URLs referenced in the documentation have the following base:

https://api.senfi.io/webservice/1/1

HTTP Request Body

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.

Error Handling

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"
}

Webhooks

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.

Setting up a webhook

You will need a server that:

  • Supports IPV4
  • Accept incoming POSTs on port 80 or 443
  • Provides a supported, non-wildcard, verified certificate.
  • Uses a CN or SAN that matches the domain you’ve supplied on setup
  • Supplies all intermediate certificates to complete a verification chain

Registering your webhook with Senfi

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.

Subscribing to data updates

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.

SDKs

An official SDK library for Senfi API is available for Node.js. However, no SDK is required to use the API.

Node.js SDK

Installation and usage instructions can be found in the senf-node Github repository . SDK code examples are included in these docs.

Token

Obtain Bearer token by OAuth2 authentication

Obtain an OAuth2 access token

Obtain an OAuth2 access token to be used as a Bearer authentication token for subsequent API calls.

Request Body schema: application/x-www-form-urlencoded
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_credentials

Responses

Request samples

Content type
application/x-www-form-urlencoded
client_id=my_api_key&client_secret=my_api_secret&grant_type=client_credentials

Response samples

Content type
application/json
{
  • "access_token": "eea7f833-3117-4615-b5c5-04917bfa7e50",
  • "expires_in": 3599,
  • ".expire": "2020-10-20T07:18:34.009Z"
}

Get token information of an OAuth2 access token

Get token information of OAuth2 access token

query Parameters
access_token
required
string
Example: access_token=my_api_key

Access token to get the information of

Responses

Request samples

// Not available yet

Response samples

Content type
application/json
{
  • "client_id": "my_api_key",
  • "access_token": "eea7f833-3117-4615-b5c5-04917bfa7e50",
  • "expires_in": 3599,
  • ".expire": "2020-10-20T07:18:34.009Z"
}

Action

Send an email

Send an email

Request Body schema: application/json
to
required
Array of strings
title
required
string
content
required
string

Responses

Request samples

Content type
application/json
{
  • "to": [
    ],
  • "title": "My notification title",
  • "content": "Content of email notification"
}

Response samples

Content type
application/json
{
  • "success": true
}

Send an sms

Send an sms

Request Body schema: application/json
to
required
Array of strings
content
required
string

Responses

Request samples

Content type
application/json
{
  • "to": [
    ],
  • "content": "Content of email notification"
}

Response samples

Content type
application/json
{
  • "success": true
}

Send a telegram notification

Send a telegram notification

Request Body schema: application/json
to
required
Array of strings
content
required
string

Responses

Request samples

Content type
application/json
{
  • "to": [
    ],
  • "content": "Content of email notification"
}

Response samples

Content type
application/json
{
  • "success": true
}

Send notification to a webhook

Send notification to a webhook

Request Body schema: application/json
to
required
Array of strings
content
required
string
webhook_method
string
Enum: "post" "get" "put"
webhook_header
object

Responses

Request samples

Content type
application/json
{
  • "to": [
    ],
  • "content": "Content of email notification",
  • "webhook_method": "post",
  • "webhook_header": {
    }
}

Response samples

Content type
application/json
{
  • "success": true
}

Alarm

Subscribe to alarm

Subscribe to alarm. Alarms can be subscribed with the following filters:

  • Organization wide: Send request body with an empty object
  • Specific event(s) that raised an alarm: Send request body with event_def_id
  • Specific site(s): Send request body with site_id
  • Specific related asset(s) by asset id: Send request body with asset_id

You should only filter by one of the above each subscription request.

Request Body schema: application/json

Choose the appropriate request body schema depending on your subscription requirements.

One of
object (SubscribeByOrganizationRequest)

Responses

Callbacks

Request samples

Content type
application/json
Example
{ }

Response samples

Content type
application/json
{
  • "success": true,
  • "token": "123e4567-e89b-12d3-a456-426614174000"
}

Callback payload samples

Callback
POST: Notification to webhook when subscribed alarm data is received by Senfi
Content type
application/json
{
  • "type": "alarm",
  • "data": {
    },
  • "tm_generated": 0
}

Unsubscribe from alarm

Unsubscribe from alarm

Request Body schema: application/json
token
required
string

Subscription token of the subscription to unsubscribe.

Responses

Request samples

Content type
application/json
{
  • "token": "123e4567-e89b-12d3-a456-426614174000"
}

Response samples

Content type
application/json
{
  • "success": true
}

Asset

Retrieve asset list

Retrieve asset list

Request Body schema: application/json
One of
object (AssetIdentityByOrganization)

Responses

Request samples

Content type
application/json
Example
{ }

Response samples

Content type
application/json
{
  • "success": true,
  • "assets": [
    ]
}

Retrieve detailed information about asset

Retrieve detailed information about asset

Request Body schema: application/json
One of
asset_id
required
Array of integers

Responses

Request samples

Content type
application/json
{
  • "asset_id": 10244
}

Response samples

Content type
application/json
{
  • "success": true,
  • "assets": [
    ]
}

Retrieve asset attribute information

Retrieve asset attribute information

Request Body schema: application/json
asset_id
required
integer
attribute_name
required
string
locale
string

Responses

Request samples

Content type
application/json
{
  • "asset_id": 10244,
  • "attribute_name": "my_attribute",
  • "locale": "zh_CN"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "value": "english_attr_val"
}

Command

Subscribe to command

Subscribe to command. Commands can be subscribed with the following filters:

  • Organization wide: Send request body with an empty object
  • Specific measurement code(s): Send request body with measurement_code

You should only filter by one of the above each subscription request.

Request Body schema: application/json

Choose the appropriate request body schema depending on your subscription requirements.

One of
object (SubscribeByOrganizationRequest)

Responses

Callbacks

Request samples

Content type
application/json
Example
{ }

Response samples

Content type
application/json
{
  • "success": true,
  • "token": "123e4567-e89b-12d3-a456-426614174000"
}

Callback payload samples

Callback
POST: Notification to webhook when subscribed command data is received by Senfi
Content type
application/json
{
  • "type": "command",
  • "data": {
    },
  • "tm_generated": 0
}

Unsubscribe from command

Unsubscribe from command

Request Body schema: application/json
token
required
string

Subscription token of the subscription to unsubscribe.

Responses

Request samples

Content type
application/json
{
  • "token": "123e4567-e89b-12d3-a456-426614174000"
}

Response samples

Content type
application/json
{
  • "success": true
}

Send a command request

Send a command request

Request Body schema: application/json
request_id
required
string
measurement_code
required
string
priority
required
integer
ttl
integer
timeout
integer
data
required
object

Responses

Request samples

Content type
application/json
{
  • "request_id": "request-id-1234",
  • "measurement_code": "test_command_v1",
  • "priority": 4,
  • "ttl": 10,
  • "timeout": 10,
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "request_id": "request-id-1234",
  • "warn_messages": [
    ],
  • "acknowledgement_data": {
    }
}

Acknowledge a command

Acknowledge a command

Request Body schema: application/json
message_id
string
measurement_code
string
data
object

Responses

Request samples

Content type
application/json
{
  • "message_id": "message-id-1234",
  • "measurement_code": "test_command_v1",
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "success": true
}

Event

Subscribe to event

Subscribe to event. Events can be subscribed with the following filters:

  • Organization wide: Send request body with an empty object
  • Specific event(s): Send request body with event_def_id
  • Specific site(s): Send request body with site_id
  • Specific related asset(s) by asset id: Send request body with asset_id
  • Specific related asset(s) by asset measurement code and tag(s): Send request body with tag
  • Specific event source(s): Send request body with event_source

You should only filter by one of the above each subscription request.

Request Body schema: application/json

Choose the appropriate request body schema depending on your subscription requirements.

One of
object (SubscribeByOrganizationRequest)

Responses

Callbacks

Request samples

Content type
application/json
Example
{ }

Response samples

Content type
application/json
{
  • "success": true,
  • "token": "123e4567-e89b-12d3-a456-426614174000"
}

Callback payload samples

Callback
POST: Notification to webhook when subscribed event data is received by Senfi
Content type
application/json
{
  • "type": "event",
  • "data": {
    },
  • "tm_generated": 0
}

Unsubscribe from event

Unsubscribe from event

Request Body schema: application/json
token
required
string

Subscription token of the subscription to unsubscribe.

Responses

Request samples

Content type
application/json
{
  • "token": "123e4567-e89b-12d3-a456-426614174000"
}

Response samples

Content type
application/json
{
  • "success": true
}

Generate an event

Generate an event

Request Body schema: application/json
One of
event_def_id
required
integer
input_json
required
object
type
required
string
Value: "measurement"
required
Array of objects
required
Array of objects

Responses

Request samples

Content type
application/json
Example
{
  • "event_def_id": 209,
  • "input_json": {
    },
  • "type": "measurement",
  • "metric_caused": [
    ],
  • "measurement_snapshot": [
    ]
}

Response samples

Content type
application/json
{
  • "success": true,
  • "warn_message": ""
}

Event Definition

Retrieve event definitions

Retrieve event definitions

Request Body schema: application/json
One of
object (EventDefIdentityByOrganization)

Responses

Request samples

Content type
application/json
Example
{ }

Response samples

Content type
application/json
{
  • "success": true,
  • "event_defs": [
    ]
}

Create an external event definition

Create an external event definition

Request Body schema: application/json
name
required
string
description
required
string
required_tagfield
required
Array of strings
input
required
Array of strings

Responses

Request samples

Content type
application/json
{
  • "name": "My event definition",
  • "description": "Description of my event",
  • "required_tagfield": [
    ],
  • "input": [
    ]
}

Response samples

Content type
application/json
{
  • "success": true,
  • "event_def_id": 221
}

Update an external event definition

Update external event definition

path Parameters
eventDefId
required
integer

Event definition ID of the event definition to be updated

Request Body schema: application/json
name
required
string
description
required
string
required_tagfield
required
Array of strings
input
required
Array of strings

Responses

Request samples

Content type
application/json
{
  • "name": "My event definition",
  • "description": "Description of my event",
  • "required_tagfield": [
    ],
  • "input": [
    ]
}

Response samples

Content type
application/json
{
  • "success": true
}

Delete an external event definition

Delete external event definition

path Parameters
eventDefId
required
integer

Event definition ID of the event definition to be deleted

Responses

Request samples

senfi.eventdef.delete(123)
 .then(response => console.log('response', response))
 .catch(error => console.error('error', error));

Response samples

Content type
application/json
{
  • "success": true
}

Log

Subscribe to log

Subscribe to log. Subscription are made for specific component(s) and minimum severity.

Request Body schema: application/json

Subscription parameters. component can be a single string or array depending on your subscription requirements.

One of
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"

Responses

Callbacks

Request samples

Content type
application/json
{
  • "component ": "b-gen2",
  • "severity": "error"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "token": "123e4567-e89b-12d3-a456-426614174000"
}

Callback payload samples

Callback
POST: Notification to webhook when subscribed log data is received by Senfi
Content type
application/json
{
  • "type": "log",
  • "data": {
    },
  • "tm_generated": 0
}

Unsubscribe from log

Unsubscribe from log

Request Body schema: application/json
token
required
string

Subscription token of the subscription to unsubscribe.

Responses

Request samples

Content type
application/json
{
  • "token": "123e4567-e89b-12d3-a456-426614174000"
}

Response samples

Content type
application/json
{
  • "success": true
}

Measurement

Retrieve measurement list

Retrieve measurement list

Request Body schema: application/json
One of
object (MeassurementIdentityByOrganization)

Responses

Request samples

Content type
application/json
Example
{ }

Response samples

Content type
application/json
{
  • "success": true,
  • "measurements": [
    ]
}

Publish a measurement

Publish a measurement

Request Body schema: application/json
measurement_code
required
string
required
Array of objects (MeasurementDataIn)
type
required
string
Enum: "live" "backlog"

Responses

Request samples

Content type
application/json
{
  • "measurement_code": "my_measurement_v1",
  • "data": [
    ],
  • "type": "live"
}

Response samples

Content type
application/json
{
  • "success": true
}

Retrieve detailed information about measurement

Retrieve detailed information about measurement

Request Body schema: application/json
One of
measurement_code
required
Array of strings

Responses

Request samples

Content type
application/json
{
  • "measurement_code": "my_measurement_v1"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "measurements": [
    ]
}

Retrieve metrics of measurement

Retrieve metrics of measurement

Request Body schema: application/json
One of
measurement_code
required
Array of strings

Responses

Request samples

Content type
application/json
{
  • "measurement_code": "my_measurement_v1"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "metrics": [
    ]
}

Retrieve measurement data

Retrieve measurement data

Request Body schema: application/json
One of
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 is used, this is ignored.

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 tm_start specified, present time will be used.

format
required
string
Enum: "csv" "json"

Format of the retrieved measurement data

encoding
string
Value: "gzip"

Return data compressed as gzip.

Responses

Request samples

Content type
application/json
Example
{
  • "measurement_code": "my_measurement_v1",
  • "metrics": [
    ],
  • "limit": 1,
  • "tm_start": 1630803600000,
  • "tm_end": 1630905400000,
  • "format": "csv",
  • "encoding": "gzip"
}

Response samples

Content type
[
  • {
    }
]

Subscribe to measurement

Subscribe to measurement. Measurements can be subscribed with the following filters:

  • Organization wide: Send request body with an empty object
  • Specific measurement code(s): Send request body with measurement_code

You should only filter by one of the above each subscription request.

Request Body schema: application/json

Choose the appropriate request body schema depending on your subscription requirements.

One of
object (SubscribeByOrganizationRequest)

Responses

Callbacks

Request samples

Content type
application/json
Example
{ }

Response samples

Content type
application/json
{
  • "success": true,
  • "token": "123e4567-e89b-12d3-a456-426614174000"
}

Callback payload samples

Callback
POST: Notification to webhook when subscribed measurement data is received by Senfi
Content type
application/json
{
  • "type": "measurement",
  • "data": {
    },
  • "tm_generated": 0
}

Unsubscribe from measurement

Unsubscribe from measurement

Request Body schema: application/json
token
required
string

Subscription token of the subscription to unsubscribe.

Responses

Request samples

Content type
application/json
{
  • "token": "123e4567-e89b-12d3-a456-426614174000"
}

Response samples

Content type
application/json
{
  • "success": true
}

Site

Retrieve site list

Retrieve site list

Responses

Request samples

senfi.site.get()
 .then(response => console.log('response', response))
 .catch(error => console.error('error', error));

Response samples

Content type
application/json
{
  • "success": true,
  • "sites": [
    ]
}

Retrieve detailed information about site

Retrieve detailed information about site

Request Body schema: application/json
One of
site_id
required
Array of integers

Responses

Request samples

Content type
application/json
{
  • "site_id": 1000
}

Response samples

Content type
application/json
{
  • "success": true,
  • "sites": [
    ]
}

Subscription

Get subscriptions

Get the list of subscriptions subscribed to

Responses

Request samples

senfi.subscription.get()
 .then(response => console.log('response', response))
 .catch(error => console.error('error', error));

Response samples

Content type
application/json
{
  • "success": true,
  • "subscriptions": [
    ]
}

Webhook

Webhooks are used by Senfi to send subscribed measurement, event, alarm command or log data

Get webhook

Gets existing webhook, if one has been set previously.

Responses

Request samples

senfi.webhook.get()
 .then(response => console.log('response', response))
 .catch(error => console.error('error', error));

Response samples

Content type
application/json
{}

Set or remove webhook

Set webhook to receive subscribed data. Overrides existing webhook. Unset an existing webhook by setting null.

Request Body schema: application/json
webhook
required
string or null

Fully qualified URL of the webhook to be set; Null to unset webhook.

Responses

Request samples

Content type
application/json

Response samples

Content type
application/json
{
  • "success": true
}

Zone

Query if an asset is inside a zone

Query if an asset is inside a zone

Request Body schema: application/json
zone_id
required
integer
asset_id
required
integer

Responses

Request samples

Content type
application/json
{
  • "zone_id": 6248,
  • "asset_id": 10510
}

Response samples

Content type
application/json
{
  • "success": true,
  • "zone_result": true
}

Query if an asset is above a zone

Query if an asset is above a zone

Request Body schema: application/json
zone_id
required
integer
asset_id
required
integer

Responses

Request samples

Content type
application/json
{
  • "zone_id": 6248,
  • "asset_id": 10510
}

Response samples

Content type
application/json
{
  • "success": true,
  • "zone_result": true
}

Query if an asset is below a zone

Query if an asset is below a zone

Request Body schema: application/json
zone_id
required
integer
asset_id
required
integer

Responses

Request samples

Content type
application/json
{
  • "zone_id": 6248,
  • "asset_id": 10510
}

Response samples

Content type
application/json
{
  • "success": true,
  • "zone_result": true
}

Query if a point is inside a zone

Query if a point is inside a zone

Request Body schema: application/json
zone_id
required
integer
pos_x
required
number
pos_y
required
number
pos_z
required
number

Responses

Request samples

Content type
application/json
{
  • "zone_id": 6248,
  • "pos_x": 10.24,
  • "pos_y": 2,
  • "pos_z": -124.2
}

Response samples

Content type
application/json
{
  • "success": true,
  • "zone_result": true
}

Query if a point is above a zone

Query if a point is above a zone

Request Body schema: application/json
zone_id
required
integer
pos_x
required
number
pos_y
required
number
pos_z
required
number

Responses

Request samples

Content type
application/json
{
  • "zone_id": 6248,
  • "pos_x": 10.24,
  • "pos_y": 2,
  • "pos_z": -124.2
}

Response samples

Content type
application/json
{
  • "success": true,
  • "zone_result": true
}

Query if a point is below a zone

Query if a point is below a zone

Request Body schema: application/json
zone_id
required
integer
pos_x
required
number
pos_y
required
number
pos_z
required
number

Responses

Request samples

Content type
application/json
{
  • "zone_id": 6248,
  • "pos_x": 10.24,
  • "pos_y": 2,
  • "pos_z": -124.2
}

Response samples

Content type
application/json
{
  • "success": true,
  • "zone_result": true
}

Get list of zones containing an asset

Get list of zones containing an asset

Request Body schema: application/json
asset_id
required
integer

Responses

Request samples

Content type
application/json
{
  • "asset_id": 10510
}

Response samples

Content type
application/json
{
  • "success": true,
  • "zone_result": [
    ]
}

Get list of zones in a site containing a point

Get list of zones in a site containing a point

Request Body schema: application/json
site_id
required
integer
pos_x
required
number
pos_y
required
number
pos_z
required
number

Responses

Request samples

Content type
application/json
{
  • "site_id": 10854,
  • "pos_x": 10.24,
  • "pos_y": 2,
  • "pos_z": -124.2
}

Response samples

Content type
application/json
{
  • "success": true,
  • "zone_result": [
    ]
}

Alarm Data

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": [
    ],
  • "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": {
    }
}

Command Data

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": {
    }
}

Event Data

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": {
    },
  • "description": "CH Trip/Fault event",
  • "description_localized": {
    },
  • "inputs": {
    },
  • "tm_generated": 1631245147944,
  • "related_asset": [
    ],
  • "generated_by": "api-services",
  • "generated_by_data": {
    }
}

Log Data

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
}

Measurement Data (to Senfi)

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
}

Measurement Data (from Senfi)

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
}