Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Know the rainfall for my garden #863

Open
CloCkWeRX opened this issue Apr 10, 2016 · 3 comments
Open

Know the rainfall for my garden #863

CloCkWeRX opened this issue Apr 10, 2016 · 3 comments

Comments

@CloCkWeRX
Copy link
Collaborator

Farmlogs does this, we could do it on a smaller scale: each day hit a weather API and record temp/rainfall/etc.

This lets me compare climate to yield when planting next year

@CloCkWeRX CloCkWeRX mentioned this issue Jan 25, 2017
@CloCkWeRX
Copy link
Collaborator Author

https://www.mapbox.com/blog/weather-along-route/ points out http://openweathermap.org/api which might be of interest

@Br3nda
Copy link
Member

Br3nda commented Mar 12, 2017

Maybe wunderground integration would work here?

@CloCkWeRX
Copy link
Collaborator Author

CloCkWeRX commented Apr 10, 2017

I've done a proof of concept for this; here's the rake task output at the planting level.

clockwerx@clockwerx-laptop:~/growstuff$ bundle exec rake planting:determine_current_weather
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
Weather for Adelaide, SA is 17 degree(s) celcius and Clouds
Weather for Adelaide, SA is 17 degree(s) celcius and Clouds
Weather for Watson is 12.34 degree(s) celcius and Clouds
Weather for O'Connor is 12.35 degree(s) celcius and Clouds
Weather for Downer is 12.36 degree(s) celcius and Clouds

Plantings have PlantingWeatherLogs; which have a weather_data JSON structure. That ties us to postgres; but I think its worth it.

Sample data from the API call looks like:

  {"coord"=>{"lon"=>138.6, "lat"=>-34.92},
   "weather"=>
    [{"id"=>803,
      "main"=>"Clouds",
      "description"=>"broken clouds",
      "icon"=>"04d"}],
   "base"=>"stations",
   "main"=>
    {"temp"=>17,
     "pressure"=>1024,
     "humidity"=>51,
     "temp_min"=>17,
     "temp_max"=>17},
   "visibility"=>10000,
   "wind"=>{"speed"=>5.1, "deg"=>190},
   "clouds"=>{"all"=>75},
   "dt"=>1491809400,
   "sys"=>
    {"type"=>1,
     "id"=>8204,
     "message"=>0.0103,
     "country"=>"AU",
     "sunrise"=>1491771922,
     "sunset"=>1491812870},
   "id"=>7839644,
   "name"=>"Adelaide",
   "cod"=>200}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Growstuff
  
Backlog
Development

No branches or pull requests

2 participants