How to display value from access token (Wattage meter)

#1

Hi all.

I would like to display the instant use of power into a gauge. I have a power meter that uses API, and I have the access token I want to use is:
https://my.eliq.io/api/datanow?accesstoken=ab307b7798254bea8e0c3c11a7f6e8f4&channelid=14336

{"channelid":14336,"createddate":"2019-01-07T13:27:56","power":1110.0}

How can I set node-red to use the value of "power" in a gauge?
I've tried with using "http-response", "function" and "gauge", but I'm not sure how to program it. I guess its a simple thing for those who am more experienced than me.

Thanks for all your help in advance.

#2

http response is for if you want Node-RED to act as a webserver.

Take a look at http request that will return a string. but if you run it through the json node you will then be able to manipulate the data.

The debug node if your friend especially after reading this page https://nodered.org/docs/user-guide/messages

With this information and reading the info panels of the dashboard you should be able to get where you want...

#3

Thanks! I'll look into it.

#4

I created a http request with GET and the weblink I had. Then json with msg.payload, and then for a test I used a text function with the value {{msg.payload.power}}. It worked.

Thanks for your help ukmoose.

1 Like