Category Archives: GroveStreams

Using GroveStreams

GrovestreamsNo sooner did I finish the blog on my new GroveStreams Node than I was faced with the question “how do I use GroveStreams?”

Well, that’s generally up to you – but I will start you off on how I use GroveStreams – and the ridiculously simple setup (once you know how).

So what I will describe here takes you from never having heard of GroveStreams to sending information to your own stream. This should take no more than minutes if you already have managed to get my NODE set up on your Node-Red installation as per my previous blog. If you are NOT using Node-Red, then read this anyway as the API call is trivial and you could organise this from just about any package.

First things first – head off to GroveStreams and get a new account. That is, register, receive a confirmation email, click the link and receive a welcome email. You are done.

garageYou will be asked to create an organisation. This confused the hell out of me until I realised they don’t necessarily mean a business organisation. For the purpose of demonstration I created one called “Garage”.

So now you have that. There are many ways to use GroveStreams, for me I wanted a simple means of looking at graphical logs of simple devices over time.. so for example my temperature sensor. GroveStreams does SO much more than simply log data, you can average over time, zoom into areas, you can even use graphical instruments for real-time monitoring – but let’s keep it simple for now.

api keyscomponentsIn my case having created “Garage” – click on it in your browser window. You are now in the “Observation studio”. You will see “components” on your left. Don’t do anything with it…

Top right is ADMIN in the menu – go there and go to API keys. Click on the one marked “Feed Put API Key (with auto-registration rights) – make sure you’ve picked the right one. Select “View Secret Key” above that and you will get your API key. Copy to the clipboard.

Now dump the API key in my NODE along with a sensible name, a component name (in my case for fun “GarageRoof” don’t use spaces.. and a stream called “temperature” – again – an arbitrary name in this case.

Click OK, send some numbers to the node from a device or the “inject” node to test.

If you are NOT using Node-Red then you are looking at a PUT – this should give you a clue as to the format.

var options = {
                  host: '',
                  port: 80,
                  path: '/api/feed?api_key=' + node.api + '&compId=' + node.component + '&compName=' + node.component + '&' + inmsg.payload,
                  method: 'POST'

And that is that!!!

The component should appear magically along with the stream.


Now, what you DO with that is another matter. In my case right clicking GarageRoof opens a dialog and you can then select temperature, tell it what kind of data you are looking at, what averaging period if any you want to use etc. If you have several test values and want to see a quick average, in the image above, right window you will see below the tab “none” – you can drop that down and instantly see some averaging options – there is just SO much to this but my plan here was merely to get you started. I originally set up GroveStreams to take in data from an Arduino (with Ethernet card) and it did that a treat too – still today logs the temperature in my place in Spain every 15 mins and it’s been doing that for over a year – you can zoom in, overlay one reading over another etc.… time to go look at the documentation – have fun.


A GroveStreams Node Red Node

One of the more obvious things to do with a home control system is to capture information like temperature and humidity – and to graph it.  For example I spent part of my time in the UK and part of it in Spain. When I’m not in Spain it is usually raining in the Northeast of England and so I take great delight in checking the weather back at base in Galera in Andalucía.

There are of course many online systems for logging your data and I have demonstrated elsewhere in this blog doing the job locally on a Raspberry Pi. One of my favourite online services is GroveStreams. They have both paid and free offerings and I have chosen the latter as I’m only logging the information out of interest.

I am using a setup in Spain which is about to be replaced… a series of Arduino type modules with either DS128b20 chips or the combined temperature/humidity devices, the DHT22. These talk by short range radio to a large Arduino (1284-based) which is connected to the Internet. These will soon be replaced by ESP8266 devices connected directly to WIFI and using MQTT as the protocol.

Accordingly I want to interrogate those devices and send off the information somewhere.

There are a number of ways of sending information to GroveStreams via their API – and as far as Node-Red is concerned there is an http response node – you could tie that to a function block but I thought it would be nice to have a dedicated GroveStreams node – and so here it is.

GroveStreams node by Peter Scargill

What you see above is an MQTT listener awaiting a regularly-sent value from a module – and firing it off to GroveStreams. What I like about their service is simplicity. I can tell it the name of a stream and if it does not exist, it will be created automatically.


GroveStreams setup

I made a nice simple dialog box. You can get an API key from your GroveStreams control panel and this is an example (a dummy example). As you can see I’ve given the node a meaningful name, the API key, the name of a “component” and the name of a “stream” under that component – a lot simpler than it looks. All the node needs is an incoming value and that’s it.


In the example below, neither RaspberryPi nor temperature existed initially – I put these in the dialog box, ran Node-Red and magically they appeared in the web interface for GroveStreams.  The API key is what you call a “Feed put API key with auto registration rights”. I won’t go into GroveStreams setup or we’ll be here all night.

And that is all there is to it.

sudo npm install node-red-contrib-grove

or depending how you set up your node-red

sudo npm install -g node-red-contrib-grove

(a quick restart of node-red and you should find the nice purple icon appear)

I hope this helps, if you do manage to get this working on any particular system do let us know what steps you took. Might save someone else some work.

Here’s that temperature graph from the sensor in Spain. GroveStreams does an excellent job of overlaying internal and external temperatures with humidity.