Nerdy Weather Station

Last year, I decided to learn something new and followed this guide to make my own IoT weather station. It turned out well!

IoT Weather Station
IoT Weather Station

However, that original project relies on IFTTT, which has suddenly decided it is going to charge for anything more than 3 applets. (I had, oh, 15 or so, one for updating the weather each hour, and one for the next day’s forecast, displayed around 9pm.) I figured there had to be another way to accomplish this simple task: check weather report, send conditions and temperature to the Adafruit IO API. I may yet end up converting this to a Python script so that it lives on my own hardware, but for now, I converted it to a Microsoft Flow. (NOTE: my company uses all Microsoft software, so I was able to use the HTTP portion of Flow without paying extra; a definite downside and another reason to convert to a Python script eventually!)

Microsoft Flow is very similar to IFTTT in that you can set up the output of one action to be the input of another. But it also ended up having the added bonus of more configurable recurrence intervals. So now, instead of updating every hour, my weather station can update every ten minutes. It also ends up using MSN weather instead of Weather Underground (which requires purchase of a real weather station to get access to their API) or Dark Sky (which closed access to their API following their purchase by Apple).

UPDATE: I just couldn’t stand it, so I decided to take a crack at converting this to a Python script, and it was super easy. I’m using the OpenWeather API, specifically the “OneCall” API, which gives me the current weather and a 7 day forecast, all in one. I wrote two scripts, which provide the forecast every night, and the current weather updated every ten minutes. My Raspberry PI uses the cron to schedule these and send the output to Adafruit IO. The best part of having my own scripts is that any new “unknown” weather conditions can easily be adapted to the conditions that the weather station code understands. (For example, the weather station understood “Sunny” and lit up the sun icon, but did not know “Partly sunny” should do the same. Easy fix now, rather than having to reprogram the weather station itself.) The OpenWeather API is free for most of its APIs, up to 60 calls/minute and 1,000,000 calls/month, way more than I should ever need. So far, the data looks decent too, at least somewhat in line with other weather apps.

This was supposed to be a fun side project to teach myself more about soldering and programming Arduino devices. As it turned out, it was a great project for figuring out how to adapt a project to use completely different services than the ones that were originally used.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s