Sending data to Senfi

From Senfi Docs
Revision as of 16:24, 11 September 2019 by Admin (talk | contribs)
Jump to: navigation, search

Senfi monitors and stores time series data from your existing systems. At the moment, Senfi provides a MQTT interface for receiving data from your systems. To start sending data to Senfi, you need to do the following:

  1. Create an integration key in the CMS
  2. Design and create a measurement in the CMS
  3. Write a program to read from your system and send it to Senfi's MQTT endpoint

Create integration key

  1. Login to the CMS
  2. Go to the Integration tab
  3. Click the + button to add a new integration key/secret pair
  4. Note down the values of the Key (your integration key) and Secret (your integration secret)

Design/create measurement

The key to a successful integration is to have a well-designed measurement. So if you are not familiar with the concept of measurement/metric/tag, please read this section first.

  1. When you are designing a measurement to represent your system, note down the metrics you want to capture.
  2. Decide on a set of tags to use. Make sure that there is a combination of tags that will uniquely identify the unit/device/equipment that outputs those metrics.
  3. Login to the CMS
  4. Go to the Measurement tab
  5. Click the + button to add a new measurement
  6. Give the measurement a descriptive name. This will be shown to users of the dashboard.
  7. Specify a measurement code. A measurement code is a unique identifier of this measurement. You can use a combination of lowercase alphanumeric characters and underscore.
    • The naming convention of a measurement code is as follows: <vendor>_<system>_<version>
    • For example: nest_thermostat_v1. If you make changes to the measurement (eg. adding or removing metrics), you should increment the version, eg. nest_thermostat_v2.
  8. Add tags
  9. Add metrics and specify the type of each metric
  10. Save when done

Publish to MQTT

MQTT Endpoint

Host
mqtt.senfi.io
Port
1883
Username
<Your integration key>
Password
<Your integration secret>
MQTT topic
ingestor/1/0/live/text/array/ems/<your integration key>/<your measurement code>

You can take a look at this GitHub repository for a sample application to send data to Senfi's MQTT endpoint.

Publishing strategy: regular, upon change,