HTTP Api Json Epoch conversion failure

Hi,

I jused the Infinity plugin to make a direct API call to my Fibaro Home Center 3.
The API gives me an JSON file with timestamp (epoch) and values.
So far this is working.

The only thing is, that i can`t get the correct date/time format from the timestamp (epoch) value.
For example:
timestamp: 1608115553
That should be “2020-12-16 10:45:53”.
But Grafana shows “1970-01-19 10:45:53”

Could someone give me the tip to fix this? I cant find it…

Query settings:

It seems your timestamp is in seconds…You need latest version of infinity plugin which supports Unix seconds format. https://github.com/yesoreyeram/grafana-infinity-datasource/releases/tag/v0.6.0-alpha3 let me know it helps.

Hi,

Thanks for your reply!

I tried your new alpha version, but without succes… (same issue).
Is it correct that there is no new option in the drop down menu?
image

Don’t you see Timestamp ( UNIX s ) there?? Scroll and check once. Looks strange to me

Sorry, it’s not there.
Only “Unix ms”.

I cleared my cache, but still not there.

How i did you plugin update:

  • Stopped Grafana Service
  • Remove the old plugin folder
  • Placed the plugin folder from your link
  • Started Grafana service

I just did a clean install of the plugin and grafana. As shown in the screenshot you will see the unix seconds format.

Not sure how to reproduce your scenario.

Plugin URL : https://github.com/yesoreyeram/grafana-infinity-datasource/releases/download/v0.6.0-alpha3/yesoreyeram-infinity-datasource-0.6.0.zip
Grafna URL : https://dl.grafana.com/oss/release/grafana-7.3.0.windows-amd64.zip

I just did a total clean install of Grafana. Now the option “Timestamp ( UNIX s )” is available :slight_smile:!
But… when i create a raw table view of the data, alle timestamps are “now” (moment of refresh). Not my timestamp from the json source. The values (Woonkamer) are oke.

Maybe a small bug?

Good. Seems we made a little progress. Can you post a sample json so i can debug further? If required, raise a bug in the repo.

Sure. 25 objects in json format below. I used “timestamp” for timestamp (of course :wink:) and data.newValue for value point. :

[
{
“data”: {
“id”: 23,
“newValue”: 20.5,
“oldValue”: 21.0,
“property”: “value”
},
“id”: 174859,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609271002,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 21.0,
“oldValue”: 20.5,
“property”: “value”
},
“id”: 174556,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609263078,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 20.5,
“oldValue”: 21.0,
“property”: “value”
},
“id”: 174390,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609256176,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 21.0,
“oldValue”: 21.5,
“property”: “value”
},
“id”: 174166,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609251150,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 21.5,
“oldValue”: 21.3,
“property”: “value”
},
“id”: 174023,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609243766,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 21.3,
“oldValue”: 20.8,
“property”: “value”
},
“id”: 173983,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609242171,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 20.8,
“oldValue”: 20.3,
“property”: “value”
},
“id”: 173794,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609234513,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 20.3,
“oldValue”: 19.8,
“property”: “value”
},
“id”: 173623,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609228393,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 19.8,
“oldValue”: 19.6,
“property”: “value”
},
“id”: 173353,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609222254,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 19.6,
“oldValue”: 20.1,
“property”: “value”
},
“id”: 173303,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609216182,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 20.1,
“oldValue”: 19.6,
“property”: “value”
},
“id”: 173272,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609205671,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 19.6,
“oldValue”: 19.700000000000004,
“property”: “value”
},
“id”: 173263,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609200725,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 19.700000000000004,
“oldValue”: 20.200000000000004,
“property”: “value”
},
“id”: 173250,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609198398,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 20.200000000000004,
“oldValue”: 20.700000000000004,
“property”: “value”
},
“id”: 173247,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609195057,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 20.700000000000004,
“oldValue”: 21.200000000000004,
“property”: “value”
},
“id”: 173142,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609192029,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 21.200000000000004,
“oldValue”: 20.700000000000004,
“property”: “value”
},
“id”: 172976,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609178541,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 20.700000000000004,
“oldValue”: 21.200000000000004,
“property”: “value”
},
“id”: 172354,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609165856,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 21.200000000000004,
“oldValue”: 21.700000000000004,
“property”: “value”
},
“id”: 172338,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609159817,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 21.700000000000004,
“oldValue”: 22.1,
“property”: “value”
},
“id”: 172232,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609157695,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 22.1,
“oldValue”: 21.6,
“property”: “value”
},
“id”: 172002,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609150830,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 21.6,
“oldValue”: 21.1,
“property”: “value”
},
“id”: 171900,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609148582,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 21.1,
“oldValue”: 20.6,
“property”: “value”
},
“id”: 171745,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609146582,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 20.6,
“oldValue”: 20.400000000000003,
“property”: “value”
},
“id”: 171077,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609136191,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 20.400000000000003,
“oldValue”: 19.900000000000003,
“property”: “value”
},
“id”: 171064,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609132223,
“type”: “DevicePropertyUpdatedEvent”
},
{
“data”: {
“id”: 23,
“newValue”: 19.900000000000003,
“oldValue”: 20.400000000000003,
“property”: “value”
},
“id”: 171045,
“objects”: [
{
“id”: 23,
“type”: “device”
}
],
“sourceId”: 0,
“sourceType”: “system”,
“timestamp”: 1609126272,
“type”: “DevicePropertyUpdatedEvent”
}
]

Seems working with “Table” fomat at the bottom of the query.

but not working as expected if we select timeseries. Fix is on the way. If you can raise a bug in the repo?