close

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" ):


{

          "result": [

                    {

                              "totalCount": 1,

                              "data": [

                                        {

                                                  "count": 6347,

                                                  "vmin": 1,

                                                  "sum": 316959,

                                                  "vmax": 100,

                                                  "_id": "2018-01-18T08:43:56",

                                                  "vavg": 49.93839609264219

                                        }

                              ]

                    }

          ]

}

 

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
arrow
arrow
    全站熱搜

    tttt 發表在 痞客邦 留言(2) 人氣()