This documentation shows how to send a data flow to emoncms.org.

Emoncms is a powerful open-source web-app for processing, logging and visualising energy, temperature and other environmental data. Part of the OpenEnergyMonitor.org project.

Emoncms

Create an account Emoncms

First of all go on the website http://emoncms.org, and create an account.

A webpage which contains some informations will appear :

Create new input

Next hit Input on the top of the page. A page will indicate that there is no input :

So create an input. To do this, click on the link Input API helper to know the Read & Write ApiKey :

Now, in the navigation bar of a browser, copy and paste this address and replace YourApiKey by the key got earlier :

http://emoncms.org/input/post.json?json={btc:345}&apikey=YourApiKey

After, a confirmation message (ok) will appear on the page. Return on the input page where is now an input called btc which was etablished :

Then click on the button framed in red :

Do the same as the image above and click on Add.

Create a dashboard

The next step is to realize the graph. For this hit on Dashboard on the top of the page. A page will indicate there is no dashboard :

To create one, click on the icon framed in red. Next hit on Containers and a container (here Container-BlueLine) :

Now click on the dashboard to insert the container selected :

Finally insert the visualisation object (realtime) thanks to same method :

Create the Node-RED flow

Now create a flow to send the bitcoin to Emoncms.

Firstly insert an inject node.

Then configure the inject node like that :

After, add a http request node,

with the configuration bellow:

Next, insert a function node.

And write the following code:

var obj = JSON.parse(msg.payload);
var rates = obj.EUR.exchanges.bitcoin_central.rates;
var bid = rates.bid;

msg.payload = bid;

return msg;

Finally, drop-and-drag an emoncms node :

Fill in the blanks as shown in the picture:

To finish like these nodes like that:

It is also possible to paste complete flow in Node-RED using the Import from... clipboard menu :

[{"id":"eee412c3.6ad5d8","type":"inject","name":"","topic":"","payload":"","payloadType":"date","repeat":"20","crontab":"","once":false,"x":132,"y":261,"z":"819e8626.375e3","wires":[["3b77e88f.d3bac"]]},{"id":"3b77e88f.d3bac","type":"http request","name":"","method":"GET","url":"https://api.bitcoinaverage.com/all","x":281,"y":261,"z":"819e8626.375e3","wires":[["1c2f0501.20e483"]]},{"id":"1c2f0501.20e483","type":"function","name":"","func":"var obj = JSON.parse(msg.payload);\nvar rates = obj.EUR.exchanges.bitcoin_central.rates; \nvar bid = rates.bid;\n\nmsg.payload = bid;\n\nreturn msg;","outputs":1,"x":461,"y":261,"z":"819e8626.375e3","wires":[["97fcfe33.fe952"]]},{"id":"97fcfe33.fe952","type":"emoncms","name":"","topic":"","key":"btc","apikey":"89770e24ca06094afad56f5954b43569","x":657,"y":261,"z":"819e8626.375e3","wires":[]}]

How to see the graph

At this point, the flow Node-RED sends the values of the bitcoin in the variable btc in EmonCMS.

This last part will show how to see the graph of btc.

Go on the website of emoncms and log in.

Then hit on dashboard at the top of the page. Next click on the button, framed on red, on this page:

Finally, the page with the dashboard appears:

Back to top