# Query Tibber EnergyResolution

**URL:** <https://discourse.nodered.org/t/query-tibber-energyresolution/83615>\
**Category:** General\
**Created:** [11 December 2023 18:42 UTC](https://discourse.nodered.org/t/query-tibber-energyresolution/83615 "2023-12-11T18:42:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)\
**Post date:** [11 December 2023 18:42 UTC](https://discourse.nodered.org/t/query-tibber-energyresolution/83615/1 "2023-12-11T18:42:38Z")

</div>

Hi, I would like to query the EnergyResolution instead of contrib-tibber with a function.  
I was told in this forum how to:

```auto
const headers = {};
const token = "xxxxx";
headers["Content-Type"] = "application/json";
headers["Authorization"] = `Bearer ${token}`;
msg.method = "POST";
msg.headers = headers;
msg.url = "https://api.tibber.com/v1-beta/gql";
msg.payload = {"query":"{viewer {homes {consumption (resolution: HOURLY, last: 24) {nodes {from cost unitPrice consumption}}}}}"};
 return msg;

```

I also got prices of now, today and tomorrow, as I can get with the contrib-tibber.

But I don´t geht the Energy Resolution of the last month like in the contrib-tibber:  
 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/c/3c7626e62ba4c1b05a505c33cfa1255d5ed0f607.png)

=\> total costs of last month, total grid import and the average price.

Any idea how to query ?  
msg.payload = {"query":"{viewer {homes {EnergyResolution (resolution: Month) {nodes {?}}}}}"};

---

<div class="post-metadata">

**Author:** ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)\
**Post date:** [18 December 2023 13:23 UTC](https://discourse.nodered.org/t/query-tibber-energyresolution/83615/2 "2023-12-18T13:23:08Z")

</div>

```auto
msg.payload = {"query":"{viewer {homes {consumption (resolution: MONTHLY, last: 1) {nodes {from cost unitPrice consumption}}}}}"};

```

_sometimes you can't see the forest for the trees_

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [1 January 2024 13:23 UTC](https://discourse.nodered.org/t/query-tibber-energyresolution/83615/3 "2024-01-01T13:23:22Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
