Sun, Wind, and Rain

Sun, Wind, and Rain

I lost my mind for a moment and went shopping online: a wind sensor (Oregon Scientific WGR800) , an UV sensor (Oregon Scientific UVN800), and a rain gauge (Oregon Scientific PCR800). The package received was much bigger than expected, especially the wind sensor is quite a sturdy piece. With a little improvisation it all sits on the roof now. At first I got no readings on Telldus Live which made me a bit nervous. It turned out that all it took was to flash the Telldus Net unit with the latest firmware, then the new sensors appeared. Phew. Next worry was if telldus2graphite would manage the new sensors. I had only tested with temperature and humidity sensors before. But it seems to work. Here’s the updated Graphene dashboard:

Screenshot from 2015-03-24 22:48:02


The Quantified Home

Featured image

Some weeks ago I was fiddling with Docker and found a premade Graphite image in the Docker repo. Anyone that has tried to install Graphite knows it is not a very straight forward process, so I got excited and the image turned out to just work. Now I wanted to push some data into my Graphite instance. So I started with Node and looked for a way to fetch data from my sensors on Telldus Live. A few nights later I had started two new repos on github: telldus2graphite and telldus-live-promise. Sensor data from Telldus Live can be fetched by calling the telldus2graphite Node script from a cron job:

* * * * * node <path to telldus2graphite>/node_modules/.bin/telldus2graphite

I thought it could be useful to extract the Telldus Live part from the telldus2graphite project to its own project. I had started out using the telldus-live npm module in the beginning, but I wanted to roll my own based on promises, hence the name telldus-live-promise. Instead of using callbacks the syntax goes like this:


Our electricity meter is hooked up to an ELIQ energy monitor. Although ELIQ has a rather attractive and powerful visual interface, I wanted to fetch energy data into Graphite as well. So I made two more repos: eliq2graphite and eliq-promise.

Fetching the last 24 hours of energy data every hour with eliq2graphite would look like this:

0 * * * * node <path to eliq2graphite>/node_modules/.bin/eliq2graphite --age 24 --resolution hour

eliq2graphite is using eliq-promise to access the ELIQ API, and the syntax goes like this:

eliq.getFromTo (<startdate>, <enddate>, '6min' | 'hour' | 'day').then(console.log).catch(console.log);
{ startdate: '2015-03-02T20:00:00+00:00', 
  enddate: '2015-03-02T23:00:00+00:00',
  intervaltype: '6min',
    [ { avgpower: 2790,
    energy: 279,
    temp_out: null,
    time_start: '2015-03-02T20:00:00',
    time_end: '2015-03-02T20:06:00' },

With both sensor values and energy consumption in Graphite I wanted to create a more visual appealing dashboard than the built in ones that Graphite provides. I made a fork of Graphene and created my dashboard there. Creating dashboards in Graphene is very straight forward and I decided to serve it as simple as possible using python SimpleHTTPServer running as a screen process:


cd graphene

lineCount=`screen -r graphene | grep &quot;There is no screen to be resumed matching graphene.&quot; | wc -l`

if [ $lineCount -eq 1 ] ; then
    echo linecount: $lineCount. Starting in a deteched screen named graphener. Use screen -r graphene to view.
    screen -dmS graphene python -m SimpleHTTPServer 8888
    echo lineCount: $lineCount. graphene is already running. Use screen -r graphene to view. Running now.
    screen -r graphene

I’m using an old netbook to run Graphite, Graphene, and the cron jobs. By the way, old netbooks are great for home servers – they come with UPS and monitors, take up minimum space and are quiet and energy efficient. The dashboard is displayed on an v.1 ipad in the kitchen (it can still do that job). Well, that’s it.