Newbie here, Tibber question

Hi guys! Maybe this is a more general question to be honest, but the context still is around the Dashboard topic so I will give it a try. I installed Node-red for a couple of weeks ago but I just recently started to work with the platform. I have no development skills whatsoever, but I think I usually can hold my own by just reading forums and stuff.
However, I am trying to receive values from my Tibber (a company that deliveres electricity in a smarter way) account using the Tibber palette, which contains of for nodes:
image
I have consulted the Tibber Developers page to sort out what needs to be entered and where, it is based on GraphQL to get the information that the user wants.

To be honest, I am stuck. I am wondering if someone here have used Tibber for Node-red and that can help me, or at least show me what direction I need to go. I am mostly interested in fetching todays and tomorrows prices and present that in a graph.

Apart from this, I think I am in a good shape when it comes to Dashboard. Quite straight forward!

Well, for a start what you may want to do is drag a debug node into the edit area.

Then you connect the output of those nodes to the debug node.

Double click on the debug node and set it as shown here:

Then click the deploy button (top right RED)

As things happen you should see stuff on the right side of the screen. (Output of the debug nodes.)

That will establish they are receiving stuff.

Thanks for quick response, @Trying_to_learn!
Well, I took two (probably more) steps backwards and started from scratch, starting with an injector to trigger the both nodes and did as you said with the debug node.

I clearly miss some important info on my nodes,

I am still just starting to grasp the functionality of node-red, I just need to get started and then I will probably find my way forward on my own (to a larger extent, at least)

Oops,

Sorry.

I didn't see the input side of the nodes. :frowning:

So let's go through the nodes - as I see them:

tibber feed is a receiver.

tibber query allows a query to be sent and a reply received in one pass.
tibber data is used to write data to the tibber ...... thing.

The query then - now after thinking a bit about it - is how you look in the tibber thing. (Database?)

and lastly the tibber notify is a message that is sent from tibber.

Alas you will need to know how to format/structure data to send messages into this tibber.

I'm not sure you could do something like:

inject node ---- connected to ---- tibber notify
tibber feed ---- connected to ---- debug node.

Press the inject and see if the debug echoes what you sent.

But I am only guessing. I don't know what tibber is.

What you did above failed because you didn't send valid messages to the query and data nodes.

For instance - given it is a database kind of thing - you can't expect to get a valid response if you send a random thing to look up a database. (query)
Or if you are trying to write to the database. (the lower node)

Hi and welcome to the forum! Unfortunately I haven't used Tibber but let's see if I could help you anyway.

I take it from here that you have already successfully got some data fetched using maybe the tibber-feed node, the tibber-data node or the example flows provided with them?

... and the actual issue is with forming the GraphQL query to fetch data that's not available by using the feed or data nodes?

First and foremost we need to make sure the connection and your credentials have been entered correctly and that there's no issues fetching data using the examples.

Haha, no worries! I could have been more clear.
Short story, Tibber is a new electricity delivering company. They are focusing on smart homes and have some real slick things, above other things they let us use their API to interconnect stuff, like node-red.
They have something called Tibber Pulse, which you connect to your home for live monitoring of your consumption. I don't have that yet so that node can be left aside. Tibber Notify is just a way of forcing the Tibber app to push a notification, I think. Not important.

Tibber query and Tibber data can be used to get other information, like todays or tomorrows electricity price. With GraphQL I should be able to query the API for the data I need. In my case, I would like to present that in a graph on my dashboard. I have read the the FAQ for GraphQL here and the Tibber node here.

So, the big question for me, who is not a developer but just trying to understand how it works is to find out how to use the nodes. I suspect that I need use the both nodes together. First a Injector or similiar, connect to Tibber Query (with the correct query, whatever that is) and then connect that to Tibber Data to extract the info stated in the Tibber Query, and return it to debug node.

What do you think of that?

Sorry, way beyond my skill set.

Wow, I am stunned how friendly you guys are! Thanks @ristomatti!
Well, I have not successfully received anything, yet. I do not know if I can trust the "connected" icon on the screen, if I can, I think I at least successfully connected with my API token to their services. Good start. :slight_smile:

1 Like

I can only make a guess based on the documentation available here node-red-contrib-tibber-api (node) - Node-RED but I would believe you could just add a tibber-feed node followed by a debug node to see some data. Likely when adding the node you will be asked to add your API token somewhere, possibly to a separate configuration node shares between the different Tibber nodes.

Does it work like that? If it does then based on the documentation to get what you explained to be interested of, you'd need for example an inject node to periodically send a message to the tibber-query node. The bigger question would be what to enter on its configuration to get the data you need.

I took a quick look on the API documentation and in there they seem to have a handy API explorer. I cannot really try it without a token but by entering a dummy token I was able to see this example query to fetch the current energy price:

{
  viewer {
    homes {
      currentSubscription{
        priceInfo{
          current{
            total
            energy
            tax
            startsAt
          }
        }
      }
    }
  }
}

If you copy and paste that to the query node configuration, can you get some sensible data outputted on the debug node?

No worries @Trying_to_learn! I am so grateful that you gave it a try and sorted out some stuff for me anyway. It is not easy when you don't use the service!

I am not sure, I think Tibber Feed utilizes the Tibber Pulse, a module to live monitor consumption, which I don't have yet. But I made a flow using that in case something will come, I will get notified about that via the MQTT topic.

Ah, know I saw your updated post. I will try that, like this?

Yes that's what I meant. Do you get anything on the right hand side debug pane after pushing the inject node's trigger button? Could you do a screenshot of what's shown?

P.S. It's a good idea to have separate debug nodes for each distinct flow. It'll be easier to figure out where the data came when you'll have more stuff going on.

Unfortunately, I will not make this easy for us. To me, it looks like an error. Maybe not due to connection (I fetched a good API key), but there is something with the query:

Can you change the debug node to display the full msg object so we don't miss anything, like @Trying_to_learn explained?

I'll install the nodes on my test Node-RED and see what the online documentation says to better understand how the nodes should be used.

Ah sorry, I did hat before but I thought the message told me less about what I want to know when doing that, so I changed back. :slight_smile:

Ok no prob, it seems all the info is inside the payload property anyway. I got the nodes installed and was able to get the same error as you did. Just a moment if I can get it to do anything else.

Just a quick thing to mention....

You are new here. As a result you are allowed a finite number of posts then you can't post any more.

Rather than posting a new reply, edit a previous one.
Of course you will have to mention this to @ristomatti so he understands what you are doing.
Coz I think you will be getting close to your limit.

2 Likes

It seems the documentation was a bit lacking. From the flows page I got that you need to paste the query into the query node configuration but instead it reads it from the msg.payload of the incoming message. You could just enter the query in the inject node configuration but it would not be very easy to read. Instead I suggest to use a template node.

Try to import this example flow from the Menu -> Import:

[{"id":"be4d9e2e.b5f52","type":"tibber-query","z":"2795b53e.b26e3a","name":"","active":true,"apiEndpointRef":"7fb06f58.101d9","x":190,"y":180,"wires":[["6b5798cf.c411c8"]]},{"id":"d8090c2c.45052","type":"inject","z":"2795b53e.b26e3a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":60,"wires":[["baf7c521.66c7c8"]]},{"id":"6b5798cf.c411c8","type":"debug","z":"2795b53e.b26e3a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":350,"y":180,"wires":[]},{"id":"baf7c521.66c7c8","type":"template","z":"2795b53e.b26e3a","name":"current prices query","field":"payload","fieldType":"msg","format":"text","syntax":"plain","template":"{\n  viewer {\n    homes {\n      currentSubscription{\n        priceInfo{\n          current{\n            total\n            energy\n            tax\n            startsAt\n          }\n        }\n      }\n    }\n  }\n}","output":"str","x":160,"y":120,"wires":[["be4d9e2e.b5f52"]]},{"id":"7fb06f58.101d9","type":"tibber-api-endpoint","z":"","feedUrl":"wss://api.tibber.com/v1-beta/gql/subscriptions","queryUrl":"https://api.tibber.com/v1-beta/gql","name":""}]

You'll need to edit the query node to have your API token. I used just 1234 and I'm now getting a token error.

1 Like

A good point, thanks! It would be nice if the forum software was smart enough to increase the limit if a message gets replied. Or if regular visitors could "vote" to skip the new user limit.

1 Like

(I have bumped @Henke82 to basic user so it shouldn't be a problem)

2 Likes