Weather Prediction with Node-Red, forecast.io and a Raspberry Pi
BRAMLEYD 100000UYS6 Comment (1) Visits (5643)
The Requirement - when will it rain?
(if you are reading this on a mobile device and the formatting is not right - try this link: http
At the end of 2012 I moved out of the city centre into the New Forest National park. One of the benefits of living in the countryside is that my new location enjoys relatively Dark Skies - and I have over the course of last year become a keen Astr
(To see some of my images check out:
A feature of the pursuit of Astro-Photography is the need to leave expensive equipment outside over night as it captures the hours of data necessary to create an image. As none of this equipment is water-proof, this leads to acute paranoia that the heavens may open the moment you take your eye off the sky or fall asleep.
So here is my solution to the problem which utilises a fantastic new technology built in IBM Hursley: Node - Red to take Ultra Local rain forcasting from forecast.io and trigger an alarm to wake me up should rain be predicted in the next 45 minutes.
Node-Red is an intuitive, easy to use tool based on Node.js that makes it incredibly simple to wire together services and devices . What's more - it has recently been releasd to the open-source community so is free for all!
More information can be found at the following links:
Node-Red also satisifed my other requirement in that it can be run on A Raspberry Pi - meaning that it can be unobtrusively left on 24x7.
Forecast.io is a great service that utilises radar feeds to make ultra local rainfall predictions. The site uses high resolution feeds in North America and from the Met Office in the UK and I have found it to be quite accurate. In other regions the without high resolution radar the prediction may be less accurate.
What makes the site awesome is that an api is provided that can be called 1000 times a day for free. All you need to do is sign up for an account and get an apikey from here:
Putting it all together
The following screenshot shows the Node-Red flow used to :
The Lat / Long location is passed into the flow from the Inject Node:
The forecast api key needs to be inserted into the url in the HTTP Get node.
Finally the function that does the parsing:
As an idea of the actions triggered from the flow:
The devices doing the actual "home automation" are based on the JeeNode system - again controlled from Node-Red. More on this in the next edtion....
So go ahead and give it a go! Use the Node-Red Import from Clipboard function to recreate this flow: