DDorch / Rthingsboard

R package for interacting with the API of ThingsBoard open-source IoT platform.
GNU Affero General Public License v3.0
3 stars 0 forks source link

`getValues` only get the 100 last telemetry of each key #1

Closed DDorch closed 3 years ago

DDorch commented 3 years ago

See in the README, only last 8 minutes of data are available.

We got 100 telemetry for each of the 8 keys:

> str(df)
'data.frame':   800 obs. of  3 variables:
 $ key  : chr  "Y0" "Y0" "Y0" "Y0" ...
 $ ts   : POSIXct, format: "2020-11-19 15:59:57" "2020-11-19 15:59:52" ...
 $ value: num  30.1 30.2 30.2 30.1 30.2 ...

Without knowing in advance which timestep is used for storing data, it is not clear to define the period length to repeat in the request. Data are received by date in reverse order, so it's possible to check the minimum date and to loop on request with an upper date equals to the minimum date minus one second and to repeat the operation until the return is empty.