将数据发送到ThingsBoard,时间戳由我们定义。

huangapple go评论66阅读模式
英文:

Sending data to thingsboard with a timestamp defined by us

问题

有没有办法发送数据到Thingsboard,并由我们定义时间戳?

项目大致如下...
我想比较在建筑物安装更好的窗户之前和之后的能源消耗,使用一个能源计量器:

-- 安装前的能源消耗 --> 我有来自能源账单的数据,我想将其发送到Thingsboard。
类似... 能源消耗和能源账单的时间戳

然后比较这两种类型的数据...

感谢帮助

已尝试CSV、Swagger API Post更新遥测数据。

英文:

is there a way to send data to thingsboard with a timestamp defined by us??

The project is something like this...
i want to compare energy consumption before and after putting better windows in the building with an energy meter:

-- energy comsumption before installation --> i have data from the energy bills, and i want to send it to Thingsboard.
Something like... energy consumption and timestamp of energy bills

And than compare the 2 type of data...

tks for the help

already tried CSV, swagger API Post update telemetry

答案1

得分: 2

你可以这样做,在ThingsBoard客户端API中,当你提交数据时,可以定义数据的时间戳(https://thingsboard.io/docs/reference/http-api/#telemetry-upload-api):

只需使用以下格式设置你的有效负载的时间戳:

{"ts":1451649600512, "values":{"key1":"value1", "key2":"value2"}}

其中"ts"是你的时间戳,以毫秒为单位。

英文:

Yes you can to it, in thingsboard client side api you can define your data timestamp when you are posting it (https://thingsboard.io/docs/reference/http-api/#telemetry-upload-api):

Just set your payload with timetamp with this format:

{"ts":1451649600512, "values":{"key1":"value1", "key2":"value2"}}

Where "ts" is your timestamp in miliseconds.

huangapple
  • 本文由 发表于 2023年5月24日 17:27:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/76322016.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定