Want to calculate seasonal growing degree days and seasonal cold damage score

Hi… Newby here… and before I set off on a path, I wanted to look for comments and suggestions. The end goal is to calculate, and daily display, the seasonal growing degree days during the summer and the cold damage days during the winter. We have a blueberry farm and vegetable gardens.
So far, I have a Tempest running and WFPiConsole running (with a lot of help from Peter… thanx again, sir).
What I think I should do next is get weewx running with the weewx-udp and learn something (maybe python?) to do the math. Then maybe add in a page to the WFPiConsole for the display of the garden stuff.
I am working on a laptop with a dual boot Windows 10/ Ubuntu 18.04 that I plan to leave on the kitchen counter with WFPiconsole running.
Does that general game plan make sense? Does anyone else have something similar? Does anyone want the calculation formulas to add it into something else?
Many thanx in advance… jt

1 Like

Sounds like something I’m interested in! I would like to calculate the chill hours (stone fruit and apple orchards) and be able to provide some eventual historical data to other orchardists/growers. I’m looking to track temps between 32F and 45F between Nov 1 and Feb 28/29.

1 Like

I’m on the verge of retirement and as soon as I don’t have to spell COVID any more, I will work on this if no one else has. I have a feeling, this will be great!

I know this thread is six months old, but as a farmer, having the ability to calculate growing degree days is something that would be very useful to me! Hopefully this is a feature that can be implemented in the future.

I am also a farmer needing to calculate degree days. I cannot figure out how to make a rest query for the daily history as I can for observations. This does not seem like rocket science but the API documentation is silent on this and have I found any help on this forum.

WeeWX has their ‘NOAA’ reports that do this automatically…

                   MONTHLY CLIMATOLOGICAL SUMMARY for Sep 2021


NAME: Federal Way, Washington                  
ELEV: 365 feet    LAT: 47-18.60 N    LONG: 122-21.60 W


                   TEMPERATURE (F), RAIN (in), WIND SPEED (mph)

                                         HEAT   COOL         AVG
      MEAN                               DEG    DEG          WIND                   DOM
DAY   TEMP   HIGH   TIME    LOW   TIME   DAYS   DAYS   RAIN  SPEED   HIGH   TIME    DIR
---------------------------------------------------------------------------------------
 01   59.1   74.0  13:54   44.8  06:41    5.9    0.0   0.00    1.6   16.0  15:50    351
 02   63.1   80.3  15:28   46.9  06:50    1.9    0.0   0.00    1.2   11.0  14:09      4
 03   64.1   83.3  12:34   47.3  06:11    0.9    0.0   0.00    1.0   10.0  14:17    355
 04   65.7   82.8  15:11   49.7  06:11    0.0    0.7   0.00    1.6   14.0  16:45    240
 05   69.8   86.5  15:28   63.0  23:52    0.0    4.8   0.00    1.3   12.0  14:21    254
 06   66.3   80.4  14:12   57.2  23:59    0.0    1.3   0.00    1.7   11.0  00:40    338
 07   65.2   82.5  14:21   50.9  07:05    0.0    0.2   0.00    1.4   14.0  14:50      5
 08   70.9   86.0  13:50   60.7  23:58    0.0    5.9   0.00    2.0   12.0  03:34    254
 09   67.6   83.6  15:35   55.0  05:52    0.0    2.6   0.00    1.5   13.0  17:20    247
 10   61.8   66.9  17:58   58.0  23:21    3.2    0.0   0.00    1.6   12.0  18:46    217
 11   63.7   79.0  14:09   56.3  05:52    1.3    0.0   0.00    1.7   12.0  12:33    204
 12   59.6   69.0  16:12   55.8  23:57    5.4    0.0   0.06    0.6    8.0  12:57     28
 13   61.5   76.3  15:13   52.4  23:52    3.5    0.0   0.00    1.1   13.0  14:18     23
 14   60.9   73.1  11:59   47.7  06:34    4.1    0.0   0.01    1.2   11.0  16:25    240
 15   59.0   70.0  15:19   53.0  07:54    6.0    0.0   0.07    1.1   12.0  00:57    295
 16   56.5   71.4  13:51   42.5  07:11    8.5    0.0   0.00    1.0   10.0  11:02     17
 17   57.9   69.1  22:03   53.1  06:20    7.1    0.0   0.57    2.4   25.0  23:10    189
 18   56.3   67.4  13:11   51.9  23:49    8.7    0.0   0.79    3.4   18.0  02:55    186
 19   56.4   62.7  17:25   51.3  01:59    8.6    0.0   0.08    2.9   19.0  11:01    221
 20   60.1   73.3  13:47   52.7  02:00    4.9    0.0   0.00    1.8   11.0  13:12    219
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
---------------------------------------------------------------------------------------
      62.3   86.5     05   42.5     16   70.0   15.6   1.58    1.6   25.0     17    244

Yes this the kind of thing I want to do, just hoping to do it with Windows/Excel (I think weewix is a unix/linux app), Excel provide features which provide access to external data sources. Tempest provides the data as “history” on their Web app but for some reason do not support it as a query. Get a 404 when I use https://swd.weatherflow.com/swd/rest/history/station/34475?token=97af1d4f-0de8-4a3a-a8eb-b0fa91bc4fec, substitute “observations” for ”history” and I can populate a table- suspect it is a Jason dataset, no problem. Just hoping to save time and effort using the tools I have. Thanks for the response.

Richard Anderson

image002.jpg

I think you’d need to do a query specifying the start+stop time for each day, probably using either day_offset or time_start (and time_end).

https://weatherflow.github.io/Tempest/api/swagger/#!/observations/getObservationsByDeviceId

My knowledge of SQL is very basic, I need to get the high and low temperature for each day. I will look a SQL Queries reference I have. Thanks

image002.jpg

I used Swagger with no success, it returned a 404 using the query it generated using the ?day_offset=1 option. I researched http queries, useful but did not help. I get the feeling that Tempest does not provide the same access to users as myself as it does to developers. We are apparently allowed access to a very limited data set. Not sure that I agree with this policy. As such my weather station is an interesting do dad but does not help me or others to compute degree days from “our” data. All I want to do is use Excel to query my station data for an average day temperature, or at least a string of temperatures from which a average can be computed.

No, you’re not limited. You’re just not constructing the correct URL to query (once you’re authenticated).

Here’s some example queries for my (former) gear starting Aug-1-2020 for 1000 seconds afterward. I used a 400 day offset since there’s no data for this station for a year or so now. Works for me once you construct the correct URL.

I authorized it using my account and got a authorization token for viewing my stuff (obfuscated below a little just in case…)

Stations returns my station id (15421)
curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer 3d863cd1-2514-4ede-bc38-57595e123456' 'https://swd.weatherflow.com/swd/rest/stations'

and the devices for that station (my tempest was id 54252)

curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer 3d863cd1-2514-4ede-bc38-57595e123456' 'https://swd.weatherflow.com/swd/rest/stations/15421'

observations

my latest observation is from the following (this returns ‘no recent observations’ since the station has been down for a year:

curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer 3d863cd1-2514-4ede-bc38-57595e123456' 'https://swd.weatherflow.com/swd/rest/observations/station/15421'

historical observations

My tempest was id 54252, so I get its data via:

curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer 3d863cd1-2514-4ede-bc38-57595e123456' 'https://swd.weatherflow.com/swd/rest/observations/device/54252?day_offset=400&time_start=1596265200&time_end=1596266200'

Note the 400 day offset and time_start of Aug-1-2020 PDT and time_start 1000 secs later since I shut this station down a year ago, but the old data is still queryable via their REST API.

1 Like

OK, I see my error in not using &time_start, &time_end. It looks like each query parameter needs an &. I will see if I can produce some usable data. I will save other questions when I see some data. I know I am a cranky old man and my IT skills very dated. Thanks for putting up with me.

1 Like

No success in getting past data or even todays data stream with Swagger, using https://swd.weatherflow.com/swd/rest/observations/device/34475?day_offset=0&time_start=1632687736&time_end=1632689736&format=csv&token=97af1d4f-0de8-4a3a-a8eb-b0fa91bc4fec to get todays data just a 404. I can get my station id, current observations but no past data. Just not getting it.

Lets see exactly what commands you ran ‘and’ what they returned for each thing that worked…and that didn’t work. You might be doing something trivial like using the wrong device id.

The observation query for 34475:

curl -X GET --header ‘Accept: application/json’ --header ‘Authorization: Bearer 20dc6406-477d-406a-b63e-ff52f57c8c71’ ‘https://swd.weatherflow.com/swd/rest/observations/station/34475?token=97af1d4f-0de8-4a3a-a8eb-b0fa91xxxxxx

Request URL

https://swd.weatherflow.com/swd/rest/observations/station/34475?token=97af1d4f-0de8-4a3a-a8eb-b0fa91xxxxxx

Response Body

{
  "station_id": 34475,
  "station_name": "Westcott Bay West",
  "public_name": "Mosquito Pass Ln",
  "latitude": 48.6022,

202 It works

The query for past data

Request URL

https://swd.weatherflow.com/swd/rest/observations/device/34475?day_offset=0&time_start=1632687736&time_end=1632689736&format=csv&token=97af1d4f-0de8-4a3a-a8eb-b0fa91xxxxxx

Response Body

{
  "status": {
    "status_code": 404,
    "status_message": "NOT FOUND"
  }
}

This one 404’s , tried yesterday with offset=1 start=1632528060 end=1632530060 and it 404’s
Thanks for the help.

https://swd.weatherflow.com/swd/rest/stations/34475?token=97af1d4f-0de8-4a3a-a8eb-b0fa91xxxxxx
returns

{"stations":[{"location_id":34475,"station_id":34475,"name":"Westcott Bay West","public_name":"Mosquito Pass Ln","latitude":48.6022,"longitude":-123.16184,"timezone":"America/Los_Angeles","timezone_offset_minutes":-420,"station_meta":{"share_with_wf":true,"share_with_wu":false,"elevation":15.28041744232178},"last_modified_epoch":1631940124,"created_epoch":1607564819,"devices":[{"device_id":106720,"serial_number":"HB-00026352","device_meta":{"agl":0.0,"name":"HB-00026352","environment":"indoor","wifi_network_name":""},"device_type":"HB","hardware_revision":"0","firmware_revision":"170"},{"device_id":106721,"serial_number":"ST-00018768","device_meta":{"agl":6.0,"name":"ST-00018768","environment":"outdoor","wifi_network_name":""},"device_settings":{"show_precip_final":true},"device_type":"ST","hardware_revision":"1","firmware_revision":"156"}],"station_items":[{"location_item_id":285365,"location_id":34475,"device_id":106721,"item":"air_temperature_humidity","sort":0,"station_id":34475,"station_item_id":285365},{"location_item_id":285367,"location_id":34475,"device_id":106721,"item":"barometric_pressure","sort":1,"station_id":34475,"station_item_id":285367},{"location_item_id":285369,"location_id":34475,"device_id":106721,"item":"light","sort":4,"station_id":34475,"station_item_id":285369},{"location_item_id":285366,"location_id":34475,"device_id":106721,"item":"lightning","sort":2,"station_id":34475,"station_item_id":285366},{"location_item_id":285368,"location_id":34475,"device_id":106721,"item":"rain","sort":5,"station_id":34475,"station_item_id":285368},{"location_item_id":285370,"location_id":34475,"device_id":106721,"item":"wind","sort":3,"station_id":34475,"station_item_id":285370}],"is_local_mode":false}],"status":{"status_code":0,"status_message":"SUCCESS"}}

You are using your location_id when you should be using your device_id…

Try using a device_id of 106721 in your query. That works.

1 Like

Just for the purpose of privacy I edited out the token key a bit :wink:

If you want to share it, do it via a PM or make one that you will delete and change afterwards. This way your data stays ‘yours’

1 Like

I was under the impression the tokens expired after a time period when you used the web interface, so I didn’t do any editing. At least it seemed that way experimentally when I used the web interface to query my old station in an earlier followup…