在 ThingsBoard 中导出设备的遥测数据
export telemetry data of a device in ThingsBoard
我正在使用 thingsboard 社区版。
我想知道是否有办法将设备的所有时间序列数据导出为 csv 或任何其他文件格式。我需要所有的数据来分析它。
thingsboard 专业版有这个功能。但是社区版呢?
默认csv/xls导出仅在专业版中可用。
但您可以使用 REST api 获取历史数据。
我的参考资料如下:
You can also fetch list of historical values for particular entity type and entity id using GET request to the following URL
http(s)://host:port/api/plugins/telemetry/{entityType}/{entityId}/values/timeseries?keys=key1,key2,key3&startTs=1479735870785&endTs=1479735871858&interval=60000&limit=100&agg=AVG
The supported parameters are described below:
keys - comma separated list of telemetry keys to fetch.
startTs - unix timestamp that identifies start of the interval in milliseconds.
endTs - unix timestamp that identifies end of the interval in milliseconds.
interval - the aggregation interval, in milliseconds.
agg - the aggregation function. One of MIN, MAX, AVG, SUM, COUNT, NONE.
limit - the max amount of data points to return or intervals to process.
ThingsBoard will use startTs, endTs and interval to identify aggregation partitions or sub-queries and execute asynchronous queries to DB that leverage built-in aggregation functions."
我正在使用 thingsboard 社区版。
我想知道是否有办法将设备的所有时间序列数据导出为 csv 或任何其他文件格式。我需要所有的数据来分析它。
thingsboard 专业版有这个功能。但是社区版呢?
默认csv/xls导出仅在专业版中可用。
但您可以使用 REST api 获取历史数据。
我的参考资料如下:
You can also fetch list of historical values for particular entity type and entity id using GET request to the following URL
http(s)://host:port/api/plugins/telemetry/{entityType}/{entityId}/values/timeseries?keys=key1,key2,key3&startTs=1479735870785&endTs=1479735871858&interval=60000&limit=100&agg=AVG
The supported parameters are described below:
keys - comma separated list of telemetry keys to fetch.
startTs - unix timestamp that identifies start of the interval in milliseconds.
endTs - unix timestamp that identifies end of the interval in milliseconds.
interval - the aggregation interval, in milliseconds.
agg - the aggregation function. One of MIN, MAX, AVG, SUM, COUNT, NONE.
limit - the max amount of data points to return or intervals to process.
ThingsBoard will use startTs, endTs and interval to identify aggregation partitions or sub-queries and execute asynchronous queries to DB that leverage built-in aggregation functions."