Infinity Plugin JSON

Hello together,

I’m trying to retrieve data from the Tibber API with Grafana 10. With the GraphQL plugin this works fine, but this plugin is deprecated and will probably disappear soon. So I tried the plugin Infinity. Retrieving the data works and I get a JSON as a return.
How do I get this JSON into a table for visualization? The indication of “viewer”
as root has in the GraphQL plugin but unfortunately does not work in the Infinity.

Screenshot attached.

Thank you and greetings

Welcome @smass04

Notice the parsing option at bottom

Also try transformation → extract fields

1 Like

Thank you. :slight_smile:

1 Like

It works with static fields. But who unfortunately does not, how to convert an array.
for example:

[
	{
		"energy": 0.0566,
		"startsAt": "2024-02-25T00:00:00.000+01:00",
		"tax": 0.1764,
		"total": 0.233
	},
	{
		"energy": 0.0554,
		"startsAt": "2024-02-25T01:00:00.000+01:00",
		"tax": 0.1762,
		"total": 0.2316
	},
	{
		"energy": 0.0554,
		"startsAt": "2024-02-25T02:00:00.000+01:00",
		"tax": 0.1762,
		"total": 0.2316
	},
	{
		"energy": 0.0549,
		"startsAt": "2024-02-25T03:00:00.000+01:00",
		"tax": 0.1761,
		"total": 0.231
	},
	{
		"energy": 0.0552,
		"startsAt": "2024-02-25T04:00:00.000+01:00",
		"tax": 0.1761,
		"total": 0.2313
	},
	{
		"energy": 0.0551,
		"startsAt": "2024-02-25T05:00:00.000+01:00",
		"tax": 0.1761,
		"total": 0.2312
	},
	{
		"energy": 0.0567,
		"startsAt": "2024-02-25T06:00:00.000+01:00",
		"tax": 0.1764,
		"total": 0.2331
	},
	{
		"energy": 0.0599,
		"startsAt": "2024-02-25T07:00:00.000+01:00",
		"tax": 0.1771,
		"total": 0.237
	},
	{
		"energy": 0.0616,
		"startsAt": "2024-02-25T08:00:00.000+01:00",
		"tax": 0.1773,
		"total": 0.2389
	},
	{
		"energy": 0.0618,
		"startsAt": "2024-02-25T09:00:00.000+01:00",
		"tax": 0.1774,
		"total": 0.2392
	},
	{
		"energy": 0.0563,
		"startsAt": "2024-02-25T10:00:00.000+01:00",
		"tax": 0.1764,
		"total": 0.2327
	},
	{
		"energy": 0.0541,
		"startsAt": "2024-02-25T11:00:00.000+01:00",
		"tax": 0.176,
		"total": 0.2301
	},
	{
		"energy": 0.05,
		"startsAt": "2024-02-25T12:00:00.000+01:00",
		"tax": 0.1752,
		"total": 0.2252
	},
	{
		"energy": 0.046,
		"startsAt": "2024-02-25T13:00:00.000+01:00",
		"tax": 0.1744,
		"total": 0.2204
	},
	{
		"energy": 0.0498,
		"startsAt": "2024-02-25T14:00:00.000+01:00",
		"tax": 0.1752,
		"total": 0.225
	},
	{
		"energy": 0.055,
		"startsAt": "2024-02-25T15:00:00.000+01:00",
		"tax": 0.1761,
		"total": 0.2311
	},
	{
		"energy": 0.0678,
		"startsAt": "2024-02-25T16:00:00.000+01:00",
		"tax": 0.1785,
		"total": 0.2463
	},
	{
		"energy": 0.0822,
		"startsAt": "2024-02-25T17:00:00.000+01:00",
		"tax": 0.1813,
		"total": 0.2635
	},
	{
		"energy": 0.0937,
		"startsAt": "2024-02-25T18:00:00.000+01:00",
		"tax": 0.1835,
		"total": 0.2772
	},
	{
		"energy": 0.0792,
		"startsAt": "2024-02-25T19:00:00.000+01:00",
		"tax": 0.1807,
		"total": 0.2599
	},
	{
		"energy": 0.07,
		"startsAt": "2024-02-25T20:00:00.000+01:00",
		"tax": 0.1789,
		"total": 0.2489
	},
	{
		"energy": 0.0659,
		"startsAt": "2024-02-25T21:00:00.000+01:00",
		"tax": 0.1782,
		"total": 0.2441
	},
	{
		"energy": 0.0652,
		"startsAt": "2024-02-25T22:00:00.000+01:00",
		"tax": 0.1781,
		"total": 0.2433
	},
	{
		"energy": 0.0584,
		"startsAt": "2024-02-25T23:00:00.000+01:00",
		"tax": 0.1767,
		"total": 0.2351
	}
]

what did you use to parse the original results. Notice in the parsing you can also use JSONATA

image

with

And you should get what you need. Are you familiar with jsonata?

ok thanks, I’ll try JSONATA. :slight_smile:

1 Like

Unfortunately I do not know JSONATA in detail yet.
Do you have a syntax example of my JSON? Please. :slight_smile:

{
  "data": {
    "viewer": {
      "homes": [
        {
          "currentSubscription": {
            "priceInfo": {
              "current": {
                "total": 0.5391,
                "energy": 0.3373,
                "tax": 0.2018,
                "startsAt": "2024-02-25T13:00:00.000+01:00"
              },
              "today": [
                {
                  "total": 0.5845,
                  "energy": 0.3736,
                  "tax": 0.2109,
                  "startsAt": "2024-02-25T00:00:00.000+01:00"
                },
                {
                  "total": 0.5867,
                  "energy": 0.3754,
                  "tax": 0.2113,
                  "startsAt": "2024-02-25T01:00:00.000+01:00"
                },
                {
                  "total": 0.562,
                  "energy": 0.3556,
                  "tax": 0.2064,
                  "startsAt": "2024-02-25T02:00:00.000+01:00"
                },
                {
                  "total": 0.5554,
                  "energy": 0.3503,
                  "tax": 0.2051,
                  "startsAt": "2024-02-25T03:00:00.000+01:00"
                },
                {
                  "total": 0.5499,
                  "energy": 0.3459,
                  "tax": 0.204,
                  "startsAt": "2024-02-25T04:00:00.000+01:00"
                },
                {
                  "total": 0.5447,
                  "energy": 0.3418,
                  "tax": 0.2029,
                  "startsAt": "2024-02-25T05:00:00.000+01:00"
                },
                {
                  "total": 0.5477,
                  "energy": 0.3441,
                  "tax": 0.2036,
                  "startsAt": "2024-02-25T06:00:00.000+01:00"
                },
                {
                  "total": 0.5498,
                  "energy": 0.3458,
                  "tax": 0.204,
                  "startsAt": "2024-02-25T07:00:00.000+01:00"
                },
                {
                  "total": 0.5902,
                  "energy": 0.3782,
                  "tax": 0.212,
                  "startsAt": "2024-02-25T08:00:00.000+01:00"
                },
                {
                  "total": 0.6087,
                  "energy": 0.393,
                  "tax": 0.2157,
                  "startsAt": "2024-02-25T09:00:00.000+01:00"
                },
                {
                  "total": 0.6104,
                  "energy": 0.3943,
                  "tax": 0.2161,
                  "startsAt": "2024-02-25T10:00:00.000+01:00"
                },
                {
                  "total": 0.596,
                  "energy": 0.3828,
                  "tax": 0.2132,
                  "startsAt": "2024-02-25T11:00:00.000+01:00"
                },
                {
                  "total": 0.5433,
                  "energy": 0.3407,
                  "tax": 0.2026,
                  "startsAt": "2024-02-25T12:00:00.000+01:00"
                },
                {
                  "total": 0.5391,
                  "energy": 0.3373,
                  "tax": 0.2018,
                  "startsAt": "2024-02-25T13:00:00.000+01:00"
                },
                {
                  "total": 0.5379,
                  "energy": 0.3363,
                  "tax": 0.2016,
                  "startsAt": "2024-02-25T14:00:00.000+01:00"
                },
                {
                  "total": 0.547,
                  "energy": 0.3436,
                  "tax": 0.2034,
                  "startsAt": "2024-02-25T15:00:00.000+01:00"
                },
                {
                  "total": 0.7688,
                  "energy": 0.521,
                  "tax": 0.2478,
                  "startsAt": "2024-02-25T16:00:00.000+01:00"
                },
                {
                  "total": 1.2327,
                  "energy": 0.8922,
                  "tax": 0.3405,
                  "startsAt": "2024-02-25T17:00:00.000+01:00"
                },
                {
                  "total": 1.3888,
                  "energy": 1.0171,
                  "tax": 0.3717,
                  "startsAt": "2024-02-25T18:00:00.000+01:00"
                },
                {
                  "total": 1.1421,
                  "energy": 0.8197,
                  "tax": 0.3224,
                  "startsAt": "2024-02-25T19:00:00.000+01:00"
                },
                {
                  "total": 1.0088,
                  "energy": 0.713,
                  "tax": 0.2958,
                  "startsAt": "2024-02-25T20:00:00.000+01:00"
                },
                {
                  "total": 0.7283,
                  "energy": 0.4886,
                  "tax": 0.2397,
                  "startsAt": "2024-02-25T21:00:00.000+01:00"
                },
                {
                  "total": 0.666,
                  "energy": 0.4388,
                  "tax": 0.2272,
                  "startsAt": "2024-02-25T22:00:00.000+01:00"
                },
                {
                  "total": 0.5377,
                  "energy": 0.3362,
                  "tax": 0.2015,
                  "startsAt": "2024-02-25T23:00:00.000+01:00"
                }
              ],
              "tomorrow": [
                {
                  "total": 0.489,
                  "energy": 0.2972,
                  "tax": 0.1918,
                  "startsAt": "2024-02-26T00:00:00.000+01:00"
                },
                {
                  "total": 0.4954,
                  "energy": 0.3024,
                  "tax": 0.193,
                  "startsAt": "2024-02-26T01:00:00.000+01:00"
                },
                {
                  "total": 0.5062,
                  "energy": 0.311,
                  "tax": 0.1952,
                  "startsAt": "2024-02-26T02:00:00.000+01:00"
                },
                {
                  "total": 0.5208,
                  "energy": 0.3226,
                  "tax": 0.1982,
                  "startsAt": "2024-02-26T03:00:00.000+01:00"
                },
                {
                  "total": 0.5925,
                  "energy": 0.38,
                  "tax": 0.2125,
                  "startsAt": "2024-02-26T04:00:00.000+01:00"
                },
                {
                  "total": 0.607,
                  "energy": 0.3916,
                  "tax": 0.2154,
                  "startsAt": "2024-02-26T05:00:00.000+01:00"
                },
                {
                  "total": 0.7835,
                  "energy": 0.5328,
                  "tax": 0.2507,
                  "startsAt": "2024-02-26T06:00:00.000+01:00"
                },
                {
                  "total": 1.0291,
                  "energy": 0.7293,
                  "tax": 0.2998,
                  "startsAt": "2024-02-26T07:00:00.000+01:00"
                },
                {
                  "total": 1.227,
                  "energy": 0.8876,
                  "tax": 0.3394,
                  "startsAt": "2024-02-26T08:00:00.000+01:00"
                },
                {
                  "total": 1.1193,
                  "energy": 0.8014,
                  "tax": 0.3179,
                  "startsAt": "2024-02-26T09:00:00.000+01:00"
                },
                {
                  "total": 1.022,
                  "energy": 0.7236,
                  "tax": 0.2984,
                  "startsAt": "2024-02-26T10:00:00.000+01:00"
                },
                {
                  "total": 0.993,
                  "energy": 0.7004,
                  "tax": 0.2926,
                  "startsAt": "2024-02-26T11:00:00.000+01:00"
                },
                {
                  "total": 0.9102,
                  "energy": 0.6342,
                  "tax": 0.276,
                  "startsAt": "2024-02-26T12:00:00.000+01:00"
                },
                {
                  "total": 0.9063,
                  "energy": 0.631,
                  "tax": 0.2753,
                  "startsAt": "2024-02-26T13:00:00.000+01:00"
                },
                {
                  "total": 0.9434,
                  "energy": 0.6607,
                  "tax": 0.2827,
                  "startsAt": "2024-02-26T14:00:00.000+01:00"
                },
                {
                  "total": 0.9486,
                  "energy": 0.6649,
                  "tax": 0.2837,
                  "startsAt": "2024-02-26T15:00:00.000+01:00"
                },
                {
                  "total": 0.992,
                  "energy": 0.6996,
                  "tax": 0.2924,
                  "startsAt": "2024-02-26T16:00:00.000+01:00"
                },
                {
                  "total": 1.1623,
                  "energy": 0.8358,
                  "tax": 0.3265,
                  "startsAt": "2024-02-26T17:00:00.000+01:00"
                },
                {
                  "total": 1.2751,
                  "energy": 0.9261,
                  "tax": 0.349,
                  "startsAt": "2024-02-26T18:00:00.000+01:00"
                },
                {
                  "total": 1.2167,
                  "energy": 0.8794,
                  "tax": 0.3373,
                  "startsAt": "2024-02-26T19:00:00.000+01:00"
                },
                {
                  "total": 1.0974,
                  "energy": 0.784,
                  "tax": 0.3134,
                  "startsAt": "2024-02-26T20:00:00.000+01:00"
                },
                {
                  "total": 1.0088,
                  "energy": 0.713,
                  "tax": 0.2958,
                  "startsAt": "2024-02-26T21:00:00.000+01:00"
                },
                {
                  "total": 0.957,
                  "energy": 0.6716,
                  "tax": 0.2854,
                  "startsAt": "2024-02-26T22:00:00.000+01:00"
                },
                {
                  "total": 0.942,
                  "energy": 0.6596,
                  "tax": 0.2824,
                  "startsAt": "2024-02-26T23:00:00.000+01:00"
                }
              ]
            }
          }
        }
      ]
    }
  }
}

Here is the document, try it out its pretry straightforward and post back with any issues. You just walk down the docu an element at a time

1 Like

Do you have a solution yet? I’m also trying to get Inifnity up and running with the Tibber API

welcome @mobiax

Can you share what you have already tried and where you are hitting a wall?

Hello together,

Yes, I solved it. In JSONata a root path must be specified, then the data is extracted.
In my example with a Tibber JSON, the root path is:

data.viewer.homes.currentSubscription.priceInfo.today

Now the data can also be visualized.

My only problem I still have is the conversion of numerical values with point to comma.

for example:
from 0.15 to 0,15 or 1.235,55

thanks :slight_smile:

{
  "data": {
    "viewer": {
      "homes": [
        {
          "currentSubscription": {
            "priceInfo": {
              "today": [
                {
                  "total": 0.2542,
                  "energy": 0.062,
                  "tax": 0.1922,
                  "startsAt": "2024-03-01T00:00:00.000+01:00"
                },
                {
                  "total": 0.2535,
                  "energy": 0.0614,
                  "tax": 0.1921,
                  "startsAt": "2024-03-01T01:00:00.000+01:00"
                },
                {
                  "total": 0.2496,
                  "energy": 0.0581,
                  "tax": 0.1915,
                  "startsAt": "2024-03-01T02:00:00.000+01:00"
                },
                {
                  "total": 0.2492,
                  "energy": 0.0578,
                  "tax": 0.1914,
                  "startsAt": "2024-03-01T03:00:00.000+01:00"
                },
                {
                  "total": 0.2498,
                  "energy": 0.0583,
                  "tax": 0.1915,
                  "startsAt": "2024-03-01T04:00:00.000+01:00"
                },
                {
                  "total": 0.2548,
                  "energy": 0.0625,
                  "tax": 0.1923,
                  "startsAt": "2024-03-01T05:00:00.000+01:00"
                },
                {
                  "total": 0.2656,
                  "energy": 0.0716,
                  "tax": 0.194,
                  "startsAt": "2024-03-01T06:00:00.000+01:00"
                },
                {
                  "total": 0.2749,
                  "energy": 0.0794,
                  "tax": 0.1955,
                  "startsAt": "2024-03-01T07:00:00.000+01:00"
                },
                {
                  "total": 0.2801,
                  "energy": 0.0838,
                  "tax": 0.1963,
                  "startsAt": "2024-03-01T08:00:00.000+01:00"
                },
                {
                  "total": 0.2707,
                  "energy": 0.0759,
                  "tax": 0.1948,
                  "startsAt": "2024-03-01T09:00:00.000+01:00"
                },
                {
                  "total": 0.2596,
                  "energy": 0.0665,
                  "tax": 0.1931,
                  "startsAt": "2024-03-01T10:00:00.000+01:00"
                },
                {
                  "total": 0.2575,
                  "energy": 0.0648,
                  "tax": 0.1927,
                  "startsAt": "2024-03-01T11:00:00.000+01:00"
                },
                {
                  "total": 0.2555,
                  "energy": 0.0631,
                  "tax": 0.1924,
                  "startsAt": "2024-03-01T12:00:00.000+01:00"
                },
                {
                  "total": 0.2573,
                  "energy": 0.0646,
                  "tax": 0.1927,
                  "startsAt": "2024-03-01T13:00:00.000+01:00"
                },
                {
                  "total": 0.2603,
                  "energy": 0.0671,
                  "tax": 0.1932,
                  "startsAt": "2024-03-01T14:00:00.000+01:00"
                },
                {
                  "total": 0.2668,
                  "energy": 0.0726,
                  "tax": 0.1942,
                  "startsAt": "2024-03-01T15:00:00.000+01:00"
                },
                {
                  "total": 0.2744,
                  "energy": 0.0789,
                  "tax": 0.1955,
                  "startsAt": "2024-03-01T16:00:00.000+01:00"
                },
                {
                  "total": 0.2868,
                  "energy": 0.0894,
                  "tax": 0.1974,
                  "startsAt": "2024-03-01T17:00:00.000+01:00"
                },
                {
                  "total": 0.292,
                  "energy": 0.0937,
                  "tax": 0.1983,
                  "startsAt": "2024-03-01T18:00:00.000+01:00"
                },
                {
                  "total": 0.2842,
                  "energy": 0.0872,
                  "tax": 0.197,
                  "startsAt": "2024-03-01T19:00:00.000+01:00"
                },
                {
                  "total": 0.2726,
                  "energy": 0.0775,
                  "tax": 0.1951,
                  "startsAt": "2024-03-01T20:00:00.000+01:00"
                },
                {
                  "total": 0.2656,
                  "energy": 0.0716,
                  "tax": 0.194,
                  "startsAt": "2024-03-01T21:00:00.000+01:00"
                },
                {
                  "total": 0.2638,
                  "energy": 0.0701,
                  "tax": 0.1937,
                  "startsAt": "2024-03-01T22:00:00.000+01:00"
                },
                {
                  "total": 0.2594,
                  "energy": 0.0664,
                  "tax": 0.193,
                  "startsAt": "2024-03-01T23:00:00.000+01:00"
                }
              ]
            }
          }
        }
      ]
    }
  }
}
1 Like