How to explore your data in ZENSIE


At the explore view, you can visualize your data by creating graphs and selecting different time periods and intervals.

Visualizing sensor data

To visualize your data in a graph, select one or more sensor checks from the drop down menu:

If you want to add more sensor data to the graph, click at the “+ ADD SENSOR” button:

 

Selecting time periods and intervals for your graphs

By default the graph shows data from the last 24 hours with an interval of every 5 minutes. You can:

  1. Change the time period. 
  2. Change the time intervals.
  3. Select to see averages, or min/max values

 

 

How to export data from ZENSIE


At the export page, you can export the raw data of your organization.

Select the month, the year, and the location from which you wish to export the data and click START EXPORT.

Once your data are ready to be downloaded, you will receive an email.

 

How to get your data using the ZENSIE API


30MHz provides a REST API to access the data collected by ZENSIE via web checks and sensors.

To use it, you will need to create an API key. You can do this by going to the sidebar, click on Account Settings, and select the tab Developer.

If this is the first time you are requesting an API key, click on the “Request a new API key” button. You will be asked to log in again with your credentials and then a key will be shown in the page, which you can copy and use it to connect to the API.

API Documentation

The API documentation can be found at https://api.30mhz.com/api/swagger. There are two(2) ways to try the API; using postman, or through the command line.

Example using postman

In this example, we will show you how to use postman to get all the checks of your organization.

Go to swagger documentation and find the description of the endpoint that returns all checks of a given organization https://api.30mhz.com/api/swagger#!/check/getOrganizationChecks.

Note the URL you need to make the call, and the required fields. In this example the required field is the organization id.

To find your organization id, go to ZENSIE dashboard, Account Settings, at the Organization tab

Alternatively, you can find your organization id from the url at the ZENSIE page: 

Download a free version of postman here. Open the application and fill in the required fields:

GET https://api.30mhz.com/api/check/organization/{{organization id}}

Headers
Authorization: {{your API key}}
Content-Type: application/json

The reply is a JSON object and it should look like this:

Example using the command line

Here we will show you how to get all checks from your organization using the command line:

  1. Open a command line interface (eg. Terminal for Mac, Command Prompt for Windows).
  2. The CURL command that you need for getting all checks of the organization is:
curl -XGET -H 'Content-Type: application/json' -H 'Authorization: your API key' https://api.30mhz.com/api/check/organization/example_id

If you want to save the output of the command in a file you can add at the end of the command >>output.txt like this:

curl -XGET -H 'Content-Type: application/json' -H 'Authorization: your API key' https://api.30mhz.com/api/check/organization/example_id >>output.txt

The data stored in the output.txt file are in a json format. If you are not familiar with it and you want to see the data in a table format, you can use an online JSON to CSV converter (for example here).

Just copy the data from the output.txt file and paste them into the indicated field at the converter page. The result should look like this:

Ingest api: adding external sensor data to ZENSIE


Creating import checks
The first step is creating import checks. An import check contains all the data of a sensor and creates an endpoint to which values can be sent. Import checks can be created by navigating to the checks view. At the bottom right, the plus button can be clicked to add a new sensor. We then can click on the external sensor option

We fill in the name, select the sensor type and click create.

Sensor types
Sensor types contain the definition of how data is formatted and should be displayed. A sensor type contains information such as the metric + unit (e.g. Temperature = ºC), data types and expected json values. Feel free to contact us if a new sensor type should be added.

Sending data to an import check
The last step is sending data to the api. After saving the check, we see the settings page. Here the endpoint is shown with an example call.

We can do a post to

https://api.30mhz.com/api/ingest/organization/www.30mhz.com

 

With these values (values change based on import check and sensor type):

[ 
  { 
  "checkId": "import_check_id", 
  "timestamp": "long (seconds-since-the-epoch)", 
  "data": 
    {
      "temp": "double", 
      "hum": "double" 
    }, 
  "status": "ok || fail", 
  "error": "custom error text message" 
  } 
]

 

Notice that we are sending the values inside an array. We can send multiple sensor values (multiple import checks) in one call:

[{import_check_1...},{import_check_2...},{etc...}]

 

API Keys
Make sure you add your api keys to the Authorization header: find out how to generate and use api keys.