Domorela's Blog: Domorela's REST API: Histories Service

Domorela's Histories service API allows to request historical data from a Domorela unit. Using Domorel's WUI is possible to view the last month (4 weeks) of collected data from a History and Domorela stores the last 2 months (8 weeks) to be queried through API. By quering through the API is possible to obtain data to examine it in another graphical interface and also to export queried data to an external database. For instance, data can be stored in an external centralised database intended for Big Data.

Due to security reasons, this API service only allows to send History queries to a Domorela unit. There are two types of queries:

  1. raw query: allows to obtain all records stored in the history, with their corresponding timestamps, for a determined period of time defined in the query filter
  2. rollup query: allows to obtain calculated records for determined time intervals with statistical data: minimum, average and maximum values, the query also defines a filter with the period of time being queried

 

Both types of queries return records as XML data lists that can be exploited by external tools capable of parse them. This isn't so much difficult so there are many XML parsers available, even relational databases can import XML data into tables and XML schema as a new table.

The information shown in each record of a raw query includes:

  1. timestamp of the record in absolute time value
  2. recorded value in raw number format, it could be an Integer or a Real in decimal format
  3. complete name of the parameter stored by History, for example a temperature value or an electric consumption

 

On the other hand, each rollup record includes next info: 

  1. start of the time interval of records rolled up as timestamp in absolute time value
  2. end of the time interval of records rolled up as timestamp in absolute time value
  3. number of values computed in this time interval
  4. minimum value in this time interval
  5. maximum value in this time interval
  6. average value for the time interval

 

Next article will speak about Alarm service of Domorela's API.

 

Blog Articles