1

I have a data converter that generates the following output

[{
    "deviceName": "meter 34936959",
    "groupName": "All",
    "ts": 1579788289,
    "values": {
        "counter": 2686
    }
}]

timestamp is 1579788289, which is Thursday, 23 January 2020 14:04:49 but in the device page, latest telemetry is "1970-01-19 08:49:48"

can you please help me to understand what is wrong with the structure?

device telemetry page-screenshot

Thank you

nopassport1
  • 1,821
  • 1
  • 25
  • 53
Aviad
  • 11
  • 2
  • It would be useful for answerers if you could explain how you are generating this JSON and where you are sending it. For example, a link to the telemetry API you are using. In this case, it is clear what the problem is regardless, but a bit of context is handy (and will help other people with the same problem find the answer). – sunil Jan 23 '20 at 14:53

1 Answers1

1

It is expecting a timestamp in milliseconds, but you are supplying a timestamp in seconds.

  • 1579788289 seconds since 1970 is "2020-01-23 14:04:49"
  • 1579788289 milliseconds since 1970 is "1970-01-19 08:49:48"

There is an example of this in the ThingsBoard documentation:

In the example above, we assume that “1451649600512” is a unix timestamp with milliseconds precision.

If you can't get the millisecond timestamp, try multiplying your timestamp by 1000 before sending it. With your example, that would be:

[{
    "deviceName": "meter 34936959",
    "groupName": "All",
    "ts": 1579788289000,
    "values": {
        "counter": 2686
    }
}]
sunil
  • 556
  • 6
  • 20
  • Thank you!! I was expected to see this information also here: https://thingsboard.io/docs/user-guide/integrations/#data-converters – Aviad Jan 23 '20 at 19:50