Difference between revisions of "Sending data to Senfi"

From Senfi Docs
Jump to: navigation, search
Line 5: Line 5:
 
# Write a program to read from your system and send it to Senfi's MQTT endpoint
 
# Write a program to read from your system and send it to Senfi's MQTT endpoint
  
== Create integration key ==
+
=== Create integration key ===
  
== Design/create measurement ==
+
# Login to the [https://ems.senfi.io/cms CMS]
 +
# Go to the Integration tab
 +
# Click the '''+''' button to add a new integration key/secret pair
 +
# Note down the values of the '''Key''' (your integration key) and '''Secret''' (your integration secret)
  
== Publish to MQTT ==
+
=== Design/create measurement ===
  
=== MQTT Endpoint ===
+
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 [[Concepts#Measurement.2C_Metric.2C_Tag|this section]] first.
 +
 
 +
# When you are designing a measurement to represent your system, note down the metrics you want to capture.
 +
# 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.
 +
# Login to the [https://ems.senfi.io/cms CMS]
 +
# Go to the Measurement tab
 +
# Click the '''+''' button to add a new measurement
 +
# Give the measurement a descriptive name. This will be shown to users of the dashboard.
 +
# 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: <tt><vendor>_<system>_<version></tt>
 +
#* For example: <tt>nest_thermostat_v1</tt>. If you make changes to the measurement (eg. adding or removing metrics), you should increment the version, eg. <tt>nest_thermostat_v2</tt>.
 +
# Add tags
 +
# Add metrics and specify the type of each metric
 +
# Save when done
 +
 
 +
=== Publish to MQTT ===
 +
 
 +
==== MQTT Endpoint ====
 
; Host: mqtt.senfi.io
 
; Host: mqtt.senfi.io
 
; Port: 1883
 
; Port: 1883
Line 17: Line 37:
 
; Password: ''<Your integration secret>''
 
; Password: ''<Your integration secret>''
 
; MQTT topic: ingestor/1/0/live/text/array/ems/''<your integration key>/<your measurement code>''
 
; MQTT topic: ingestor/1/0/live/text/array/ems/''<your integration key>/<your measurement code>''
 +
 +
You can take a look at [https://github.com/gelement-com/mqtt-ingestor-sample this GitHub repository] for a sample application to send data to Senfi's MQTT endpoint.
 +
 +
Publishing strategy: regular, upon change,

Revision as of 16:24, 11 September 2019

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,