简体   繁体   English

如何从 Thingsboard 检索客户所有设备的遥测数据

[英]How to retrieve telemetry for customer’s all devices from Thingsboard

If I have this kind of thingsboard entities There are Device D1,D2 and Customer C1如果我有这种事物板实体,则有设备 D1、D2 和客户 C1

First time, I assigned D1 device to C1 customer第一次,我将D1设备分配给C1客户

--> D1-C1 --> D1-C1

and later I unassigned C1 from D1, and I assigned D2 device to C1 customer.后来我从 D1 取消分配 C1,并将 D2 设备分配给 C1 客户。

--> D2-C1 --> D2-C1

then is it possible to check that customer's all telemetry C1 used?那么是否可以检查客户使用的所有遥测 C1? In this case I want to retrieve C1 customer's data: all telemetry from Device D1, D2 (please see attached image)在这种情况下,我想检索 C1 客户的数据:来自设备 D1、D2 的所有遥测数据(请参见附图)

Actually I don't know how to retrieve all those data from many devices.实际上我不知道如何从许多设备中检索所有这些数据。 should I use rule chain or rest api?我应该使用规则链还是 rest api?

imgae 图像

Rule Chain would help you if each device has unique set of telemetry names.如果每个设备都有一组唯一的遥测名称,则规则链会有所帮助。 In such case every time when new data comes to server you could redirect it from device to customer using Change originator node在这种情况下,每次新数据到达服务器时,您都可以使用Change originator node将其从设备重定向到客户

In your case try to use two-step REST calls:在您的情况下,尝试使用两步 REST 调用:

  1. Get list of customer's devices 获取客户设备列表
  2. Get telemetry for each device . 获取每个设备的遥测数据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM