What I want to do
I would like to create a simple script/recipe to help plan for weather-sensitive group events (aka Balloon/Kite Mapping) by polling weather forecast data for the specific time/location and posting alerts to a group calendar event/discussion list/wiki/webpage etc... Further iterations can target windspeed forecast data in order to determine appropriate preparations (I.e Kites, Balloons or RC Vehicles). Existing PublicLab materials such as the template for hosting a balloon mapping workshop , the Flight Log Template and the preflight checklist
Why I'm interested
HELIUM IS GETTING EXPENSIVE!!! Not as expensive as renting a helicopter of course, but at $50/a day per tank rental, plus the cost of a weather balloon thats $50 more than the cost of a decent sled kite. If we can use weather data to determine when conditions may be more favorable to either kite or balloons, we can be much more efficient in our planning and hopefully enjoy more consistent results!
My attempt and results
####Update 5/11/14 A different note about a related project prompted a great discussion thread with relevance to this current effort- http://publiclab.org/notes/code4maine/05-08-2014/mobilizing-data-to-combat-the-evil-green-crab#comments
I'm beginning to think that basic wind measurements may not be a very accurate tool for determining which tool to use. This could be of major significance to my other project I mentioned earlier where I've been trying to set up a weather alert webapp for grassroots mappers. My usual method for determining if conditions are sufficient for kite mapping is to simply look out my window at the height of the waves. This is actually pretty reliable when you consider larger waves must be generated by relatively consistent winds. Like yesterday, there does not appear to be nearly enough wind to fly a kite today. Yet some weather sources still report windspeeds up to 7mph. So I'm going to try a couple different things... First I'll take a picture of the waves measured against something for reference. Then I'll take readings from a couple different windspeed apps and log the measurements. Then I'll sample weather reports from a few mainstream sources. Finally, I'll see if I can in fact get a sled kite in the air in present conditions (which would also be a good test for whether or not wifi-only iPod/iPads will stamp Exif data if nowhere near a wifi connection since I'll be using an old iPod touch).
I'll post the results of this experiment as soon as I get the chance.
####Posting to Google Calendar
Google Calendar does apparently have its own native weather forecast feature (https://support.google.com/calendar/answer/48494?hl=en) but thus far it only appears to display the temperature, and does not seem to be an option for specific events.
It also seems like exactly the kind of simple task that they created "If This Then That (www.ifttt.com) for, but the IFTTT interface appears to lack enough options to make it happen. The problem may be symptomatic of IFTTT's limitations overall in that is it only gives you options to trigger weather events if they relate to "current" or "tomorrows" weather conditions. But in order for the function to be useful it presumably would need to provide updates between 2-4 days in advance.
Since weather data is one of the more common data sets, there should be any number of sources like wunderground.com, weather.com, noaa.gov etc...
I'm looking at www.forecast.io at present as it allows up to 1,000 calls/day for free!
Forecast.io includes a "Time Machine" feature which allows users to search weather conditions for any specific location at any date in the past and very near future. This would be perfect if the results provided an HTML widget or sharing options beyond Twitter, Facebook or Google+. But at present those are the only "click and go" options.
So the challenging part is getting the forecast.io feed to post to a specific Google Calendar event. Once the feed is posted, there are various options for configuring email alerts either through calendars native sharing options or via ifttt.
So it looks like its time to finally get my feet wet in the world of APIs and OAuth tokens...
Coming from the world of Arduino/Hardware programming, I'm well familiar with tools like www.temboo.com that allow you to connect various data APIs through precompiled datasets and embeddedable code snippets for Arduino sketches. If it works for Arduino, then why not Google Calendar? As it turns out, Temboo has a prepackaged library for polling weather data from a specific location (https://www.temboo.com/library/Library/Labs/GetWeather/ByAddress/). It also has an "Update Calendar" function in the Google library (https://www.temboo.com/library/Library/Google/Calendar/UpdateCalendar/ which makes it easy to set up the OAuth tokens etc... Now the only issue is choosing the format I want to output the code to. Temboo supports Android, iOS, php, Java, Processing, Python, Node.js, Ruby and Arduino. Out of these I know Arduino, Processing and little Python. Though if I had to learn anything new right now it would be Node.js for a number of reasons.
Google Calendar API
It looks like the only real way of working within specific Google Calendar Events is to finally learn how to work with APIs and JSON. Specifically, the Google Calendar APIv3. As this would require authentication services etc... Temboo.com is looking more and more appealing.
Smartphone as Windspeed Sensor
One of my students pointed out to me today that smartphones can be used as a decent anemometer (wind speed sensor) and sure enough I found a whole host of different apps that use the phones microphone to calculate wind speed and direction! We put this to a test by measuring how much wind speed it takes to get a kite up in the air. In previous attempts at the same location with the same kite, conditions were completely calm and it proved impossible to launch the kite. Today wind gusts were between 0 and 13MPH and the kite took off on the first try! We were also able to see how the windspeed fluctuations stopped having a negative effect once the kite achieved a certain altitude (which we can measure with an altimeter next time). The app I was using (called ZephyrPro Wind Meter) logged the data as a line graph and allows for export via .csv. Such a feature could be combined with the phones camera to augment a flight log. Should the weather forecast winds over 8MPH we now know that KAP might be a good option.
Customized Recommendations via Node-RED, MQTT and forecast.io
I've known about this hack for awhile but haven't had a use for it until now... https://www.ibm.com/developerworks/community/blogs/B-Fool/entry/weather_prediction_with_node_red_forecast_io_and_a_raspberry_pi?lang=en Node-RED is a visual GUI allowing users to create "flows" between various inputs and outputs between the web and embedded objects. In the above link, a user has submitted a "flow" that uses a protocol called MQTT to poll forecast.io for any rain predictions at his precise location. If rain is in the forecast he receives a message alerting him to bring his Raspberry Pi indoors. A similar flow can be configured to not only send an alert should bad weather occur during a planned event, but it could also be configured to make specific recommendations based on anticipated wind conditions. So if winds are forecasted to remain below 5MPH we would know it would be a good day to put down a deposit on a helium tank, whereas if it is over 10MPH we'll know that a Kite will work as well (we haven't tested how much wind is too much for a balloon, and hopefully won't have to!)
E-Paper Weather Alerts
This awesome post on Hack-A-Day has a great example of the kind of application I have in mind! The blogger Jeremy Blum rigged up this brilliant E-Paper Weather Alert Display by pulling data from yahoo weather via a Raspberry Pi and pushing it to the e-Paper shield. It also uses an ultrabright LED similar to the Visualight to indicate severe events.
Questions and next steps
Now that the original requirement for working with Google Calendar has come and gone, we're free to consider other options. For example, perhaps it might be better to set up a wiki template for community mapping workshops so as to gather all the various materials in a single location. For example, when participants sign up for an event, their names could be added to a listserv configured for alerts via MQTT until the event has past.
If other more programming-savvy PLers are interested then any advice would be greatly appreciated,
2 Comments
My favorite website for future predictions is the the hourly weather graph from NOAA. it is very detailed and much better than the simplified predictions of most "weather services" which all pull NOAA data anyways. If you're looking to make a weather app, pull data straight from NOAA.
Also, Weather Underground's new interface replicates NOAA's graphs and makes them prettier and easier to read.. They have an android app, but it crashes on my stock Nexus 5, so I've never seen it.
Is this a question? Click here to post it to the Questions page.
Reply to this comment...
Log in to comment
Yeah I was just checking out NOAAs National Digital Forecast Database (http://graphical.weather.gov/xml/rest.php#use_it) in the process if trying to connect the NOAA library on www.temboo.com with the equivalent GCal client library (https://live.temboo.com/library/Library/Google/Calendar/) Apparently NOAA even has its own "Digital Weather Markup" format? In any case, it looks like the Calendar API is going to be the steepest learning curve...
Is this a question? Click here to post it to the Questions page.
Reply to this comment...
Log in to comment
Login to comment.