How to use historical data access API on QNAP QIoT Suite Lite

sqfk-r2-icon

How to use historical data access API on QNAP QIoT Suite Lite

 

In this tutorial, you will learn how to use historical data access API on QNAP QIoT Suite Lite. Using the historical data access API, the limitation is that you have to create a thing on QIoT and confirm the data input type is numeric (int, float), and then it can output in count, sum, vmin, vmax, and vavg type normally.

 

And if your data received is from Node-RED (e.g., TCP, UDP, HTTP, and MQTT node), and you have to change it to thing from QIoT that can be used. As below picture.
0

 

There are two ways to receive the historical data:
a. Using the Node-RED QHistoricData node
b. Using a RESTful API


a. Using NodeRed QHistoricData node

The input node means “trigger” and the output node means “acquire history data”. The node can help users to acquire historical data from the QIoT Suite Lite database. Users can sconfigure options such as “Resolution”, “Interval”, “Range”, and more. According chosen, the API will return the historical data from “IoT Thing” and “Resources”.

1

 

  • Name: Self-defined node name
  • Thing: The thing to choose
  • Resources: Historical data of the chosen Resource
  • Resolution: Select minute, day or hour
  • Interval: The data interval. This depends on the Resolution and Range
  • Range: The range of the output data. This depends on the Resolution
  • API Key: You must establish an API Key to use. To configure the API Key, go to  “Settings” > “API Keys”

 

3

 

For example (the return format will be “JSON” ):

 

b. Using RESTful API

Go to the QIoT Suite Lite page, click the upper right corner  and select “API Documentation” to acquire more information.
4

 

5

Related posts

2 thoughts on “How to use historical data access API on QNAP QIoT Suite Lite

  1. Aleksey

    Hello.

    How I cant insert the history charts on QDASHBOARD? How I cant request to history data for showing statistics for different ranges?

    1. Jeffrey Chang

      You need to parse the result in JSON format of QHistoricData node to get maximum, minimum, or average values, then send to QDashboard node.
      If range options in QHistoricData node don’t meet your requirement, you can use RESTful APIs to assign startdatetime and enddatetime.

Leave a Reply