A hobby project: Local weather onto Twitter and the Web

asema A year ago I suddenly grew an interest in following the weather. Being a bit too quality-focused, there was little alternative to buying a Davis Vantage Pro 2 weather station with a cool console inside and mounting it onto the roof of our house. But what kind of dev-minded person would I be, had I not pushed the data onto the web?

Luckily my wife is a geek too, so the project was a pretty quick two-(wo)man job. We plugged a TCP/IP data logger into the Davis station and connected it to our local network. Next we wrote a custom client to poll data from the station on regular intervals and push it into a SQL Server database. At this point Excel was of course running wild, and we had loads of interesting charts representing the correlations of outside temperature, inside humidity and whatnot…

But publishing the data to the web was our goal all the time. Although many existing weather services are available in Helsinki, there is something about locality. Also, very few services provide more specialized metrics such as UV Radiation Index readings or decent history perspectives.

image Our local weather has been published onto the web since the start of 2009. The site is only available in Finnish, but the basic metrics are pretty universally readable. And as you can decipher from the layout, the site was made with ASP.NET MVC – Preview 3 or something at the time we started. Charting was a snap with ASP.NET Chart controls. (on the left: top, average and bottom temperatures as well as rain amounts for last months)

Introducing eventing

But with all that done, something was missing. Looking at the weather site was too cumbersome. When something happens, I want to know. So the next logical step was to look at events: parsing the weather data so that we could recognize patterns and let the station inform us when something is going on.

Trivial examples of events are things like “It has started raining”. “The wind is picking up” is a bit more complex, as certain measuring inaccuracies need to be compensated for, and raising the alert too easily would make it meaningless. At the other extreme, one of the toughest nuts is identifying the cloudiness state – how much solar radiation energy (in W/m2) indicates “clear” when the sun angle is 35°? How do you even know the sun angle?

imageWhile the eventing paradigm still has lots of new ideas to be developed, we have now pushed the event feed out. If you’re interested in our local weather, subscribe to @hel_weather (or @helsinki_saa in Finnish) on Twitter. Once the eventing logic stuff was resolved, tweeting was just a simple matter of throwing TweetSharp into the solution and adding a few lines of code.

All in all, a very enlightening experience, all the way from assembling the hardware, studying weather mechanics and then finally writing the software. And as it is, the software part actually seemed pretty easy by comparison… Exactly as it should be. :-)

August 22, 2009 · Jouni Heikniemi · No Comments
Tags:  · Posted in: General

Leave a Reply